Getting started
eslint-plugin-vite is a flat-config-first ESLint plugin for catching Vite and Vitest configuration mistakes before they become runtime or build failures.
Installationโ
npm install --save-dev @typpi/eslint-plugin-vite eslint
If your repository already uses Vite or Vitest, you do not need to change how those tools run just to adopt this plugin.
Quick startโ
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.recommended];
That preset already configures @typescript-eslint/parser for the files it targets.
Common compositionsโ
Vite app with client-side env and glob usageโ
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.recommended, vite.configs.client];
Vitest monorepo with workspacesโ
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.recommended, vite.configs.vitest];
Repository with dedicated benchmark filesโ
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.recommended, vite.configs.vitest-bench];
Stricter rollout after the baseline is cleanโ
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.strict];
Choosing a presetโ
recommended: best default starting pointstrict: adds stricter env and workspace guidanceconfigs: focused only on config filesclient: focused onimport.meta.envandimport.meta.globvitest: focused on Vitest config and workspacesvitest-bench: focused on benchmark file hygiene
Next stepsโ
- Read the overview.
- Review the preset selection strategy.
- Open the individual rule docs for the parts of Vite or Vitest your repository uses most.