Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES module support for check-es-compat #69

Open
robatwilliams opened this issue May 5, 2023 · 5 comments
Open

ES module support for check-es-compat #69

robatwilliams opened this issue May 5, 2023 · 5 comments
Labels
enhancement New feature or request modernise Needs doing for evergreenness

Comments

@robatwilliams
Copy link
Owner

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

Parsing error: Unexpected token Promise
@robatwilliams robatwilliams added the bug Something isn't working label May 5, 2023
@robatwilliams
Copy link
Owner Author

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

@robatwilliams
Copy link
Owner Author

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
Copy link
Owner Author

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

@robatwilliams
Copy link
Owner Author

robatwilliams commented May 12, 2023

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

Even import/export statements don't work.

@robatwilliams robatwilliams changed the title Top-level await breaks check-es-compat ES module support for check-es-compat May 12, 2023
@robatwilliams robatwilliams added enhancement New feature or request and removed bug Something isn't working labels May 12, 2023
@benasher44
Copy link

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)

@robatwilliams robatwilliams added the modernise Needs doing for evergreenness label Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request modernise Needs doing for evergreenness
Projects
None yet
Development

No branches or pull requests

2 participants