Before:
declare function foo(); let x = 1;
After:
declare function foo(); let x = 1;
The problem was that clang-format would unconditionally try to parse a child block, even though ambient function declarations do not have a body (similar to forward declarations).