-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
New rule: no partial array reduce #527
Comments
Here is one that you are welcome to take: https://github.com/danielnixon/eslint-plugin-total-functions/blob/master/src/rules/no-partial-array-reduce.ts It has 100% test coverage against these examples: https://github.com/danielnixon/eslint-plugin-total-functions/blob/master/src/rules/no-partial-array-reduce.test.ts |
I'm really unsure about whether to add this or not. @jonaskello Do you have any opinion on this? |
That's fair enough, you won't offend me if that's the outcome. I had a inkling it might be appropriate over here thanks to the combination of already being anti-exceptions ( |
I'm going to close this as there hasn't been any feedback on it. |
Suggestion
A new rule that forbids the partial versions of
reduce
andreduceRight
.Given:
Would be invalid according to suggested rule:
Would be valid according to suggested rule:
This is equivalent to the situation with reduce versus fold in Scala: https://www.wartremover.org/doc/warts.html#iterableops
The text was updated successfully, but these errors were encountered: