Save complete complier output to txt or csv with "strict":true compiler option in typescript

31 Views Asked by At

I have the following code in tsconfig.json which is opened in visual studio. { "CompileOnSave":false, "CompilerOptions":{ "strict": true, "skipLibCheck":true }, "angularCompilerOptions":{ "fullTemplateTypeCheck":true, "strictInjectionParameters":true, "strictTemplates":true } }

  1. I would want the list of errors identified by the compiler to be saved in a .txt or .csv file.
  2. I need a list of errors identified across the workspace and not just for the files opened in the visual studio. Any inputs or suggestions?

I would need inputs/suggestions to try it out in the visual studio.

1

There are 1 best solutions below

1
Alex Wayne On

You won't get a full project-wide report like this in your editor, but you can run the typescript compiler yourself easily enough.

tsc --noEmit > tsc-result.txt

That command will find the tsconfig.json in your project and use that to know what files to check.

The --noEmit flag means that compiled javascript will not be created for you.

The > tsc-result.txt will create a file with the contents of any found type errors.