eslint-plugin-if-in-test
v0.2.0
Published
find "if" statement in test code. "if" is usually not necessary in test, and it is typo of "it".
Downloads
150
Maintainers
Readme
eslint-plugin-if-in-test
Find if
statement in test code. if
is usually typo of mocha's it
.
- https://github.com/shokai/eslint-plugin-if-in-test
- https://npmjs.com/package/eslint-plugin-if-in-test
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"}]
- warnif
statement intest/
directory.
- find