Skip to content

tools,lib: enable strict equality lint rule

Rodrigo Muino Tomonari requested to merge github/fork/Trott/eqeqeq-smart into master

Enablie a lint rule to require === and !== instead of == and != except in some well-defined cases:

  • comparing against null as a shorthand for also checking for undefined
  • comparing the result of typeof
  • comparing literal values

In cases where == or != are being used as optimizations, use an ESLint comment to disable the eqeqeq rule for that line explicitly. I rather like this because it's a signal that the usage is intentional and not a mistake.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

tools lib

Merge request reports

Loading