EN
TypeScript - compile *.ts files without emitting result (without creating *.js files)
26
points
In this short article, we would like to show how to compile TypeScript files without emitting *.js files.
The below approach is useful when we want to check/validate the correctness of *.ts files.
Quick solution (run in console):
tsc --noEmit
or
tsc --project path/to/tsconfig.json --noEmit
Example usage
In this section, we want to show example when tsc
returned incorrect import
path message.
john@ubuntu-pc:~/Desktop/Projects/shop$ npx tsc --project ./tsconfig.json --noEmit
Example output:
../commons/src/components/NavBar.tsx:1:24 - error TS2307: Cannot find module './BlueButton' or its corresponding type declarations.
Found 1 error.