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

Parsing error: Unexpected token import #13042

Closed
Fi1osof opened this issue Mar 13, 2020 · 5 comments
Closed

Parsing error: Unexpected token import #13042

Fi1osof opened this issue Mar 13, 2020 · 5 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion experimental syntax This change is related to experimental syntax (stage 3 or below)

Comments

@Fi1osof
Copy link

Fi1osof commented Mar 13, 2020

Origin: microsoft/vscode-eslint#908

const moduleURL = new URL(import.meta.url);

This is valid code for .mjs https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Statements/import.meta
But i got eslint error and can not disable this.

  • ESLint Version: 6.8.0
  • Node Version: 10.19.0
  • npm Version: 6.13.4

What parser (default, Babel-ESLint, etc.) are you using?
Pure node-js

@Fi1osof Fi1osof added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Mar 13, 2020
@mdjermanovic mdjermanovic added experimental syntax This change is related to experimental syntax (stage 3 or below) and removed bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Mar 13, 2020
@mdjermanovic
Copy link
Member

Hi @Fi1osof, thanks for the issue!

import.meta proposal is currently in stage 3. ESLint's default parser will support this syntax if and when it reaches stage 4.

In the meantime, you can use a parser that supports experimental syntax, like babel-eslint.

@Fi1osof
Copy link
Author

Fi1osof commented Mar 14, 2020

@mdjermanovic thanks!

@brendankenny
Copy link

import.meta moved to stage 4 on April 1st (the spec proposal still lists it as stage 3 but see tc39/finished-proposals.md and tc39/proposals@0c27379)

Is there extra process for adding support for new syntax or is this something a contributor could help with? Would love to avoid the extra parser dependencies!

cc @mdjermanovic

@brendankenny
Copy link

Oh, sorry, just found #13133 which has this covered :)

@mdjermanovic
Copy link
Member

Closing this issue since we are tracking progress in #13133

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Oct 11, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Oct 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion experimental syntax This change is related to experimental syntax (stage 3 or below)
Projects
None yet
Development

No branches or pull requests

3 participants