TypeScript
TypeScript copied to clipboard
fix(formatting): recover from token spans outside property children
Summary
- Fix formatting recursion guard in
processChildNodeto handle scanner tokens that overrun the current child node boundary in recovery scenarios. - Add regression fourslash test for the invalid type-literal property syntax (
type X = { prop: = \${abc}`xyz }) that triggeredDebug Failure. False expression: Token end is child end`.
Validation
npx hereby runtests --tests formattingTokenEndChildEnd --light=false- ✅ 1 passing (fourslash regression)
Fixes #63598.
@microsoft-github-policy-service agree
@ahfoysal You should read this: https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md
The TypeScript repo is closed for development; PR should be in the typescript-go repo. Please see the top section of CONTRIBUTING.md and pinned issue #62963.