lint/complexity/prefer-simple-condition
In the code-quality and dead-code sets. Safe fix.
What it does
Simplify a negated comparison or a comparison with a boolean
Configuration
[lint.rules]
"complexity/prefer-simple-condition" = "error"
To skip it in some files or lines, add an override or an ignore comment.
Options
| Name | Type | Allowed values | Default | Upstream name |
|---|---|---|---|---|
checks |
list |
conditions, identical-true, not-identical |
["conditions", "identical-true", "not-identical"] |
None (Pun’s own) |
Replaces
BooleanNotIdenticalToNotIdentical(rector)SimplifyBoolIdenticalTrue(rector)SimplifyConditions(rector)
Merged rules
These old IDs are now this rule. A config that still names one stops with an error. See merged rules.
lint/complexity/no-negated-comparisonlint/complexity/no-boolean-literal-compare