Getting started

July 3, 2026 ยท View on GitHub

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 point
  • strict: adds stricter env and workspace guidance
  • configs: focused only on config files
  • client: focused on import.meta.env and import.meta.glob
  • vitest: focused on Vitest config and workspaces
  • vitest-bench: focused on benchmark file hygiene

Next steps

Further reading