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?
npm install -g ts-node makes ts-node your-script. ts a breeze. Since the release of deno, you can now execute deno run path/to/file. ts and it will run typescript files in a single command without compiling it to a separate JS file.
TypeScript is JavaScript with syntax for types. TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With