-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Bug
Copy link
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 2.8.3
Playground link
--parser typescript
Input:
class Person {
@(myDecoratorArray[0])
greet() {}
}
Output:
class Person {
@myDecoratorArray[0]
greet() {}
}
Why is this wrong?
In the original script, the Person
class has a single member: a greet
method decorated with myDecoratorArray[0]
.
The output has very different code. The Person
class now has two members:
- a
greet
method with zero decorators, and - a computed property (
0
) decorated withmyDecoratorArray
.
Expected behavior:
The output should be the same as the input, with the decorator properly enclosed in parentheses.
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.