Skip to content

[linter] New lint to suggest avoid bool == true and bool == false #60614

Open
@FMorschel

Description

@FMorschel

We have use_if_null_to_convert_nulls_to_bools to trigger the first case, but no diagnostic in the other two cases:

void foo(bool? nullable, bool boolean) {
  if (nullable == true) {}
  if (boolean == true) {}
  if (boolean == false) {}
}

CC @srawlins @bwilkerson

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions