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.

env.es6=false does not disable es6-specific rules

See original GitHub issue

.eslintrc:

{
  "env": {
    "es6": false
  },
  "rules": {
    "no-var": 2
  }
}

index.js:

'use strict';

var test = 1;

global.console.log(test);

$ eslint .

index.js 3:1 error Unexpected var, use let or const instead no-var

It would be desirable to be able to maintain a single shared config that enables ES6 rules such as “no-var”, and use this config with both ES5 and ES6 projects. Ideally, the only difference in ESLint configuration between such projects would be the value of env.es6.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bsedcommented, May 8, 2016

1:1 error Unexpected var, use let or const instead no-var 2:1 error Unexpected var, use let or const instead no-var 3:1 error Unexpected var, use let or const instead no-var 3:5 error ‘favicon’ is defined but never used no-unused-vars 4:1 error Unexpected var, use let or const instead no-var 5:1 error Unexpected var, use let or const instead no-var 6:1 error Unexpected var, use let or const instead no-var 8:1 error Unexpected var, use let or const instead no-var 9:1 error Unexpected var, use let or const instead no-var 11:1 error Unexpected var, use let or const instead no-var

1reaction
jokeyrhymecommented, Sep 8, 2015

I’m using ESLint v1.3.1.

I think the long term solution is to actually generate the rules documentation by parsing each rule’s implementation JavaScript. This means each rule declares which group of rules it belongs in (e.g. “style”, “es6”, etc). From this, ESLint can identify all the ES6 rules and disable them when env.es6 is false.

A short-term solution would be to just explicitly list all the ES6 rules in the code responsible for disabling them. We’d need a strategy for keeping the list up to date, perhaps a unit test that parses the documentation to identify “es6” rules?

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-process-env - ESLint - Pluggable JavaScript Linter
If you prefer to use process.env throughout your project to retrieve values from environment variables, then you can safely disable this rule. Version....
Read more >
/etc/portage/package.env - Gentoo Wiki
/etc/portage/env can contain files to be called during the installation of specific packages, or files used to set Portage's environment ...
Read more >
env() - CSS: Cascading Style Sheets - MDN Web Docs
The env() CSS function can be used to insert the value of a user-agent defined environment variable into your CSS, in a similar...
Read more >
zee.env, the environment configuration file
Default values are provided for all variables that are not explicitly specified. The syntax of the file follows standard z/OS UNIX shell syntax...
Read more >
We need to talk about the .env
env files are increasingly popular as a way to configure an application. ... While two different applications may not use the same variable ......
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