Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compile the TypeScript project while ignoring all the errors?

Tags:

typescript

I'm building a prototype project, and it has a bunch of TypeScript errors. I want to try quickly compiling it while ignoring all the errors, and get around to fixing them at a later time.

I know about adding // @ts-ignore comment at the beginning of the file, but how can I do that for ALL the files? Is there some kind of flag I can add to tsc, or some linke I can add to tsconfig.json to make it ignore all the errors entirely and compile anyway?

like image 446
lumenwrites Avatar asked Jan 28 '26 04:01

lumenwrites


2 Answers

To be clear:

This does not Compile

tsconfig.json:

    "noEmit": true,
    "noEmitOnError": true,

This will not compile. It will create the outDir (/dist folder), but only containing the log with errors of the compile.

This does Compile

tsconfig.json:

    "noEmit": false,
    "noEmitOnError": false,
like image 163
BertC Avatar answered Jan 30 '26 21:01

BertC


Unless you have noEmit and/or noEmitOnError option set to true in tsconfig or as command line argument tsc will compile .js files regardless of typescript errors.

like image 31
aleksxor Avatar answered Jan 30 '26 21:01

aleksxor