-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Description
🔎 Search Terms
comment 5.5 invalid injected inlined
🕗 Version & Regression Information
- This changed in version 5.5-beta
⏯ Playground Link
No response
💻 Code
- Clone https://github.com/nicolo-ribaudo/babel/tree/ts-5.5-random-comment
- Run
yarnto install all deps - Run
make generate-tsconfigto generate all thetsconfig.jsonfiles - Run
yarn tsc -b ./packages/babel-helper-plugin-utils/tsconfig.json
If you ever need to reset the TS state (e.g. delete all .tsbuildinfo and .d.ts files), run make clean-dts.
🙁 Actual behavior
dts/packages/babel-parser/src/plugins/typescript/index.d.ts, line 540 contains a random @ts-expect-error comment:
parseExprListItem(this: Parser, allowEmpty?: boolean, refExpressionErrors?: ExpressionErrors | null, allowPlaceholder?: boolean | // @ts-expect-error todo(flow->ts) 0121
null): N.Expression | null;That parseExprListItem is inlined there from another file, that doesn't have that comment:
https://github.com/nicolo-ribaudo/babel/blob/e5726bde94899149d60706698a0f0a968208bf60/packages/babel-parser/src/parser/expression.ts#L2711-L2728
Instead, that comment is coming from
https://github.com/nicolo-ribaudo/babel/blob/e5726bde94899149d60706698a0f0a968208bf60/packages/babel-parser/src/plugins/typescript/index.ts#L2637-L2642
🙂 Expected behavior
The comment shouldn't be there
Metadata
Metadata
Assignees
Labels
No labels