no-equal-nested-conditions
preset: recommended
Warns when an if statement contains another if statement with the same condition.
Example
❌ Bad:
if (value == 1) {
// LINT
if (value == 1) {
...
}
}
if (value == 1) {
...
// LINT
if (value == 1) {
...
}
}
✅ Good:
if (value != 1) {
if (value == 1) {
...
}
}
if (value != 1) {
...
if (value == 1) {
...
}
}