Languages
[Edit]
EN

TypeScript - compile *.ts files without emitting result (without creating *.js files)

2 points
Created by:
AnnLen
9180

In this short article we would like to show how to compile TypeScript files without emitting *.js files.

The approach is useful when we want to check / validate corectness of *.ts files.

Quick solution (run in console):

tsc --noEmit

or

tsc --project path/to/tsconfig.json --noEmit

Example usage

tsc returned incorrect import path:

john@ubuntu-pc:~/Desktop/Projects/shop$ npx tsc --project ./tsconfig.json --noEmit
../commons/src/components/NavBar.tsx:1:24 - error TS2307: Cannot find module './BlueButton' or its corresponding type declarations.

Found 1 error.

 

Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join