ESLint configuration package that defines globals for Vitest test files, eliminating false no-undef errors for Vitest globals like vi, describe, it, expect, beforeEach, etc. Version 2.0.2 is current, with support for both ESLint v9 flat config and ESLint v8 traditional config. Ships TypeScript types. Differentiators: tiny focused package, no extra rules, just globals; explicit flat config path import for ESLint v9; actively maintained with recent updates.
npm install eslint-config-vitest-globalsVerified import paths — ran on the pinned version, not inferred.
Shows how to set up eslint-config-vitest-globals with ESLint v9 flat config, calling vitestGlobals() to register Vitest globals.
Update import path from 'eslint-config-vitest-globals' to 'eslint-config-vitest-globals/flat' for flat config usage.
Use vitestGlobals() instead of vitestGlobals.
Migrate to ESLint v9 flat config using 'eslint-config-vitest-globals/flat'.
Ensure 'no-undef' is enabled in your ESLint config. The globals set by this package will be recognized.
Update package to v2.0.0+ and ensure import path is 'eslint-config-vitest-globals/flat'.
Use vitestGlobals() in your config array.
Change file extension to .mjs or set "type": "module" in package.json, or use require() if available.