···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/) 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+## Expanding the ESLint configuration
1111+1212+If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
1313+1414+```js
1515+export default tseslint.config({
1616+ extends: [
1717+ // Remove ...tseslint.configs.recommended and replace with this
1818+ ...tseslint.configs.recommendedTypeChecked,
1919+ // Alternatively, use this for stricter rules
2020+ ...tseslint.configs.strictTypeChecked,
2121+ // Optionally, add this for stylistic rules
2222+ ...tseslint.configs.stylisticTypeChecked,
2323+ ],
2424+ languageOptions: {
2525+ // other options...
2626+ parserOptions: {
2727+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
2828+ tsconfigRootDir: import.meta.dirname,
2929+ },
3030+ },
3131+})
3232+```
3333+3434+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:
3535+3636+```js
3737+// eslint.config.js
3838+import reactX from 'eslint-plugin-react-x'
3939+import reactDom from 'eslint-plugin-react-dom'
4040+4141+export default tseslint.config({
4242+ plugins: {
4343+ // Add the react-x and react-dom plugins
4444+ 'react-x': reactX,
4545+ 'react-dom': reactDom,
4646+ },
4747+ rules: {
4848+ // other rules...
4949+ // Enable its recommended typescript rules
5050+ ...reactX.configs['recommended-typescript'].rules,
5151+ ...reactDom.configs.recommended.rules,
5252+ },
5353+})
5454+```