ESLint plugin that exposes all Vitest globals (describe, it, expect, vi, etc.) to ESLint without requiring an explicit eslint-plugin-vitest dependency. Current stable version is 1.6.1, released with support for ESLint 9+ Flat Config (flat/recommended, flat/base), TypeScript type definitions, and expanded globals including bench, benchmark, xtest, xit, xdescribe. Released as-needed with several minor bumps in 2023. Differentiators: lightweight (only handles globals), supports both classic and flat ESLint configs, and can be applied only to test files via overrides. Compatible with Node >=16.
npm install eslint-plugin-vitest-globalsVerified import paths — ran on the pinned version, not inferred.
Configures ESLint to recognize Vitest globals only in test files, using either classic or flat config.
Upgrade to v1.6.0+ and use vitestGlobals.configs['flat/recommended'].
Install eslint-plugin-vitest separately if you need Vitest-specific lint rules beyond globals.
Prefer extending the recommended config or using the flat config approach.
Always use overrides or files filters to restrict the plugin to test file patterns.
Upgrade Node.js to >=16 or pin to an older version of the plugin (not recommended).
Add the plugin to ESLint config (recommended or environment) as shown in quickstart.
Run 'npm install -D eslint-plugin-vitest-globals' and ensure it's in package.json.
Use eslint-plugin-vitest for rules; this plugin only provides globals.
Use dynamic import or ensure your eslint.config.js uses ESM syntax with 'import vitestGlobals from 'eslint-plugin-vitest-globals';'