eslint-plugin-vitest
Eslint plugin for vitest
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-vitest
:
npm install eslint-plugin-vitest --save-dev
Usage
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
}
]
}
}
Recommended
To use the recommended configuration, extend it in your .eslintrc
file:
{
"extends": ["plugin:vitest/recommended"]
}
All recommend rules will be set to error by default. You can however disable some rules by setting turning them off
in your .eslintrc
file or by setting them to warn
in your .eslintrc
.
all
To use the all configuration, extend it in your .eslintrc
file:
{
"extends": ["plugin:vitest/all"]
}
Rules
💼 Configurations enabled in.
⚠️ Configurations set to warn in.
🌐 Set in the all
configuration.
✅ Set in the recommended
configuration.
🔧 Automatically fixable by the --fix
CLI option.
💡 Manually fixable by editor suggestions.
Credits
- eslint-plugin-jest
Most of the rules in this plugin are essentially ports of Jest plugin rules with minor modifications
Licence
MIT Licence © 2022 - present veritem