-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TypeScript: Support a TS 3.9 breaking change for Optional Chaining an…
…d Non-Null Assertions (#8450) * Suuport improvement optional chaining ergonomics * Add changelog * Fix reviewed points
- Loading branch information
1 parent
ffceb60
commit 3fc7579
Showing
4 changed files
with
89 additions
and
2 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 3.9 breaking change for Optional Chaining and Non-Null Assertions ([#8450](https://github.com/prettier/prettier/pull/8450) by [@sosukesuzuki](https://github.com/sosukesuzuki)) | ||
|
||
See https://devblogs.microsoft.com/typescript/announcing-typescript-3-9/#breaking-changes | ||
|
||
<!-- prettier-ignore --> | ||
```ts | ||
// Input | ||
(a?.b)!.c; | ||
|
||
// Prettier stable | ||
a?.b!.c; | ||
|
||
// Prettier master | ||
(a?.b)!.c; | ||
|
||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
a?.b!.c; | ||
a?.b!.c.d; | ||
a?.b.c!.d; | ||
a!.b?.c; | ||
a?.b!?.c; | ||
a?.b!.c?.c; | ||
(a?.b!).c; | ||
(a?.b)!.c; | ||
|
||
a?.().b!.c; | ||
a?.().b!.c.d; | ||
a?.().b.c!.d; | ||
a?.().b!?.c; | ||
a?.().b!.c?.c; | ||
(a?.().b!).c; | ||
(a?.().b)!.c; | ||
|
||
(a?.b)![c?.d!] |