Skip to content

Commit

Permalink
fix: more false positives with RSVP.Promise.reject() in no-array-prot…
Browse files Browse the repository at this point in the history
…otype-extensions
  • Loading branch information
bmish committed Jul 29, 2022
1 parent fd83412 commit ee19d35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rules/no-array-prototype-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ const KNOWN_NON_ARRAY_FUNCTION_CALLS = new Set([

// RSVP.reject
'RSVP.reject',
'RSVP.Promise.reject',
'Ember.RSVP.reject',
'Ember.RSVP.Promise.reject',

// *storage.clear()
'window.localStorage.clear',
Expand Down
3 changes: 3 additions & 0 deletions tests/lib/rules/no-array-prototype-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ ruleTester.run('no-array-prototype-extensions', rule, {
// Global non-array class (RSVP.reject)
'RSVP.reject();',
'RSVP.reject("some reason");',
'RSVP.Promise.reject();',
'Ember.RSVP.reject();',
'Ember.RSVP.Promise.reject();',

// Global non-array class (*storage.clear)
'window.localStorage.clear();',
Expand Down

0 comments on commit ee19d35

Please sign in to comment.