NOTE: Vite comes with ESLint preconfigured, so there's no need to explicitly install the 'vite-plugin-eslint' plugin now.
-
Download the ESLint extension
-
Run the following command in terminal
npm i eslint vite-plugin-eslint eslint-config-react-app --save-dev
-
Create a
.eslintrc.json
file and paste the following snippet into it{ "extends": "react-app" }
-
Update the
vite.config.js
file as follows:import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import eslint from "vite-plugin-eslint"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), eslint()], });