[Bug]: Inconsistently parsing between TypeScript and Babel for decorator auto accessors #15238
Labels
area: third party
area: typescript
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
Spec: Decorators
馃捇
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
Configuration file name
No response
Configuration
Use
@babel/parser
as a Node.js API.Current and expected behavior
current:
@babel/parser
withtypescript
plugin parses the input code to:But TypeScript Compiler parses the input code to:
expected:
Must match the decorator spec. I don't know which is correct.
If TypeScript Compiler behavior is wrong, we should report to microsoft/typescript repository.
Environment
Environment does not matter.
Possible solution
Fix parsing logic
Additional context
I noticed this while working on printing accessor property syntax for Prettier ( prettier/prettier#13919 )
The text was updated successfully, but these errors were encountered: