jfmengels/elm-review-simplify
GitHub で見るDetect when numbers cancel each other out in expression
Open
#123 opened on 2023年8月15日
enhancementhelp wanted
Repository metrics
- Stars
- (22 stars)
- PR merge metrics
- (PR metrics pending)
説明
This would be a follow-up to the idea in #41 and the PR done in #122.
The rule currently reports the following:
n - n
--> 0
-n + n
--> 0
but it doesn't catch something like this
something + n + else - n -- notice the 2 n cancel each other out
--> something + else
This would be nice to have, and I think that this will catch more problems than n - n.
Just like n - n, this simplification should not be enabled when we the rule is configured with expectNaN.