-
Notifications
You must be signed in to change notification settings - Fork 39
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
Entire switch
case missed if testing string literal
#47
Comments
I'm wrong, it's not skipping the body of the case statement. It seems like this test in no-literal-string.js might be ignoring "normal" assignment: // var a: 'abc' = 'abc'
if (typeObj.isStringLiteral()) {
return;
} With that statement this second assignment is allowed, IMO it shouldn't be: let title: string = i18next.t('common:test')
title = "omg lol" I'm afraid I don't understand typescript well enough yet to know which is wrong or what the right fix is :( |
@nator it's weird. I will check on it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this is caused by the fix for #2 , where switch cases statements with a literal test cause the entire block to be skipped. I have code like this that I'd like to fail the linter, but I don't quite see how to fix it and still keep #2 intact.
e.g. this title assignment shouldn't be allowed:
Thanks!
The text was updated successfully, but these errors were encountered: