eslint-plugin-vite
July 3, 2026 ยท View on GitHub
ESLint rules for Vite, Vitest, and Vitest bench configuration and runtime patterns.
Why this plugin exists
Vite and Vitest both rely on static conventions that are easy to violate accidentally:
- config helpers such as
defineConfig(...)anddefineWorkspace(...) - client-safe env access through
import.meta.env - static glob imports through
import.meta.glob(...) - workspace and benchmark structure in Vitest
eslint-plugin-vite turns those conventions into reviewable lint rules.
Installation
npm install --save-dev @typpi/eslint-plugin-vite eslint
Quick start
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.recommended];
Available presets
vite.configs.recommendedvite.configs.strictvite.configs.allvite.configs.configsvite.configs.clientvite.configs.vitestvite.configs["vitest-bench"]
Common compositions
App code that uses import.meta.env and import.meta.glob
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.recommended, vite.configs.client];
Vitest workspaces in a monorepo
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.recommended, vite.configs.vitest];
Dedicated benchmark suites
import vite from "@typpi/eslint-plugin-vite";
export default [vite.configs.recommended, vite.configs["vitest-bench"]];
Documentation
Rules
Fixlegend:๐ง= autofixable๐ก= suggestions availableโ= report only
Preset keylegend:
Scope notes
- This plugin is flat-config-first.
- Current rules do not require type-aware ESLint setup.
- The focus is Vite and Vitest behavior, not framework-specific UI rules.
License
MIT