Détail du package

@funboxteam/eslint-plugin-no-only-tests

funbox3.1kMIT5.0.0

Disallow the use of describe.only() and it.only()

eslint, eslintplugin, eslint-plugin

readme

@funboxteam/eslint-plugin-no-only-tests

npm

Disallow the use of describe.only() and it.only().

По-русски

Rationale

When developers fix tests they may make the process easier by filtering tests using method only on it & describe.

However, such filters should not be in the repo when the project is running on CI. So, we add this rule to our ESLint config to check the existence of only in the tests files. And we run linter using precommit-hook, which make it possible to prevent committing when only does exist in the code.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install the plugin:

$ npm install @funboxteam/eslint-plugin-no-only-tests --save-dev

Usage

Add @funboxteam/eslint-plugin-no-only-tests to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": [
    "@funboxteam/no-only-tests"
  ]
}

Then configure the rule under the rules section.

{
  "rules": {
    "@funboxteam/no-only-tests/no-only": 2
  }
}

Sponsored by FunBox

changelog

Changelog

5.0.0 (19.05.2023)

Dropped Node.js 12 support.

Added Node.js 16 & 18 support.

Read more in the migration guide.

4.0.1 (10.06.2021)

Fixed several security vulnerabilities:

4.0.0 (23.06.2020)

  • Update ESLint to 5.16.0.
  • Refactoring.
  • Change license to MIT.
  • Publish the package to Github & public npm.

3.1.2 (01.03.2019)

  • Fix typos in README & CHANGELOG.

3.1.1 (01.03.2019)

  • Fix false-negative check for describe (describe.skip, etc).

3.1.0 (03.10.2018)

  • Update examples in README.
  • Add Russian version of README.

3.0.0 (28.09.2018)

  • Rename the package to @funboxteam/eslint-plugin-no-only-tests.

2.0.1 (31.08.2018)

  • Add @funboxteam to README.

2.0.0 (06.07.2018)

  • Add .editorconfig, .gitignore & package-lock.json.
  • Move the package into @funboxteam scope.

1.0.0 (10.01.2017)

  • Add first implementation of the rule no-only.