-
-
Notifications
You must be signed in to change notification settings - Fork 420
no-array-reduce - enable reporting of optional chaining and calling of .reduce()
#2721
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
Changes from 4 commits
c0eb380
f251dc0
99b8ac7
4439bc4
1d444f2
8240f4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -12,6 +12,8 @@ test({ | |||
| 'a[b.reduce]()', | ||||
| 'a(b.reduce)', | ||||
| 'a.reduce()', | ||||
| 'a?.reduce()', | ||||
| 'a.reduce?.()', | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't make sense to allow optional call.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added it because I saw it in
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are valid cases in these two rules, and they both use
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I comment this in a misleading place, I mean L112
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand, sorry :(
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because it's doesn't make sense to check Explained in this commit |
||||
| 'a.reduce(1, 2, 3)', | ||||
| 'a.reduce(b, c, d)', | ||||
| '[][reduce].call()', | ||||
|
|
@@ -106,6 +108,8 @@ test({ | |||
| ].flatMap(testCase => [testCase, testCase.replace('reduce', 'reduceRight')]), | ||||
| invalid: [ | ||||
| 'array.reduce((str, item) => str += item, "")', | ||||
| 'array?.reduce((str, item) => str += item, "")', | ||||
| 'array.reduce?.((str, item) => str += item, "")', | ||||
| outdent` | ||||
| array.reduce((obj, item) => { | ||||
| obj[item] = null; | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.