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
yarn
to install all deps - Run
make generate-tsconfig
to generate all thetsconfig.json
files - 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