-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Similar to #58546
BAD:
bool foo = false;
// ...
if (foo = true) {}
else if (foo = false) {}
while (foo = true) {} // or false
do {} while (foo = true); // or falseGOOD:
bool foo = false;
// ...
if (foo == true) {}
while (foo == true) {}
do {} while (foo == true);These lints should apply if the literal true or false is used. I'm not sure if they should apply when a const expression that evaluates to true or false is used. I think they should not apply if some non-const expression is used, e.g. while (keepGoing = checkIfIShouldKeepGoing()) would not trigger the lint.
jcviau and Spiritus2424
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug