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: The keyword 'const' is reserved #592

Closed
ethans opened this issue May 30, 2016 · 5 comments

Comments

@ethans
Copy link

commented May 30, 2016

I'm using the latest build of atom for Windows and the latest linter-eslint (7.2.2) with my NodeJS project.

I am getting a parsing error every time I use the keyword const.

Example:
const a = 5;

I get:

Parsing error: The keyword 'const' is reserved at line XX col YY

How come? What am I doing wrong?

Thanks,
Ethan

@ethans ethans closed this May 30, 2016

@ethans

This comment has been minimized.

Copy link
Author

commented May 30, 2016

I'm closing this as I finally found that the default is still EcmaScript 5. After adding a .eslintrc file to my project and setting to ecmaVersion 6 - all's good.

@nikulkarni

This comment has been minimized.

Copy link

commented Mar 8, 2017

For those who came here figuring it out how to do this, in .eslintrc file add below

"parserOptions": {
   "ecmaVersion": 6
 }
@slonak79

This comment has been minimized.

Copy link

commented Jun 26, 2017

Thanks @nikulkarni this worked for me!

@MAPESO

This comment has been minimized.

Copy link

commented Feb 28, 2018

@nikulkarni @ethans Should not it be like this?

"parserOptions": { "ecmaVersion": 2015 }

ES2015 === ES6

@Arcanemagus

This comment has been minimized.

Copy link
Member

commented Feb 28, 2018

@MAPESO Either way works, as specified in the documentation.

Locking this as the original question has been resolved and several ways of configuring this have been posted 😉.

@AtomLinter AtomLinter locked as resolved and limited conversation to collaborators Feb 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.