Make error message prefixes more descriptive #11612
Merged
+22
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sorry for the drive-by contribution. Didn't want to forget about it. I'll look at possible CI failures later.Updated testsI noticed when testing errors for babel macro with
babel-plugin-tester
that the error messages would be prefixed withunknown:
. It wasn't clear to me whether this was an issue on my side with custom errors or babel-plugin-tester.Turns out this is expected if the code does not come from an actual file. Hopefully this is less confusing for future users if we prefix it with "unknown file" instead of "unknown". It's not obvious to me that "unknown" refers to a file in the error context.
It might even make more sense to not prefix the filename and instead append the filename e.g.
unknown error