Ts-node: Enable --type-check option by default again

Created on 15 Dec 2017  路  4Comments  路  Source: TypeStrong/ts-node

Hi. After 4.0.0 version, i got many problems with --type-check option that disabled by default.
Now in all mocha tests (running with CLI or with WebStorm IDE Interface) i should add TS_NODE_TYPE_CHECK environment variable, because without that all tests are failing due to typescript compile errors.

It is possible to revert back this change or add more global way (through config file) to enable typeCheck option?

invalid needs more info

Most helpful comment

The things you ask for already exist, you just need to check the README. There's config options listed in https://github.com/TypeStrong/ts-node#configuration-options and there's also ts-node/register/type-check defined in https://github.com/TypeStrong/ts-node#programmatic. Feel free to open a PR if these docs are inadequate.

All 4 comments

You might want to see https://github.com/TypeStrong/ts-node/pull/412 - you should be able to use the register specified there.

It seems that type-check was disabled so that the default behavior may remain fast.

The things you ask for already exist, you just need to check the README. There's config options listed in https://github.com/TypeStrong/ts-node#configuration-options and there's also ts-node/register/type-check defined in https://github.com/TypeStrong/ts-node#programmatic. Feel free to open a PR if these docs are inadequate.

because without that all tests are failing due to typescript compile errors.

What does this mean? It's failing because of TypeScript compile errors when there's no type checking?

thank you. ts-node/register/type-check works.

Was this page helpful?
0 / 5 - 0 ratings