Ts-node: Show warnings but still run

Created on 18 Nov 2015  路  13Comments  路  Source: TypeStrong/ts-node

Sometimes you want to just run something, while still displaying the warnings (e.g., missing type definitions) that you should fix once that your implementation is working.

enhancement help wanted

Most helpful comment

It's very annoying that I can't run tests even if there is just a tiny unused variable somewhere.

All 13 comments

Ok, sounds reasonable. I don't think it'll be available until I do the refactor mentioned in https://github.com/TypeStrong/ts-node/issues/31#issuecomment-157452776 so give me a week or two, but it'll be a flag in the CLI - something like ts-node --warn-only script.ts.

Just a note if anyone wants to work on this. Semantic errors (type errors) should warn, but I think syntactic errors should throw still since that blocks the emitter.

Any progress on this? tsc supports this mode but ts-node doesn't.

Feel free to submit a PR.

Also, tsc definitely doesn't support this mode - tsc has no runtime to need this mode. Maybe you want something different.

tsc can both emit code and still print warnings to the console. ts-node doesn't appear to have a way to show the warnings but still emit the code.

Definitely, but tsc doesn't execute the code. Printing warnings while code is executing means they'll end up interleaved with your own logs. See the conversation and submit a PR if you want this feature. There's a "help wanted" label for that reason.

There used to be the disableWarnings option that allowed ts-node to still run with warnings (though I believe it also hid those warnings). Whatever happened to that?

It's very annoying that I can't run tests even if there is just a tiny unused variable somewhere.

+1 quite annoying

@floribon There's a 馃憤 button you can click for this. It's quite annoying for everyone involved, but this is an open source project and everyone is welcome to contribute 馃槃

Ha yeah, sorry for being entitled! I totally respect your work and thank you a lot on behalf of everyone that sound like they just complain when their free toy doesn't work the way they like it.

+1 though, I was afraid the emoji would get missed :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Borewit picture Borewit  路  3Comments

nehalist picture nehalist  路  3Comments

joshua-tj picture joshua-tj  路  3Comments

sanex3339 picture sanex3339  路  4Comments

mattdell picture mattdell  路  4Comments