Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language rules for String.prototype.includes and Array.prototype.includes are identical #140

Open
edg2s opened this issue Dec 14, 2018 · 0 comments

Comments

@edg2s
Copy link
Member

edg2s commented Dec 14, 2018

The former is ES6, and the latter is ES2016. This rule works ok in ES5 environments., but if you are using ES6 you will get a warning for [].includes every time you use ''.includes.

We could rewrite the rule to only fire when the object is a literal string or array but that won't catch many uses in the wild where the object is likely to be a variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants