Conversation
…warnings Add file:line:col context to extraction error/warning messages in both the TypeScript transformer and Rust CLI extractor. Closes #6428. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
… extraction errors - Rust: test panic includes file:line:col for non-static id and defaultMessage (throws=true) - Rust: test non-static defaultMessage is skipped without panic (throws=false) - TS: test error includes file:line:col pattern (throws=true) - TS: test onMsgError callback receives error with file:line:col (throws=false) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
file:line:colcontext to extraction error/warning messages in both the TypeScript transformer and Rust CLI extractorhandleErrornow accepts an optional AST node and usests.getLineAndCharacterOfPosition()to prepend locationMessageExtractorstores source text and usesget_line_col()to formatfile:line:colin warnings/panics. Also emitseprintln!warnings whenthrows=false(previously silently skipped)Before:
[FormatJS] \id` must be a string literal to be extracted.**After:**src/components/Foo.tsx:12:5 [FormatJS] `id` must be a string literal to be extracted.`Closes #6428
Test plan
bazel test //crates/formatjs_cli:formatjs_cli_test— 176 tests passbazel test //packages/ts-transformer:unit_test— all tests passbazel test //packages/cli/integration-tests:conformance_test— 60/60 conformance tests pass🤖 Generated with Claude Code