question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Use of future reserved word in strict mode" false positive with eslint-env es6

See original GitHub issue

ESLint version: 0.17.1 (and 67936e0d571c613ac54f4097b4235e6411af0b79 gives the same results)

foo.js:

/*eslint-env es6 */
let x = 42;

.eslintrc:

{
    "ecmaFeatures": { "modules": true }
}

The false positive:

$ ./node_modules/.bin/eslint foo.js 

foo.js
  2:1  error  Use of future reserved word in strict mode

✖ 1 problem (1 error, 0 warnings)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Mar 23, 2015

Most likely we’re not apply ecmaFeatures for inline environments correctly. As a workaround, you can try adding env: { es6: true } to your config file.

0reactions
nzakascommented, May 15, 2015

@ilyavolodin we can’t leave this. Either we remove the es6 environment or we figure out a way to make this work.

We could, in theory, just search for /*eslint-env and see if there’s es6:true before parsing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use of future reserved word in strict mode - Stack Overflow
The use of let is what is causing that error inside of strict mode. Change it to var . Sounds like you're in...
Read more >
Language Options - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
how to add es6 in sapui5? - SAP Community
Hi, I wish to add ES6 functionality like let while implementing client side functionality...i am getting a error("Use of future reserved word in...
Read more >
@babel/plugin-transform-reserved-words - Package Manager
Ensure that no reserved words are used. babel-plugin. readme. babel. The compiler for writing next generation JavaScript. Gitpod ready ...
Read more >
CoffeeScript
The biggest change in CoffeeScript 2 is that now the CoffeeScript compiler produces modern JavaScript syntax (ES6, or ES2015 and later).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found