@putout/plugin-convert-index-of-to-includes
🐊Putout plugin adds ability to convert indexOf to includes
Last updated 2 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-convert-index-of-to-includes 
SYNC missed versions from official npm registry.

@putout/plugin-convert-index-of-to-includes NPM version

The includes() method determines whether an array includes a certain value among its entries, returning true or false as appropriate.

(c)MDN

????Putout plugin adds ability to convert indexOf to includes.

Install

npm i @putout/plugin-convert-index-of-to-includes -D

Rule

{
    "rules": {
        "convert-index-of-to-includes": "on"
    }
}

❌ Example of incorrect code

if (~array.indexOf(element)) {}

✅ Example of correct code

if (array.includes(element)) {}

License

MIT

Current Tags

  • 3.0.0                                ...           latest (2 months ago)

7 Versions

  • 3.0.0                                ...           2 months ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |