Skip to content

Commit f44969a

Browse files
committed
tools: update ESLint to current version
We have been stalled on ESLint 3.8.0 for some time. Current ESLint is 3.13.0. We have been unable to upgrade because of more aggressive reporting on some rules, including indentation. ESLint configuration options and bugfixes are now such that we can reasonably upgrade. PR-URL: #10561 Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
1 parent a68987c commit f44969a

File tree

722 files changed

+20993
-11049
lines changed

Some content is hidden

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

722 files changed

+20993
-11049
lines changed

.eslintrc

+5-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ rules:
8484
eol-last: 2
8585
func-call-spacing: 2
8686
func-name-matching: 2
87-
indent: [2, 2, {SwitchCase: 1, MemberExpression: 1}]
87+
indent: [2, 2, {ArrayExpression: first,
88+
CallExpression: {arguments: first},
89+
MemberExpression: 1,
90+
ObjectExpression: first,
91+
SwitchCase: 1}]
8892
key-spacing: [2, {mode: minimum}]
8993
keyword-spacing: 2
9094
linebreak-style: [2, unix]

tools/eslint/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ESLint
2-
Copyright jQuery Foundation and other contributors, https://jquery.org/
2+
Copyright JS Foundation and other contributors, https://js.foundation
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal

tools/eslint/README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[Rules](http://eslint.org/docs/rules/) |
1414
[Contributing](http://eslint.org/docs/developer-guide/contributing) |
1515
[Reporting Bugs](http://eslint.org/docs/developer-guide/contributing/reporting-bugs) |
16-
[Code of Conduct](https://jquery.org/conduct/) |
16+
[Code of Conduct](https://js.foundation/conduct/) |
1717
[Twitter](https://twitter.com/geteslint) |
1818
[Mailing List](https://groups.google.com/group/eslint) |
1919
[Chat Room](https://gitter.im/eslint/eslint)
@@ -210,10 +210,7 @@ ESLint has full support for ECMAScript 6. By default, this support is off. You c
210210

211211
ESLint doesn't natively support experimental ECMAScript language features. You can use [babel-eslint](https://github.com/babel/babel-eslint) to use any option available in Babel.
212212

213-
Once a language feature has been adopted into the ECMAScript standard, we will accept
214-
issues and pull requests related to the new feature, subject to our [contributing
215-
guidelines](http://eslint.org/docs/developer-guide/contributing). Until then, please use
216-
the appropriate parser and plugin(s) for your experimental feature.
213+
Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](http://eslint.org/docs/developer-guide/contributing). Until then, please use the appropriate parser and plugin(s) for your experimental feature.
217214

218215
### Where to ask for help?
219216

tools/eslint/bin/eslint.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @author Nicholas C. Zakas
66
*/
77

8-
/* eslint no-console:off, no-process-exit:off */
8+
/* eslint no-console:off */
99

1010
"use strict";
1111

@@ -36,7 +36,7 @@ const concat = require("concat-stream"),
3636
// Execution
3737
//------------------------------------------------------------------------------
3838

39-
process.on("uncaughtException", function(err) {
39+
process.once("uncaughtException", err => {
4040

4141
// lazy load
4242
const lodash = require("lodash");
@@ -51,17 +51,17 @@ process.on("uncaughtException", function(err) {
5151
console.log(err.stack);
5252
}
5353

54-
process.exit(1);
54+
process.exitCode = 1;
5555
});
5656

5757
if (useStdIn) {
58-
process.stdin.pipe(concat({ encoding: "string" }, function(text) {
58+
process.stdin.pipe(concat({ encoding: "string" }, text => {
5959
process.exitCode = cli.execute(process.argv, text);
6060
}));
6161
} else if (init) {
6262
const configInit = require("../lib/config/config-initializer");
6363

64-
configInit.initializeConfig(function(err) {
64+
configInit.initializeConfig(err => {
6565
if (err) {
6666
process.exitCode = 1;
6767
console.error(err.message);

tools/eslint/conf/eslint.json

+10-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"rules": {
55
"no-alert": "off",
66
"no-array-constructor": "off",
7+
"no-await-in-loop": "off",
78
"no-bitwise": "off",
89
"no-caller": "off",
910
"no-case-declarations": "error",
@@ -41,7 +42,7 @@
4142
"no-fallthrough": "error",
4243
"no-floating-decimal": "off",
4344
"no-func-assign": "error",
44-
"no-global-assign": "off",
45+
"no-global-assign": "error",
4546
"no-implicit-coercion": "off",
4647
"no-implicit-globals": "off",
4748
"no-implied-eval": "off",
@@ -63,9 +64,9 @@
6364
"no-multi-spaces": "off",
6465
"no-multi-str": "off",
6566
"no-multiple-empty-lines": "off",
66-
"no-native-reassign": "error",
67+
"no-native-reassign": "off",
6768
"no-negated-condition": "off",
68-
"no-negated-in-lhs": "error",
69+
"no-negated-in-lhs": "off",
6970
"no-nested-ternary": "off",
7071
"no-new": "off",
7172
"no-new-func": "off",
@@ -91,6 +92,7 @@
9192
"no-restricted-properties": "off",
9293
"no-restricted-syntax": "off",
9394
"no-return-assign": "off",
95+
"no-return-await": "off",
9496
"no-script-url": "off",
9597
"no-self-assign": "error",
9698
"no-self-compare": "off",
@@ -115,7 +117,7 @@
115117
"no-unneeded-ternary": "off",
116118
"no-unreachable": "error",
117119
"no-unsafe-finally": "error",
118-
"no-unsafe-negation": "off",
120+
"no-unsafe-negation": "error",
119121
"no-unused-expressions": "off",
120122
"no-unused-labels": "error",
121123
"no-unused-vars": "error",
@@ -126,6 +128,7 @@
126128
"no-useless-constructor": "off",
127129
"no-useless-escape": "off",
128130
"no-useless-rename": "off",
131+
"no-useless-return": "off",
129132
"no-void": "off",
130133
"no-var": "off",
131134
"no-warning-comments": "off",
@@ -141,6 +144,7 @@
141144
"brace-style": "off",
142145
"callback-return": "off",
143146
"camelcase": "off",
147+
"capitalized-comments": "off",
144148
"class-methods-use-this": "off",
145149
"comma-dangle": "off",
146150
"comma-spacing": "off",
@@ -200,6 +204,7 @@
200204
"padded-blocks": "off",
201205
"prefer-arrow-callback": "off",
202206
"prefer-const": "off",
207+
"prefer-destructuring": "off",
203208
"prefer-numeric-literals": "off",
204209
"prefer-reflect": "off",
205210
"prefer-rest-params": "off",
@@ -208,6 +213,7 @@
208213
"quote-props": "off",
209214
"quotes": "off",
210215
"radix": "off",
216+
"require-await": "off",
211217
"require-jsdoc": "off",
212218
"require-yield": "error",
213219
"rest-spread-spacing": "off",

0 commit comments

Comments
 (0)