-
Notifications
You must be signed in to change notification settings - Fork 12.8k
TSX @ts-ignore comments no longer suppressing errors in TypeScript 3.9 #37738
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
Comments
I was trying to help beta test TypeScript 3.9 and we have some |
line comments still work: <Comp
// @ts-ignore
badProp={1}
/>
<Comp
// @ts-expect-error
badProp={1}
/> |
Definitely true, though is it always possible to express I suppose this is also an option if the error is on the component
Though that breaks syntax highlighting in vscode and prettier goes out of whack. My guess is that this was an unintentional breakage. |
Indeed, this was an unintentional breakage. Specifically the breakage was here: https://github.com/microsoft/TypeScript/pull/36014/files#diff-08a3cc4f1f9a51dbb468c2810f5229d3L1782 TypeScript used to check if a line looked like TypeScript now understands where single-line ..but I'll defer to the Typescript team. Happy to send a PR if that or another strategy is approved! |
No worries, at all! Glad we could help catch this. We're so thankful for all the great work going into the TS 3.9 release!! 😃 Ya, the format is not ideal. But, that's the best that we came up with here #27552 Looks like there has been some follow-up requests about a cleaner syntax for this #31147
Though I'm not sure how much scope it would add to accept that format vs fixing up the good 'ol
|
My intuition tells me that if |
Swell. Just to be clear @DanielRosenwasser, is your intuition strong enough for TypeScript to accept a PR making that behavior change? |
Ping, sorry to re-tag you @DanielRosenwasser - since TS 3.9 is close to release, is there a way this could get triaged? I would very much like to fix this regression before the major release. 🤗 |
I'm so sorry this didn't get triaged and fell off my radar. If you can get a PR out, we can work on through it. Ideally this would go in before the RC, but I don't think we'll have time for that. |
Swell, thanks! 🚀 #38228 minimally adds directive parsing for multiline comments. |
Thanks to everyone involved on this thread for your patience, and thanks @JoshuaKGoldberg for the quick fix! |
TypeScript Version: 3.9.0-beta and 3.9.0-dev.20200330
Search Terms:
ts-ignore 3.9 tsx @ts-ignore
Code
Expected behavior:
Error suppressed when running tsc (TS 3.8 behavior)
Actual behavior:
Error emitted when running tsc
Repro Repo Link:
https://github.com/brieb/ts-39-issue-ts-ignore-tsx
The text was updated successfully, but these errors were encountered: