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:
- Created 8 years ago
- Comments:14 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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
isfalse
.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?