Push down negation
Push the not-operator (!
) into an expression and negate it.

Why is this refactoring helpful?
Push negation into an expression can simplify code, either directly or by enabling the removal of double negation.
What do I need to consider?
When the operator is <
, <=
, >
or >=
the result for NaN
and nullish values can change.
Configuration
- Code Assist ID (for the configuration file):
push-down-negation
- You can configure custom keyboard shortcuts with this code action kind:
refactor.p42.push-down-negation
- This code assist provides refactoring suggestions. Learn how to configure the refactoring suggestion visibility.