_From @arsnl on August 25, 2018 0:59_
Steps to Reproduce
// @ts-nocheck at the start of any TypeScript fileResult
VS Code display TS error

Expected
VS Code should not display TS error
Does this issue occur when all extensions are disabled?: Yes
Snippet to try
// @ts-nocheck
const test = (foo: string) => `${foo}-bar`;
test(1); // Should not display error
test('baz'); // Correct behavior with correct type
// @ts-ignore
test(1); // Correct behavior with @ts-ignore
_Copied from original issue: Microsoft/vscode#57187_
In the original design (#14496) the intent was for ts-check and ts-nocheck to only have meaning in JS files. The same was true with ts-ignore. We gave in to community demands for ts-ignore in TS code; so I suppose this now tracks the same for ts-nocheck.
any update ?
@hpmax00 if you read the comment just before yours, you can see this is intentional and is not a bug.
From experience (I’ve been there), you would need it for TS files only when something is not correctly configured in your editor or your project, so I advice you to double check your config :)
@martpie My situation is not as simply as you said just configuring the ide. You said it is intentional. Good job, your house your rules. Anyway thank you for reply.
@martpie I would find this most helpful especially in the transition to TypeScript or is there another elegant way to prevent files from being type checked?
@doberkofler without knowing much of your project, I’d say write JS files and enable TS’s allowJs compiler option.
But it defeats a little bit the purpose of TypeScript.
This is implemented in TypeScript 3.7 beta: https://devblogs.microsoft.com/typescript/announcing-typescript-3-7-beta/
my use case for this is having a single file that does some on the fly metaprogramming that strict type checking in TS is not really designed for. But just adding one .js file to your app is nasty. for example I have my IDE setup to ignore JS files, to output in a certain place etc. So enabling to use hacky JS syntax in a single file is a benefit.
Most helpful comment
In the original design (#14496) the intent was for
ts-checkandts-nocheckto only have meaning in JS files. The same was true withts-ignore. We gave in to community demands forts-ignorein TS code; so I suppose this now tracks the same forts-nocheck.