Good answers, but I had a situation where I only wanted to turn off TypeScript validation for some unported vanilla JavaScript that we're using in TypeScript land. Our use of eslint didn't catch nearly as many errors as the TypeScript validator, so to preserve the ability to validate "real" *.ts, it was important to only turn off TypeScript validation for specific files.
Easy enough, it turns out. From bobbyhadz.com:
Use the // @ts-nocheck
comment to disable type checking for an entire file in TypeScript.
...
// @ts-nocheck
console.log('no errors' / 0);
console.log('no errors' / 0);
And from the TypeScript docs (which shows ways to get even more granular):
You can skip checking some files by adding a // @ts-nocheck
comment to files.
TypeScript may offer you errors which you disagree with, in those cases you can ignore errors on specific lines by adding // @ts-ignore
or // @ts-expect-error
on the preceding line.
// @ts-check
/** @type {number} */
var x;
x = 0; // OK
// @ts-expect-error
x = false; // Not OK