···11+# React + TypeScript + Vite
22+33+This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
44+55+Currently, two official plugins are available:
66+77+- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
88+- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
99+1010+## React Compiler
1111+1212+The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
1313+1414+## Expanding the ESLint configuration
1515+1616+If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
1717+1818+```js
1919+export default defineConfig([
2020+ globalIgnores(['dist']),
2121+ {
2222+ files: ['**/*.{ts,tsx}'],
2323+ extends: [
2424+ // Other configs...
2525+2626+ // Remove tseslint.configs.recommended and replace with this
2727+ tseslint.configs.recommendedTypeChecked,
2828+ // Alternatively, use this for stricter rules
2929+ tseslint.configs.strictTypeChecked,
3030+ // Optionally, add this for stylistic rules
3131+ tseslint.configs.stylisticTypeChecked,
3232+3333+ // Other configs...
3434+ ],
3535+ languageOptions: {
3636+ parserOptions: {
3737+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
3838+ tsconfigRootDir: import.meta.dirname,
3939+ },
4040+ // other options...
4141+ },
4242+ },
4343+])
4444+```
4545+4646+You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
4747+4848+```js
4949+// eslint.config.js
5050+import reactX from 'eslint-plugin-react-x'
5151+import reactDom from 'eslint-plugin-react-dom'
5252+5353+export default defineConfig([
5454+ globalIgnores(['dist']),
5555+ {
5656+ files: ['**/*.{ts,tsx}'],
5757+ extends: [
5858+ // Other configs...
5959+ // Enable lint rules for React
6060+ reactX.configs['recommended-typescript'],
6161+ // Enable lint rules for React DOM
6262+ reactDom.configs.recommended,
6363+ ],
6464+ languageOptions: {
6565+ parserOptions: {
6666+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
6767+ tsconfigRootDir: import.meta.dirname,
6868+ },
6969+ // other options...
7070+ },
7171+ },
7272+])
7373+```