forked from prettier/prettier
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support decorator auto accessors syntax (prettier#13919)
* Install new ts-estree * Print auto accessor properties * Support edge cases * Misc tests * Add tests for auto accessor with type annotations * Add changelog * Update changelog_unreleased/typescript/13919.md Co-authored-by: fisker Cheung <lionkay@gmail.com> * Update changelog_unreleased/typescript/13919.md Co-authored-by: fisker Cheung <lionkay@gmail.com> * Print semicolon for accessor and add tests * Add TODO comment * Add to properties list * Address review Co-authored-by: fisker Cheung <lionkay@gmail.com>
- Loading branch information
Showing
25 changed files
with
744 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#### Support auto accessors syntax (#13919 by @sosukesuzuki) | ||
|
||
Support for [Auto Accessors Syntax](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9/#auto-accessors-in-classes) landed in TypeScript 4.9. | ||
|
||
(Doesn't work well with `babel-ts` parser) | ||
|
||
<!-- prettier-ignore --> | ||
```tsx | ||
class Foo { | ||
accessor foo: number = 3; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.