Skip to content

[Feat] diagnosis warn not allow if has := (no-cond-assign)Β #83

@CoffeeChaton

Description

@CoffeeChaton

Feat Provide

πŸ”Ž Search keywords

diag

πŸ’» Exp Code

; warn
if (a := b){
}

; ok
a := b
if (a){
}

Additional context

https://eslint.org/docs/latest/rules/no-cond-assign

In conditional statements, it is very easy to mistype a comparison operator as an assignment operator.
There are valid reasons to use assignment operators in conditional statements.
However, it can be difficult to tell whether a specific assignment was intentional.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions