You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.3 KiB

7 months ago
  1. # React + TypeScript + Vite
  2. This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
  3. Currently, two official plugins are available:
  4. - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
  5. - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
  6. ## Expanding the ESLint configuration
  7. If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
  8. - Configure the top-level `parserOptions` property like this:
  9. ```js
  10. export default {
  11. // other rules...
  12. parserOptions: {
  13. ecmaVersion: 'latest',
  14. sourceType: 'module',
  15. project: ['./tsconfig.json', './tsconfig.node.json'],
  16. tsconfigRootDir: __dirname,
  17. },
  18. }
  19. ```
  20. - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
  21. - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
  22. - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list