galk.in galk.in - 1 month ago 9
TypeScript Question

How to run TypeScript for validation without generating js files?

I'm using TypeScript v2.0 and

ts-node
. I don't need js files, but I want use typescript for validation in my tests. So how can I run TypeScript for validation, without generating js files?

Answer

You can use the --noEmit flag.

tsc file.ts --noEmit

For validation purposes however, you may consider using a TypeScript linter instead (such as TSLint).

Comments