Skip to content

Rule suggestion: no negated condition in if-else #24249

@adamsol

Description

@adamsol

Summary

See this ESLint rule for a detailed description.

There's already something similar in Ruff: https://docs.astral.sh/ruff/rules/if-expr-with-twisted-arms/, but much more narrow in scope - works only for b if not a else a, not for b if not a else c and not for if statements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-decisionAwaiting a decision from a maintainerruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions