Skip to content

shokai/eslint-plugin-if-in-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-if-in-test

find if statement in test code. if is usually not necessary in test, and it is typo of it.

screen shot

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"}]
    }
}

Supported Rules

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

About

find "if" statement in test code

Resources

Stars

Watchers

Forks

Packages

No packages published