New rule: No promise inside if condition #11525
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
feature
This change adds a new feature to ESLint
rule
Relates to ESLint's core rules
Please describe what the rule should do:
The rule should warn about putting promise in a if condition because it always resolve to true.
In most of the cases, we want to use the result of the promise instead.
What category of rule is this? (place an "X" next to just one item)
[X] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Enforces code style (layout)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
Why should this rule be included in ESLint (instead of a plugin)?
This is a common mistake instead of code style. I think it should be included in ESLint to avoid this mistake.
Are you willing to submit a pull request to implement this rule?
No, I have do not any experience with ESLint code base.
The text was updated successfully, but these errors were encountered: