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.54k stars 192 forks source link

feat(fe): add a warning when comparing typeof to invalid string literals #1228

Open dubloom opened 1 month ago

dubloom commented 1 month ago

fixes #1213

Add a new diagnostic E0721 that warns on comparisons between typeof operator and a string literal which is not one of the existing possibilites listed here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof

Only one test case, which throw a warning, has been added.

github-actions[bot] commented 1 month ago

CLA Assistant Lite bot Thank you for your contribution! Like many free software projects, you must sign our Contributor License Agreement before we can accept your contribution.

EDIT: All contributors have signed quick-lint-js' Contributor License Agreement (CLA-v1.md).

dubloom commented 1 month ago

I have read and hereby agree to quick-lint-js' Contributor License Agreement (CLA-v1.md).

dubloom commented 1 month ago

recheck

dubloom commented 1 month ago

recheck