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 uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Command:
- npm create vite@latest
- select React project -> Javascript
- cd to project folder
- npm install
- open Visual Studio Code
- Install Eslint to VSCode
- npm i -save-dev -save-exact prettier
- npm i --save-dev eslint-config-prettier
- Append to extends in the file .eslintrc.cjs as last option 'prettier'
- Append to scripts -> package.json "format": "prettier --write ./src"
- For cheking conflicts with prettier rules run command: npx eslint-config-prettier .\src\main.jsx
Links: