-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Emit issue with member access dot operator and parentheses usually in conjunction with type assertion #15444
Comments
Unfortunately these are the JavaScript Automatic SemiColon Insertion rules. TypeScript is a super-set of JavaScript, and the samples above are valid JS code samples, and they have valid semantics. the emitted code has to match these semantics. |
thanks for your reply @mhegazy. i thought that it is a tricky case, as sometimes a multiline expression might be intended. i might create a tslint warning to detect it in conjunction with assertions. or might this be a case where |
I believe there's already a TSLint rule for missing semicolons |
do you mean this
the rule does not warn if a semicolon in conjunction with a type assertion might be required. it also fails in some other cases, and warns. for example:
|
Sorry, I totally misread that. Disregard. @mhegazy perhaps we should disallow |
@gdelmas you can use the |
👍 |
Filed #15506 to track it. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
…2655) Separate the implementations of "never" and "always", because "never" became a little more complex. [enhancement] `semicolon`: option `"never"` is now spec compliant [bugfix] `semicolon`: don't warn about unnecesary semicolon when it is actually needed, e.g. when followed by type assertion or template string Ref: microsoft/TypeScript#15444
Code
Expected emit:
Actual emit:
This becomes an issue when using type assertions inline:
Code
Expected emit:
Actual emit:
Angle brackets type assertion have a similar issue:
Code
Actual emit:
The text was updated successfully, but these errors were encountered: