Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

fix typescript compiler emit output #1382

Closed
wants to merge 1 commit into from
Closed

fix typescript compiler emit output #1382

wants to merge 1 commit into from

Conversation

HerringtonDarkholme
Copy link

Syntastic will emit js file when checking TypeScript file. This is not a desirable behavior.

According to TypeScript module specs, --out flags should not be used with external module. So --module commonjs and --out /dev/null are two mutually exclusiv arguments.

This is not a problem with TypeScript compiler, because module loader specs require all files are separated and imported by loader. So --output is not a valid option for checking.

However, tsc does provide a more straightforward option --noEmit, which is a more sensible alternative.
This also fixes #1155

@lcd047
Copy link
Collaborator

lcd047 commented Apr 11, 2015

However, tsc does provide a more straightforward option --noEmit

Except this option is new in tsc 1.5.0-alpha, so your patch is missing at least a version check.

Other than lack of conceptual purity, is there any downside to mixing --module commonjs with --out /dev/null when checking syntax, for versions 1.4 and earlier?

This also fixes #1155

It fixes the reported behaviour, not the root of the problem. The root of the problem, as I pointed out, is in libuv, and it also affects other syntastic checkers.

@HerringtonDarkholme
Copy link
Author

Or I will add a version check, with TS1.5 --noEmit and other version as --out /dev/null.

Using --module commonjs just ignores --out /dev/null, and all js files get emitted.

@HerringtonDarkholme
Copy link
Author

I don't think there is an optimal solution for now. TS Vim user should find their own way to get rid of this.

@lcd047
Copy link
Collaborator

lcd047 commented Apr 11, 2015

--out /dev/null is not ignored with tsc 1.4 and earlier. It seems to work as intended on all systems except Windows, where it fails for the reason mentioned in #1155.

@lcd047
Copy link
Collaborator

lcd047 commented Apr 11, 2015

Please see fe43637.

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

Successfully merging this pull request may close these issues.

2 participants