eslint-plugin-indexof
v0.1.1
Published
Disallow using the method indexOf
Downloads
886
Maintainers
Readme
eslint-plugin-indexof
Disallow using the method indexOf.
Note: This plugin will likely cause many false positives. For example,
Backbone collections offer an indexOf
method, which will be have to be
manually ignored.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-indexof
:
$ npm install eslint-plugin-indexof --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-indexof
globally.
Usage
Add indexof
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"indexof"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"indexof/rule-name": [2, {exceptOn: ['_']}]
}
}
Supported Rules
- no-indexof Disallow using the
indexOf()
method.