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

False positives with no-array-prototype-extensions rule #1534

Closed
bmish opened this issue Jul 20, 2022 · 0 comments · Fixed by #1536
Closed

False positives with no-array-prototype-extensions rule #1534

bmish opened this issue Jul 20, 2022 · 0 comments · Fixed by #1536
Labels

Comments

@bmish
Copy link
Member

bmish commented Jul 20, 2022

no-array-prototype-extensions

False positives with these common non-array classes:

  • window.localStorage.clear();
  • Promise.reject();
  • Promise.reject('foo');

Please comment on this issue with any other examples you notice.

Potential mitigations:

  • We could assume capitalized variables like Promise are not arrays as they are more-likely to be classes based on naming convention
  • We could ignore known globals like window / known variables like window.localStorage

CC: @smilland

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant