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

Unable to use 'import.meta.url' #11544

Closed
PassTheMayo opened this issue Mar 23, 2019 · 3 comments
Closed

Unable to use 'import.meta.url' #11544

PassTheMayo opened this issue Mar 23, 2019 · 3 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion question This issue asks a question about ESLint

Comments

@PassTheMayo
Copy link

PassTheMayo commented Mar 23, 2019

Tell us about your environment

  • ESLint Version: 5.15.3
  • Node Version: 11.12.0
  • npm Version: 6.7.0

What parser (default, Babel-ESLint, etc.) are you using? Default

Please show your full configuration:

Configuration
{
	"env": {
		"browser": true,
		"es6": true,
		"node": true
	},
	"extends": "eslint:recommended",
	"globals": {
		"Atomics": "readonly",
		"SharedArrayBuffer": "readonly"
	},
	"parserOptions": {
		"ecmaVersion": 2018,
		"sourceType": "module"
	},
	"rules": {
		"indent": [
			"error",
			"tab"
		],
		"linebreak-style": [
			"error",
			"windows"
		],
		"quotes": [
			"error",
			"single"
		],
		"semi": [
			"error",
			"always"
		]
	}
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

const __dirname = path.dirname(new URL(import.meta.url).pathname).substr(1);
eslint src/Website.mjs

What did you expect to happen? I didn't expect an error to be on that line, as it's valid.

What actually happened? Please include the actual, raw output from ESLint.
8:40 error Parsing error: Unexpected token import

Are you willing to submit a pull request to fix this bug? Probably not

@PassTheMayo PassTheMayo added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Mar 23, 2019
@PassTheMayo PassTheMayo changed the title Unable to use 'import.meta.url Unable to use 'import.meta.url' Mar 23, 2019
@ilyavolodin
Copy link
Member

import.meta is a stage 3 proposal currently. ESLint only supports stage 4 proposals. For everything else, you can use babel-eslint.

@ilyavolodin ilyavolodin added question This issue asks a question about ESLint and removed bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Mar 23, 2019
@platinumazure
Copy link
Member

Closing as the question has been answered. Please feel free to stop by our Gitter chat with future questions.

@dandv
Copy link
Contributor

dandv commented Jul 5, 2019

Duplicate of #11189 and #11803.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Oct 2, 2019
@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 2, 2019
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 question This issue asks a question about ESLint
Projects
None yet
Development

No branches or pull requests

4 participants