deno fmt ignore top level await

Created on 4 Feb 2020  Â·  5Comments  Â·  Source: denoland/deno

New version of deno fmt can't parse code taht contains top level await.

Case1: eliminated
スクリーンショット 2020-02-04 23 47 36

Case2: failed to parse

async function f() {

}
await f();
$ deno fmt *
Error formatting: tla.ts
   Line 4, column 7: Expected ';', '}' or <eof>
Formatted 0 files in 884.48µs

Most helpful comment

This is fixed in dprint 0.4.3 along with various other improvements and fixes (edit: Use 0.5.0 as it has even more improvements).

Next improvement will be getting the remainder of TS 3.8 features in: https://github.com/dsherret/dprint/milestone/1

I'd submit a quick PR with the fix, but I'm currently setting everything up so maybe later if no one else gets around to it in the meantime.

All 5 comments

cc @dsherret

Thanks! I opened an issue in swc and it should be easy to get this supported.

Any way we can transfer these issues to https://github.com/dsherret/dprint/issues?

Thanks! I opened an issue in swc and it should be easy to get this supported.

Anyway we can transfer these issues to https://github.com/dsherret/dprint/issues?

Looks like one can only transfer issues between repos you're collaborator in

@bartlomieju ok, not a big deal.

Opened https://github.com/dsherret/dprint/issues/88

This is fixed in dprint 0.4.3 along with various other improvements and fixes (edit: Use 0.5.0 as it has even more improvements).

Next improvement will be getting the remainder of TS 3.8 features in: https://github.com/dsherret/dprint/milestone/1

I'd submit a quick PR with the fix, but I'm currently setting everything up so maybe later if no one else gets around to it in the meantime.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

somombo picture somombo  Â·  3Comments

CruxCv picture CruxCv  Â·  3Comments

watilde picture watilde  Â·  3Comments

sh7dm picture sh7dm  Â·  3Comments

justjavac picture justjavac  Â·  3Comments