es-compat icon indicating copy to clipboard operation
es-compat copied to clipboard

ES module support for check-es-compat

Open robatwilliams opened this issue 2 years ago • 5 comments

Its parserOptions doesn't include sourceType: 'module', and top-level await can only be used in ES modules.

Parsing error: Unexpected token Promise

robatwilliams avatar May 05 '23 15:05 robatwilliams

I didn't check the tool before releasing v3.0.0, despite it being on the checklist in contributing.md

robatwilliams avatar May 05 '23 15:05 robatwilliams

There are probably some things on the other hand, that are not allowed in sourceType=module.

Needs thinking.

Quite niche issue probably. Fix when doing next batch of work.

robatwilliams avatar May 05 '23 15:05 robatwilliams

ES2020 import.meta and export * as have the same problem, nobody complained so far...

robatwilliams avatar May 05 '23 15:05 robatwilliams

Tool needs to be told what the sourceType is, so needs a command line arg.

Even import/export statements don't work.

robatwilliams avatar May 12 '23 16:05 robatwilliams

Would love to see this! We'd like to use this package to check our final frontend build, and most frontend builds these days are ESM (including ours)

benasher44 avatar Jun 02 '23 02:06 benasher44