Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Parsing error: The keyword 'const' is reserved #592

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

Parsing error: The keyword 'const' is reserved #592

ethans opened this issue May 30, 2016 · 6 comments

Comments

@ethans
Copy link

ethans 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 as completed May 30, 2016
@ethans
Copy link
Author

ethans 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
Copy link

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

"parserOptions": {
   "ecmaVersion": 6
 }

@slonak79
Copy link

Thanks @nikulkarni this worked for me!

@markozxuu
Copy link

@nikulkarni @ethans Should not it be like this?

"parserOptions": { "ecmaVersion": 2015 }

ES2015 === ES6

@Arcanemagus
Copy link
Member

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@Arcanemagus @nikulkarni @ethans @slonak79 @markozxuu and others