-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
Spec: Decoratorsarea: third partyarea: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
💻
- Would you like to work on a fix?
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
class C {
accessor
property
}
Configuration file name
No response
Configuration
Use @babel/parser
as a Node.js API.
Current and expected behavior
current:
@babel/parser
with typescript
plugin parses the input code to:
// pseudo AST
{
type: class
children: [
property ( name = "accessor" ),
property ( name = "foo" )
]
}
But TypeScript Compiler parses the input code to:
// pseudo AST
{
type: class
children: [
accessor property ( name = "foo" )
]
}
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 )
Metadata
Metadata
Assignees
Labels
Spec: Decoratorsarea: third partyarea: typescriptoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue