Support flow "match" syntax (#17681)

This commit is contained in:
fisker Cheung authored and GitHub committed 2025-08-04 15:27:10 +08:00
1 parent 6c0c37a00c
commit acd25a9aa6
41 files changed
+4824 -34

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
#### Add basic support for "match" syntax (#17681 by @fisker)
<!-- prettier-ignore -->
```jsx
// Input
const e = match (a) {
1 => true,
'foo' => false,
2 => {obj: 'literal'},
};
// Prettier stable
SyntaxError: Unexpected token `{`, expected the token `;` (1:21)
> 1 | const e = match (a) {
| ^
2 | 1 => true,
3 | 'foo' => false,
4 | 2 => {obj: 'literal'},
// Prettier main
const e = match (a) {
1 => true,
"foo" => false,
2 => { obj: "literal" },
};
```