This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react, which uses Babel for Fast Refresh
- @vitejs/plugin-react-swc, which uses SWC for Fast Refresh
If you're developing a production application, we recommend updating the configuration to enable type-aware lint rules:
- Configure the top-level
parserOptionsproperty as follows:
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}- Replace
plugin:@typescript-eslint/recommendedwithplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked. - Optionally, add
plugin:@typescript-eslint/stylistic-type-checked. - Install eslint-plugin-react and add
plugin:react/recommendedandplugin:react/jsx-runtimeto theextendslist.
© 2024 edX Boot Camps LLC. Confidential and Proprietary. All Rights Reserved.