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

Fix false positive with RSVP.reject() in no-array-prototype-extensions #1539

Merged

Conversation

gilest
Copy link
Contributor

@gilest gilest commented Jul 23, 2022

(partially) fixes #1537.

@bmish bmish added the Bug label Jul 23, 2022
@bmish bmish changed the title Ignore RSVP.reject to reduce false positives in no-array-prototype-extensions Fix false positive with RSVP.reject() in no-array-prototype-extensions Jul 23, 2022
Copy link
Member

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@bmish bmish merged commit d4d12c6 into ember-cli:master Jul 23, 2022
@gilest gilest deleted the fix/no-array-prototype-extensions-ignore-rsvp branch July 23, 2022 07:30
ef4 added a commit that referenced this pull request Aug 10, 2022
The `no-array-prototype-extensions` rule is trying to do an impossible thing. It's going to produce a never-ending stream of false positives. You cannot statically tell which calls are actually relying on the array prototype extensions.

A correct implementation is probably possible, but only in typescript (where eslint rules can take advantage of type information), not in javascript.

I'm all in favor of pushing people away from using array prototype extensions, but that is going to require runtime implementation. It cannot be checked statically. A rule that is so often wrong will just encourage people not to trust it anyway. I don't think it should be in the recommended set.

Examples:

#1561
#1552
#1547
#1546
#1544
#1543
#1538
#1539
#1536
bmish added a commit that referenced this pull request Aug 18, 2022
…#1562)

* Remove no-array-prototype-extensions from recommended

The `no-array-prototype-extensions` rule is trying to do an impossible thing. It's going to produce a never-ending stream of false positives. You cannot statically tell which calls are actually relying on the array prototype extensions.

A correct implementation is probably possible, but only in typescript (where eslint rules can take advantage of type information), not in javascript.

I'm all in favor of pushing people away from using array prototype extensions, but that is going to require runtime implementation. It cannot be checked statically. A rule that is so often wrong will just encourage people not to trust it anyway. I don't think it should be in the recommended set.

Examples:

#1561
#1552
#1547
#1546
#1544
#1543
#1538
#1539
#1536

* docs: mentioned recommend rule removal in changelog

* docs: explain why no-array-prototype-extensions is not in recommended config

Co-authored-by: Bryan Mishkin <698306+bmish@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional false positives with no-array-prototype-extensions rule
2 participants