18

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?

1 Answer 1

29

You can use the --noEmit flag.

tsc file.ts --noEmit

For validation purposes, you may also consider adding a linter compatible with TypeScript (such as ESLint with TypeScript support).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.