Is it possible to disable type checking when using TypeScript? I love TypeScript for classes, interface etc yet for the smaller one person projects I am normally engaged in I really don't need type checking and the pain of not finding ready made type definitions for less common libraries or the latest version of it is a pain. Thanks
Use // @ts-ignore to ignore the type checking errors on the next line in a TypeScript file. If you use a linter, you might have to add a comment to also suppress linting errors when using ts-ignore - // eslint-disable-next-line @typescript-eslint/ban-ts-comment .
Code written in TypeScript is checked for errors before it is executed, during compile time.
Use the // @ts-nocheck comment to disable type checking for an entire file in TypeScript. The // @ts-nocheck comment instructs TypeScript to skip the file when type checking. If you use a linter, you might need to disable it on the line of the comment. Copied!
You could go to Tools > Options > Text Editor > JavaScript/TypeScript > Project and uncheck the Project Analysis options.
In TypeScript 3.7, type checking will be disabled on a file if it starts with the following comment:
// @ts-nocheck
As already mentioned, in previous versions you can disable checking on a single line by including the following comment on the previous line:
// @ts-ignore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With