New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support decorator auto accessors syntax #13919
Changes from 1 commit
4555d4b
7aa403f
ba35f42
c6723fc
84fde47
a48cf7f
34770f2
929c2dd
c641b96
604fc53
9055783
45247b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -177,7 +177,10 @@ const isClassProperty = ({ type }) => | |||
function shouldPrintSemicolonAfterClassProperty(node, nextNode) { | ||||
const name = node.key && node.key.name; | ||||
if ( | ||||
(name === "static" || name === "get" || name === "set") && | ||||
(name === "static" || | ||||
fisker marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
name === "get" || | ||||
name === "set" || | ||||
name === "accessor") && | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a TODO comment about microsoft/TypeScript#51707 |
||||
!node.value && | ||||
!node.typeAnnotation | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
prettier/src/language-js/print/class.js Line 229 in aa34209
We should also test private fields, since we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are not checking |
||||
) { | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are here. Let's remove this chaining, I don't think the
key
can be nullish here.