0.1.1 • Published 10 years ago
eslint-plugin-indexof
Licence
ISC
Version
0.1.1
Deps
1
Vulns
0
Weekly
0
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.