#20096·prettier

TS: Statement after top-level `await` is duplicated with `typescript` parser

Author: leaysgurCreated Sep 17, 2026Updated Sep 17, 2026
Labelshelp wantedlang:typescriptscope:external

Prettier v3.9.7 Playground link

--parser typescript

Input:

await { then() {} };

await getPromise;

Output:

await { then() {} };

await getPromise;
await getPromise;

Second Output:

await { then() {} };

await getPromise;
await getPromise;
await getPromise;

Expected output:

await { then() {} };

await getPromise;

Why?

It seems TS side issue rather than Prettier, since AST contains duplicated node in the first place.

Refs: https://github.com/microsoft/TypeScript/issues/59777

So just FYI, feel free to close in that case.

(P.S. While seeing #20095, babel-ts does not have this issue.)