Skip to content

Commit

Permalink
tools: update ESLint to current version
Browse files Browse the repository at this point in the history
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 <teddy.katz@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
  • Loading branch information
Trott authored and italoacasas committed Jan 30, 2017
1 parent 1438d00 commit dd5a4e1
Show file tree
Hide file tree
Showing 722 changed files with 20,993 additions and 11,049 deletions.
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ rules:
eol-last: 2
func-call-spacing: 2
func-name-matching: 2
indent: [2, 2, {SwitchCase: 1, MemberExpression: 1}]
indent: [2, 2, {ArrayExpression: first,
CallExpression: {arguments: first},
MemberExpression: 1,
ObjectExpression: first,
SwitchCase: 1}]
key-spacing: [2, {mode: minimum}]
keyword-spacing: 2
linebreak-style: [2, unix]
Expand Down
2 changes: 1 addition & 1 deletion tools/eslint/LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ESLint
Copyright jQuery Foundation and other contributors, https://jquery.org/
Copyright JS Foundation and other contributors, https://js.foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 2 additions & 5 deletions tools/eslint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[Rules](http://eslint.org/docs/rules/) |
[Contributing](http://eslint.org/docs/developer-guide/contributing) |
[Reporting Bugs](http://eslint.org/docs/developer-guide/contributing/reporting-bugs) |
[Code of Conduct](https://jquery.org/conduct/) |
[Code of Conduct](https://js.foundation/conduct/) |
[Twitter](https://twitter.com/geteslint) |
[Mailing List](https://groups.google.com/group/eslint) |
[Chat Room](https://gitter.im/eslint/eslint)
Expand Down Expand Up @@ -210,10 +210,7 @@ ESLint has full support for ECMAScript 6. By default, this support is off. You c

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.

Once a language feature has been adopted into the ECMAScript standard, 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.
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.

### Where to ask for help?

Expand Down
10 changes: 5 additions & 5 deletions tools/eslint/bin/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Nicholas C. Zakas
*/

/* eslint no-console:off, no-process-exit:off */
/* eslint no-console:off */

"use strict";

Expand Down Expand Up @@ -36,7 +36,7 @@ const concat = require("concat-stream"),
// Execution
//------------------------------------------------------------------------------

process.on("uncaughtException", function(err) {
process.once("uncaughtException", err => {

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

process.exit(1);
process.exitCode = 1;
});

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

configInit.initializeConfig(function(err) {
configInit.initializeConfig(err => {
if (err) {
process.exitCode = 1;
console.error(err.message);
Expand Down
14 changes: 10 additions & 4 deletions tools/eslint/conf/eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"rules": {
"no-alert": "off",
"no-array-constructor": "off",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-caller": "off",
"no-case-declarations": "error",
Expand Down Expand Up @@ -41,7 +42,7 @@
"no-fallthrough": "error",
"no-floating-decimal": "off",
"no-func-assign": "error",
"no-global-assign": "off",
"no-global-assign": "error",
"no-implicit-coercion": "off",
"no-implicit-globals": "off",
"no-implied-eval": "off",
Expand All @@ -63,9 +64,9 @@
"no-multi-spaces": "off",
"no-multi-str": "off",
"no-multiple-empty-lines": "off",
"no-native-reassign": "error",
"no-native-reassign": "off",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-negated-in-lhs": "off",
"no-nested-ternary": "off",
"no-new": "off",
"no-new-func": "off",
Expand All @@ -91,6 +92,7 @@
"no-restricted-properties": "off",
"no-restricted-syntax": "off",
"no-return-assign": "off",
"no-return-await": "off",
"no-script-url": "off",
"no-self-assign": "error",
"no-self-compare": "off",
Expand All @@ -115,7 +117,7 @@
"no-unneeded-ternary": "off",
"no-unreachable": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "off",
"no-unsafe-negation": "error",
"no-unused-expressions": "off",
"no-unused-labels": "error",
"no-unused-vars": "error",
Expand All @@ -126,6 +128,7 @@
"no-useless-constructor": "off",
"no-useless-escape": "off",
"no-useless-rename": "off",
"no-useless-return": "off",
"no-void": "off",
"no-var": "off",
"no-warning-comments": "off",
Expand All @@ -141,6 +144,7 @@
"brace-style": "off",
"callback-return": "off",
"camelcase": "off",
"capitalized-comments": "off",
"class-methods-use-this": "off",
"comma-dangle": "off",
"comma-spacing": "off",
Expand Down Expand Up @@ -200,6 +204,7 @@
"padded-blocks": "off",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "off",
"prefer-numeric-literals": "off",
"prefer-reflect": "off",
"prefer-rest-params": "off",
Expand All @@ -208,6 +213,7 @@
"quote-props": "off",
"quotes": "off",
"radix": "off",
"require-await": "off",
"require-jsdoc": "off",
"require-yield": "error",
"rest-spread-spacing": "off",
Expand Down
Loading

0 comments on commit dd5a4e1

Please sign in to comment.