Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support TS4.9
satisfies
operator (#13764)
* Print `satisfies` operators * Add tests * Add changelog * Add `hug-args` tests * Add more tests for TSAsExpression * Add tests for argument expansion * Add tests for template literal * Add tests for ternary * Add tests for export default satisfies * Add tests for no lookahead tokens * Add more tests for needs parens 1 * Add more tests for needs-parens 2 * Add more tests for needs parens 3 * Add tests for needs parens 4 * Add comment * Add more tests for needs parens 5 * Add more tests for needs parens 6 * Fix test cases * Fix snapshots * Fix unstable tests * No parens for mixed * Merge printing logic * More reuse `isTSTypeExpression`
- Loading branch information
1 parent
7bfed17
commit 931661a
Showing
26 changed files
with
1,325 additions
and
11 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,16 @@ | ||
#### Support TypeScript 4.9 (#13764 by @sosukesuzuki) | ||
|
||
Support [TypeScript 4.9](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9) features! | ||
|
||
##### [`satisfies` operator](https://devblogs.microsoft.com/typescript/announcing-typescript-4-9-beta/#the-satisfies-operator) | ||
|
||
Supported by only `babel-ts` parser. | ||
|
||
<!-- prettier-ignore --> | ||
```tsx | ||
const palette = { | ||
red: [255, 0, 0], | ||
green: "#00ff00", | ||
blue: [0, 0, 255] | ||
} satisfies Record<Colors, string | RGB>; | ||
``` |
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
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.