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

Intercept type check logging #183

Closed
lastmjs opened this issue Dec 22, 2016 · 4 comments
Closed

Intercept type check logging #183

lastmjs opened this issue Dec 22, 2016 · 4 comments

Comments

@lastmjs
Copy link

lastmjs commented Dec 22, 2016

I would like to somehow intercept the results of type checking so that I can do some things with them before sending them to the user. Is there a good way of doing this that plugin-typescript provides? Ideally, since I'm using plugin-typescript with systemjs-builder, it would be nice if in the output of compile the type checking results were presented as a property on the output.

@frankwallis
Copy link
Owner

I think it should be easy enough to add the errors to the systemjs metadata for each file, do you just want the error messages as strings or do you need more structured output, for example to differentiate between warnings and errors?

@lastmjs
Copy link
Author

lastmjs commented Dec 28, 2016

Sounds great! I'm not sure what I'll need, but if it isn't too much trouble I think sending over as much information as possible would be best. For my use case I am eventually going to be showing the user the exact error messages that TypeScript would be outputting to the console, if that helps.

@frankwallis
Copy link
Owner

I have added the errors to the file metadata being output, however I am not sure that the type-checking is going to work with the builder.compile api you are using. The plugin needs all of a file's dependencies (including declaration files) to be passed through before it can fully type-check a file, so the type-errors are not available until sometime after the file has been transpiled.

@frankwallis
Copy link
Owner

The plugin no longer supports type-checking but syntax errors are still provided in file metadata after transpilation

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