find if
statement in test code. if
is usually not necessary in test, and it is typo of it
.
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.
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"}]
}
}
- if
- find
if
statement [1, {"directory": "test"}]
- warnif
statement intest/
directory.
- find