https://github.com/captbaritone/eslint-plugin-indexof
https://github.com/captbaritone/eslint-plugin-indexof
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/captbaritone/eslint-plugin-indexof
- Owner: captbaritone
- Created: 2016-01-11T23:42:28.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-01T19:48:05.000Z (over 8 years ago)
- Last Synced: 2025-02-15T09:17:22.189Z (11 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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](http://eslint.org):
```
$ 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:
```json
{
"plugins": [
"indexof"
]
}
```
Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"indexof/rule-name": [2, {exceptOn: ['_']}]
}
}
```
## Supported Rules
* [no-indexof](docs/rules/no-indexof.md) Disallow using the `indexOf()` method.