quick-lint-js icon indicating copy to clipboard operation
quick-lint-js copied to clipboard

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

Open dubloom opened this issue 1 year ago • 4 comments

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.

dubloom avatar Aug 30 '24 13:08 dubloom

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).

github-actions[bot] avatar Aug 30 '24 13:08 github-actions[bot]

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

dubloom avatar Aug 30 '24 14:08 dubloom

recheck

dubloom avatar Aug 30 '24 14:08 dubloom

recheck

dubloom avatar Aug 30 '24 14:08 dubloom