eslint-plugin-if-in-test

0.2.0 • Public • Published

eslint-plugin-if-in-test

Find if statement in test code. if is usually typo of mocha's it.

screen shot screen shot

Circle CI

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-if-in-test:

$ npm install eslint-plugin-if-in-test --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-if-in-test globally.

Usage

Add if-in-test to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "if-in-test"
    ]
}

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

{
    "rules": {
        "if-in-test/if": [1, { "directory": "test" }]
    }
}

Also you can set multiple directories.

{
    "rules": {
        "if-in-test/if": [1, { "directory": ["test", "packages/*/test"] }]
    }
}

Supported Rules

  • if
    • find if statement
    • [1, {"directory": "test"}] - warn if statement in test/ directory.

Package Sidebar

Install

npm i eslint-plugin-if-in-test

Weekly Downloads

42

Version

0.2.0

License

MIT

Last publish

Collaborators

  • shokai