eslint-plugin-indexof

0.1.1 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    10
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    10
  • 0.1.0
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i eslint-plugin-indexof

Weekly Downloads

10

Version

0.1.1

License

ISC

Last publish

Collaborators

  • captbaritone