google / eslint-config-google

ESLint shareable config for the Google JavaScript style guide
Apache License 2.0
1.74k stars 140 forks source link

Using const variable declaration shows as invalid #53

Closed jvanalst closed 3 months ago

jvanalst commented 5 years ago

According to: 5.1.1 we should be using const by default.

But when I eslint against:

'use strict';
const stream = require('stream');

It outputs:

/Users/vanalsti/Projects/examvis-eclass/examvis/eslint-test.js 2:1 error Parsing error: The keyword 'const' is reserved

✖ 1 problem (1 error, 0 warnings)

philipwalton commented 5 years ago

https://stackoverflow.com/questions/42706584/eslint-error-parsing-error-the-keyword-const-is-reserved

ghost commented 3 years ago

eslint uses es5 syntax and you should let him know that you are using es6 syntax: { "env": { "es6": true } }

iennae commented 3 months ago

@jvanalst I'm going to go ahead and close this, as it looks like there have been a couple responses that answer the question. Please feel free to reopen if you have additional questions about resolving.