@putout/plugin-convert-index-of-to-includes
v2.0.1
Published
šPutout plugin adds ability to convert indexOf to includes
Maintainers
Readme
@putout/plugin-convert-index-of-to-includes 
The
includes()method determines whether an array includes a certain value among its entries, returningtrueorfalseas appropriate.(c)MDN
šPutout plugin adds ability to convert indexOf to includes.
Install
npm i @putout/plugin-convert-index-of-to-includes -DRule
{
"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
