JSPM

  • Created
  • Published
  • Downloads 595116
  • Score
    100M100P100Q179033F
  • License MIT

Eslint plugin for vitest

Package Exports

  • eslint-plugin-vitest

Readme

eslint-plugin-vitest

npm ci

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"],
  "rules": {
    "vitest/max-nested-describe": [
      "error",
      {
        "max": 3
      }
    ]
  }
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "vitest/no-skipped-tests": 2
  }
}

List of supported rules

Name Description
lower-case-title Enforce lowercase test names
max-nested-describe Enforces a maximum depth to nested describe calls
no-focused-tests Disallow focused tests
no-identical-title Disallow identical titles
no-skipped-tests Disallow skipped tests
no-conditional-tests Disallow conditional tests
expect-expect Enforce assertion to be with expect

Credits

Licence

MIT Licence © 2022 - present veritem