@vitest/eslint-plugin weekly downloads statistics
By vitest (2 listings) · npm · ESLint plugins
ESLint plugin for Vitest
@vitest/eslint-plugin has 6,606,566 recorded weekly downloads on npm, an increase of 21.9% over the past 30 days, ranking #155 of 3,247 tracked listings.
About @vitest/eslint-plugin
eslint-plugin-vitest
ESLint plugin for Vitest
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install @vitest/eslint-plugin
npm install @vitest/eslint-plugin --save-dev
Usage
Make sure you're running ESLint v9.0.0 or higher for the latest version of this plugin to work. The following example is how your eslint.config.js should be setup for this plugin to work for you.
import { defineConfig } from 'eslint/config'
import vitest from '@vitest/eslint-plugin'
export default defineConfig({
files: ['tests/**'], // or any other pattern
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules, // you can also use vitest.configs.all.rules to enable all rules
'vitest/max-nested-describe': ['error', { max: 3 }], // you can also modify rules' behavior using option like this
},
})
If you're not using the latest version of ESLint (version v8.57.0 or lower) you can setup this plugin using the following configuration
Add vitest to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": ["@vitest"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@vitest/max-nested-describe": [
"error",
{
"max": 3
}
]
}
}
If you're using old ESLint configuration, make sure to use legacy key like the following
{
"extends": ["plugin:@vitest/legacy-recommended"] // or legacy-all
}
Enabling with Type-Testing
Vitest ships with an optional type-testing feature, which is disabled by default.
If you're using this feature, you should also enabled typecheck in the settings for this plugin. This ensures that rules like expect-expect account for type-related assertions in tests.
import { defineConfig } from 'eslint/config'
import tseslint from 'typescript-eslint'
import vitest from '@vitest/eslint-plugin'
export default defineConfig(
// see https://typescript-eslint.io
tseslint.configs.recommended,
{
languageOptions: {
parserOptions: {
projectService: true,
},
},
},
{
files: ['tests/**'], // or any other pattern
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
},
settings: {
vitest: {
typecheck: true,
},
},
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
},
},
)
Custom Fixtures
If you're using custom fixtures in a separate file and importing them in your tests, you can let the plugin know about them by adding them to the vitestImports setting. The property accepts an array of strings or regular expressions that match the module names where your custom fixtures are defined.
import { defineConfig } from 'eslint/config'
import vitest from '@vitest/eslint-plugin'
export default defineConfig({
files: ['tests/**'], // or any other pattern
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
},
settings: {
vitest: {
vitestImports: ['@/tests/fixtures', /test-extend$/],
},
},
})
Shareable Configurations
Recommended
This plugin exports a recommended configuration that enforces good testing practices.
To enable this configuration with eslint.config.js, use vitest.configs.recommended:
import { defineConfig } from 'eslint/config'
import vitest from '@vitest/eslint-plugin'
export default defineConfig({
files: ['tests/**'], // or any other pattern
...vitest.configs.recommended,
})
All
If you want to enable all rules instead of only some you can do so by adding the all configuration to your eslint.config.js config file:
import { defineConfig } from 'eslint/config'
import vitest from '@vitest/eslint-plugin'
export default defineConfig({
files: ['tests/**'], // or any other pattern
...vitest.configs.all,
})
Rules
<!-- begin auto-generated rules list -->💼 Configurations enabled in.
⚠️ Configurations set to warn in.
🚫 Configurations disabled in.
🌐 Set in the all configuration.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.
💡 Manually fixable by editor suggestions.
💭 Requires type information.
❌ Deprecated.…
Description from the npm listing.
- eslint
- eslintplugin
- eslint-plugin
- eslint plugin
- vitest
- vitest eslint plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm ESLint plugins plugins
All 20 @vitest/eslint-plugin alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@vitest/eslint-plugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.