Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two different command line bugs / usability could be improved #373

Closed
ORESoftware opened this issue Jun 30, 2017 · 3 comments
Closed

Two different command line bugs / usability could be improved #373

ORESoftware opened this issue Jun 30, 2017 · 3 comments

Comments

@ORESoftware
Copy link

  1. When I use it this way:
ts-node --ignoreWarnings "${TEST_PATH}"

EXIT_CODE=$?
echo "exit code => ${EXIT_CODE}"

then ts-node bizarrely will start interpreting the bash code below the ts-node line as input. It's really strange.

  1. Because the above wasn't working, when I use it this way
echo "$(cat "${SUMAN_CHILD_TEST_PATH}")" | ts-node --ignoreWarnings

then I get this output:

⨯ Unable to compile TypeScript
[eval].ts (10,17): Property 'times' does not exist on type 'Number'. (2339)
[eval].ts (12,19): Parameter 't' implicitly has an 'any' type. (7006).

Expectation:
I would expect both commands to work, and to execute the file with node even if there are compile errors. In the first case, I would not expect ts-node to interpret code below the line as input (I will try adding a semi-colon).

Hypthesis - it seems like the --ignoreWarnings flag is not working or I am using it incorrectly.

@ORESoftware
Copy link
Author

ORESoftware commented Jun 30, 2017

Ok, my bad, I can't read, so I see these two options:

--disableWarnings, -D Ignore all TypeScript errors (also process.env.TS_NODE_DISABLE_WARNINGS)

--fast, -F Use TypeScript's transpileModule mode (no type checking, but faster compilation) (also process.env.TS_NODE_FAST)

but it doesn't specify what we should set these env variables to...I now assume if I set them to anything non-empty it will work, about to try it out.

@ORESoftware
Copy link
Author

Ok so this is what I leave you with lol, I have this:

export TS_NODE_DISABLE_WARNINGS="yes";
export TS_NODE_FAST="yes";

ts-node "${TEST_PATH}";

and apparently it's not picking up those env variables, perhaps I should set them to a value other than "yes" to get them to work? :)

thx

@blakeembrey
Copy link
Member

Ignore warnings is a list, as mentioned in https://github.com/TypeStrong/ts-node#configuration-options. Generally you'd use either the CLI options or the environment variables, but I can enable it so you can use both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants