quick-lint / quick-lint-js

quick-lint-js finds bugs in JavaScript programs
https://quick-lint-js.com
GNU General Public License v3.0
1.52k stars 192 forks source link

12$: warn on 'x == y;' statement #1132

Open strager opened 8 months ago

strager commented 8 months ago

The following C++ code has a bug:

  for (Used_Variable &used_var : current_scope.variables_used) {
    if (used_var.kind == Used_Variable_Kind::use) {
      used_var.kind == Used_Variable_Kind::use_in_type;
    }
  }

JavaScript code might have a similar bug. For example:

let x;
x == 42;

quick-lint-js should warn about such redundant == (or ===) and suggest = instead.

CoderMuffin commented 4 months ago

Hi @strager, I would love to tackle this issue if that's ok :)

strager commented 4 months ago

@CoderMuffin Yeah, you can work on this issue.