@putout/plugin-convert-index-of-to-includes
🐊Putout plugin adds ability to convert indexOf to includes
Last updated 10 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm 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 (10 months ago)

7 Versions

  • 3.0.0                                ...           10 months ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 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
Total 2
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE