tools: update to ESLint 3.2.2 · nodejs/node@60ff991 · GitHub
Skip to content

Commit 60ff991

Browse files
Trottcjihrig
authored andcommitted
tools: update to ESLint 3.2.2
PR-URL: #7999 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
1 parent 4a8b804 commit 60ff991

701 files changed

Lines changed: 18378 additions & 10561 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 1 addition & 1 deletion

tools/eslint/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ These folks keep the project moving and are resources for help.
126126
* Henry Zhu ([@hzoo](https://github.com/hzoo))
127127
* Marat Dulin ([@mdevils](https://github.com/mdevils))
128128
* Alexej Yaroshevich ([@zxqfox](https://github.com/zxqfox))
129-
130-
### Issues Team
131-
132129
* Kevin Partington ([@platinumazure](https://github.com/platinumazure))
133130
* Vitor Balocco ([@vitorbal](https://github.com/vitorbal))
134131

@@ -169,6 +166,8 @@ ESLint follows [semantic versioning](http://semver.org). However, due to the nat
169166
* An existing formatter is removed.
170167
* Part of the public API is removed or changed in an incompatible way.
171168

169+
According to our policy, any minor update may report more errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds.
170+
172171
## Frequently Asked Questions
173172

174173
### How is ESLint different from JSHint?
@@ -187,7 +186,10 @@ Yes. Since we are solving the same problems, ESLint and JSCS teams have decided
187186

188187
### So, should I stop using JSCS and start using ESLint?
189188

190-
Not yet. We are still working to smooth the transition. You can see our progress [here](https://github.com/eslint/eslint/milestones/JSCS%20Compatibility). We’ll announce when all of the changes necessary to support JSCS users in ESLint are complete and will start encouraging JSCS users to switch to ESLint at that time. Meanwhile, we recommend you to upgrade to JSCS 3.0 and provide feedback to the team.
189+
Maybe, depending on how much you need it. [JSCS has reached end of life](http://eslint.org/blog/2016/07/jscs-end-of-life), but if it is working for you then there is no reason to move yet. We are still working to smooth the transition. You can see our progress [here](https://github.com/eslint/eslint/milestones/JSCS%20Compatibility). We’ll announce when all of the changes necessary to support JSCS users in ESLint are complete and will start encouraging JSCS users to switch to ESLint at that time.
190+
191+
If you are having issues with JSCS, you can try to move to ESLint. We are focusing our time and energy on JSCS compatibility issues.
192+
191193

192194
### Is ESLint just linting or does it also check style?
193195

tools/eslint/bin/eslint.js

Lines changed: 0 additions & 80 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"categories": [
3+
{ "name": "Possible Errors", "description": "These rules relate to possible syntax or logic errors in JavaScript code:" },
4+
{ "name": "Best Practices", "description": "These rules relate to better ways of doing things to help you avoid problems:" },
5+
{ "name": "Strict Mode", "description": "These rules relate to strict mode directives:" },
6+
{ "name": "Variables", "description": "These rules relate to variable declarations:" },
7+
{ "name": "Node.js and CommonJS", "description": "These rules relate to code running in Node.js, or in browsers with CommonJS:" },
8+
{ "name": "Stylistic Issues", "description": "These rules relate to style guidelines, and are therefore quite subjective:" },
9+
{ "name": "ECMAScript 6", "description": "These rules relate to ES6, also known as ES2015:" }
10+
],
11+
"removed": {
12+
"name": "Removed",
13+
"description": "These rules from older versions of ESLint have been replaced by newer rules:",
14+
"rules": [
15+
{ "removed": "generator-star", "replacedBy": ["generator-star-spacing"] },
16+
{ "removed": "global-strict", "replacedBy": ["strict"] },
17+
{ "removed": "no-arrow-condition", "replacedBy": ["no-confusing-arrow", "no-constant-condition"] },
18+
{ "removed": "no-comma-dangle", "replacedBy": ["comma-dangle"] },
19+
{ "removed": "no-empty-class", "replacedBy": ["no-empty-character-class"] },
20+
{ "removed": "no-empty-label", "replacedBy": ["no-labels"] },
21+
{ "removed": "no-extra-strict", "replacedBy": ["strict"] },
22+
{ "removed": "no-reserved-keys", "replacedBy": ["quote-props"] },
23+
{ "removed": "no-space-before-semi", "replacedBy": ["semi-spacing"] },
24+
{ "removed": "no-wrap-func", "replacedBy": ["no-extra-parens"] },
25+
{ "removed": "space-after-function-name", "replacedBy": ["space-before-function-paren"] },
26+
{ "removed": "space-after-keywords", "replacedBy": ["keyword-spacing"] },
27+
{ "removed": "space-before-function-parentheses", "replacedBy": ["space-before-function-paren"] },
28+
{ "removed": "space-before-keywords", "replacedBy": ["keyword-spacing"] },
29+
{ "removed": "space-in-brackets", "replacedBy": ["object-curly-spacing", "array-bracket-spacing"] },
30+
{ "removed": "space-return-throw-case", "replacedBy": ["keyword-spacing"] },
31+
{ "removed": "space-unary-word-ops", "replacedBy": ["space-unary-ops"] },
32+
{ "removed": "spaced-line-comment", "replacedBy": ["spaced-comment"] }
33+
]
34+
}
35+
}

tools/eslint/conf/environments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// Requirements
99
//------------------------------------------------------------------------------
1010

11-
var globals = require("globals");
11+
let globals = require("globals");
1212

1313
//------------------------------------------------------------------------------
1414
// Public Interface

tools/eslint/conf/eslint-all.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
// Requirements
1010
//------------------------------------------------------------------------------
1111

12-
var fs = require("fs"),
12+
let fs = require("fs"),
1313
path = require("path");
1414

1515
//------------------------------------------------------------------------------
1616
// Helpers
1717
//------------------------------------------------------------------------------
1818

19-
var ruleFiles = fs.readdirSync(path.resolve(__dirname, "../lib/rules"));
20-
var enabledRules = ruleFiles.reduce(function(result, filename) {
21-
result[path.basename(filename, ".js")] = "error";
19+
let ruleFiles = fs.readdirSync(path.resolve(__dirname, "../lib/rules"));
20+
let enabledRules = ruleFiles.reduce(function(result, filename) {
21+
if (path.extname(filename) === ".js") {
22+
result[path.basename(filename, ".js")] = "error";
23+
}
2224
return result;
2325
}, {});
2426

tools/eslint/conf/eslint.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
"no-spaced-func": "off",
100100
"no-sparse-arrays": "error",
101101
"no-sync": "off",
102+
"no-tabs": "off",
102103
"no-ternary": "off",
103104
"no-trailing-spaces": "off",
104105
"no-this-before-super": "error",
@@ -174,6 +175,7 @@
174175
"max-params": "off",
175176
"max-statements": "off",
176177
"max-statements-per-line": "off",
178+
"multiline-ternary": "off",
177179
"new-cap": "off",
178180
"new-parens": "off",
179181
"newline-after-var": "off",

tools/eslint/lib/ast-utils.js

Lines changed: 50 additions & 16 deletions

0 commit comments

Comments
 (0)