Skip to content

Allow disableWarnings to be set by environment variable #56

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

Closed
joeskeen opened this issue Feb 3, 2016 · 2 comments
Closed

Allow disableWarnings to be set by environment variable #56

joeskeen opened this issue Feb 3, 2016 · 2 comments

Comments

@joeskeen
Copy link
Contributor

joeskeen commented Feb 3, 2016

I've been looking at #44 and I noticed that one of the things you want to do is make it fast and production-ready. I'm really excited about this, but I realize that a lot of time is involved in a rewrite and that I can't realistically expect this to be done in the near future (although I'd be happy to help).

I'm working on a tool called node-script (https://github.com/joeskeen/node-script), which allows you to create self-contained Node scripts (not requiring a package.json file or running npm install first). One of the big things I'm in the process of tackling before v1.0 is transpiler support. I'm currently using the interpret module to determine which packages are required to register the script file. Currently ts-node is first in line for the ts file extension, so that is the one that node-script calls upon to run TypeScript node-scripts. The issue comes when I copy the script file to another location to run it in isolation. Removed from its home during development, the script's /// <reference /> comments and other typing resolution no longer resolves. Since interpret points me directly to require('ts-node/register'), I can't call require('ts-node').register({options}) without making a special case.

If ts-node's register function was able to pick up whether to disableWarnings from process.env or something similar, I could make sure that that is set before require('ts-node/register') is called.

I think that this could be a good workaround until the new production-ready version of ts-node is ready.

@blakeembrey
Copy link
Member

Sure, seems reasonable. I'm certainly accepting PRs for work like this, I'm not sure when I'll get to it myself since I'm trying to keep up with Typings. Personally, I'd make it part of the default options: https://github.com/TypeStrong/ts-node/blob/master/src/ts-node.ts#L118.

@blakeembrey
Copy link
Member

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

No branches or pull requests

2 participants