A typed version of Javascript
Typescript
A typed version of Javascript
Disable type-checking on running
Temporarily
Set environment variable TS_NODE_TRANSPILE_ONLY=true
export TS_NODE_TRANSPILE_ONLY=true
Improves startup time (for example of ts-node or jasmine-ts) in exchange for not checking that the types are correct.
Might be useful when a watcher (like nodemon) is left to run typescript tests every time there's a change on a file, this can get the "compilation" time before the tests are run from >30seconds to close to 0.
See Manually trigger type check to manually trigger a type-check.
Per-file basis
On StackOverflow
In TypeScript 3.7, type checking will be disabled on a file if it starts with the following comment:
// @ts-nocheck
As already mentioned, in previous versions you can disable checking on a single line by including the following comment on the previous line:
// @ts-ignore
Manually trigger type check
Just call tsc
on your tsconfig.json
file. Use the --noEmit
flag to avoid generating JS code, which might take significant time.
Relevant environment variables
Open ts-node/src/index.ts and search for process.env.
TS_NODE_DEBUG
TS_NODE_DIR
TS_NODE_EMIT
TS_NODE_SCOPE
TS_NODE_FILES
TS_NODE_PRETTY
TS_NODE_COMPILER
TS_NODE_COMPILER_OPTIONS
TS_NODE_IGNORE
TS_NODE_PROJECT
TS_NODE_SKIP_PROJECT
TS_NODE_SKIP_IGNORE
TS_NODE_PREFER_TS_EXTS
TS_NODE_IGNORE_DIAGNOSTICS
TS_NODE_TRANSPILE_ONLY
TS_NODE_TYPE_CHECK
TS_NODE_COMPILER_HOST
TS_NODE_LOG_ERROR