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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Imports and BigInt have arrived at Stage 4 馃帀 #11803

Open
mysticatea opened this issue Jun 4, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@mysticatea
Copy link
Member

commented Jun 4, 2019

Dynamic Imports and BigInt have arrived at Stage 4.
This is the tracking issue to support the new syntaxes.

  • ESTree Spec: estree/estree#198
  • Acorn Update: acornjs/acorn#833
  • Espree Update: (link)
  • ESLint Update: the following rules look like to need update.
    • comma-dangle rule: should ignore dynamic imports because Dynamic Imports syntax disallows trailing commas.
    • indent rule: should know Import node.
    • no-magic-number rule: should recognize BigInt literals.
    • valid-typeof rule: should recognize BigInt type. (PR #11802)
    • yoda rule: should recognize BigInt literals.
    • astUtils.isNullLiteral(node): should recognize BigInt literals.
    • Maybe more...
@g-plane

This comment has been minimized.

Copy link
Member

commented Jun 4, 2019

I have opened an issue at Acorn's repo: acornjs/acorn#833 .

@mercmobily

This comment has been minimized.

Copy link

commented Jun 9, 2019

While this gets implemented (thank you!), is there a way to get around it with an ignore?
At the moment, if you have:

import(resolvedPageUrl)

you get:

Parsing error: 'import' and 'export' may only appear at the top level

The problem is that this is a parsing error... so the file doesn't get linted at all.
Is there a workaround while we wait for this to actually land? (It looks like it may be a little while!)

@g-plane

This comment has been minimized.

Copy link
Member

commented Jun 9, 2019

You can use babel-eslint as parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.