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 positives with RSVP.Promise.reject() in no-array-prototype-extensions rule #1546

Merged

Conversation

bmish
Copy link
Member

@bmish bmish commented Jul 29, 2022

Fixes #1537 (some related scenarios).

@bmish bmish added the bug label Jul 29, 2022
@bmish bmish marked this pull request as ready for review July 29, 2022 16:36
@bmish bmish force-pushed the no-array-prototype-extensions-rsvp-reject branch from ee19d35 to 02ee0b7 Compare July 29, 2022 16:38
@bmish bmish requested a review from lin-ll July 29, 2022 18:55
@bmish bmish force-pushed the no-array-prototype-extensions-rsvp-reject branch from 02ee0b7 to 1a8806c Compare July 29, 2022 18:57
@lin-ll lin-ll merged commit 7d9fa8e into ember-cli:master Jul 29, 2022
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
3 participants