Print ; for module declaration and declare function without body (#18852)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-02-05 10:19:28 +08:00
1 parent c06314c988
commit 0eda012bcb
9 files changed
+203 -5

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
#### Fix required semicolon in `no-semi` mode (#18852 by @fisker)
<!-- prettier-ignore -->
```tsx
// Input
declare module "autoprefixer";
{
alert()
}
declare function a();
{
alert()
}
// Prettier stable (--no-semi)
declare module "autoprefixer"
{
alert()
}
declare function a()
{
alert()
}
// Prettier main (--no-semi)
declare module "autoprefixer";
{
alert();
}
declare function a();
{
alert();
}
```