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

Pass `context' to error formatters #756

Merged
merged 1 commit into from
Apr 7, 2018

Conversation

gustavderdrache
Copy link
Contributor

This PR adds the context variable to the ErrorInfo interface. The primary use case is here is to allow custom error formatters to recover the full path to the file in which an error occurred, since I wanted to read the file from disk to use 'babel-code-frame' to go along with the message.

I couldn't find tests that exercise errorFormatter functionality, but I'm happy to write some extras if you'd like.

@johnnyreilly
Copy link
Member

Thanks for this! Let me have a ponder and report back.

@johnnyreilly
Copy link
Member

Yeah - I'm happy to take this. I'll merge as is and fix the tests myself. Thanks for contributing!

@johnnyreilly johnnyreilly merged commit 3a73e62 into TypeStrong:master Apr 7, 2018
@johnnyreilly
Copy link
Member

Released with 4.2.0 - thanks! https://github.com/TypeStrong/ts-loader/releases/tag/v4.2.0

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

Successfully merging this pull request may close these issues.

2 participants