Languages
[Edit]
EN

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

2 points
Created by:
AnnLen
11470

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
­čÜÇ
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé

Join