-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Respect //@ts-nocheck in TS files #33383
Conversation
3227b33
to
30ed2fb
Compare
} | ||
|
||
|
||
//// [DtsFileErrors] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just decided to have declaration emit on to capture the true "garbage in, garbage out" aspect of error suppression. Again, this was already doable with multiple individual //@ts-ignore
s so....
30ed2fb
to
a6f3eb7
Compare
a6f3eb7
to
1c3ee9c
Compare
Interesting, I guess this is another angle for of a migration path to TS 👍 |
@@ -1691,9 +1691,10 @@ namespace ts { | |||
Debug.assert(!!sourceFile.bindDiagnostics); | |||
|
|||
const isCheckJs = isCheckJsEnabledForFile(sourceFile, options); | |||
const isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question, currently unchecked files have also some fuzzy completions (currently only in js files since those are the only ones) but would we want that? I think no but I am just pointing out one of the checkJs
enabled and disabled difference.
Similarly there is disableJsDiagnostics code fix, do we need similar one now for ts?
Handle report reportImplicitAny
for early exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a //@ts-nocheck
in a TS file should do anything other than suppress errors - everything else should be as-is.
@typescript-bot pack this |
Hey @orta, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running |
Approved in today's design meeting ❤️ |
Fixes parts of #19573 kinda.
Seeing as we already support
//@ts-ignore
,//@ts-nocheck
is really just a file-scoped ignore, so there's nothing new here, really. It's also not really a big change.