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

Viewed 1594

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?

2 Answers

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.

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,
Related