Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dubloom
Copy link

@dubloom dubloom commented Aug 30, 2024

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.

Copy link

github-actions bot commented Aug 30, 2024

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
Copy link
Author

dubloom commented Aug 30, 2024

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

@dubloom

This comment was marked as resolved.

1 similar comment
@dubloom

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

12$: diagnostic: typeof operator should warn when comparing to invalid string literals
1 participant