I'm not sure whether this is an issue with VS Code or TypeScript.
How can I disable auto-analysis of .ts
and .tsx
files in a specific folder to stop receiving error and warning notifications?
The exclude
option in tsconfig.json doesn't seem to work.
For example, even if there are syntax errors or unused values, files located under the specified path should not display any warnings or errors.
I'm not sure whether this is an issue with VS Code or TypeScript.
How can I disable auto-analysis of .ts
and .tsx
files in a specific folder to stop receiving error and warning notifications?
The exclude
option in tsconfig.json doesn't seem to work.
For example, even if there are syntax errors or unused values, files located under the specified path should not display any warnings or errors.
Share Improve this question asked 2 days ago reaver loverreaver lover 6748 silver badges23 bronze badges1 Answer
Reset to default 0There are two solutions I know of:
Solution No. 1
Probably this is not what you are looking for but you can disable TypeScript validation for the entire workspace by adding the following to your .vscode/settings.json
:
{
"typescript.validate.enable": false
}
Solution No. 2
To ignore TypeScript checking for specific files, add the following comment at the top of each file you want to exclude:
// @ts-nocheck
If you want to ignore TypeScript checking on these files permanently, adding this comment to each file is straightforward. However, if you prefer to toggle TypeScript checking on and off, consider writing a script that automatically adds or removes the comment from any .{ts,tsx}
files within specified folders.
If you're interested, I can provide an example of how the script would look in TypeScript and Node.js.