eslint 4.12.1 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +3 -3
- package/lib/cli-engine.js +4 -0
- package/lib/linter.js +78 -35
- package/lib/options.js +47 -41
- package/lib/report-translator.js +34 -13
- package/lib/rules/.eslintrc.yml +1 -0
- package/lib/rules/accessor-pairs.js +2 -1
- package/lib/rules/array-bracket-newline.js +2 -1
- package/lib/rules/array-bracket-spacing.js +2 -1
- package/lib/rules/array-callback-return.js +18 -3
- package/lib/rules/array-element-newline.js +2 -1
- package/lib/rules/arrow-body-style.js +15 -2
- package/lib/rules/arrow-parens.js +2 -1
- package/lib/rules/arrow-spacing.js +2 -1
- package/lib/rules/block-scoped-var.js +2 -1
- package/lib/rules/block-spacing.js +2 -1
- package/lib/rules/brace-style.js +2 -1
- package/lib/rules/callback-return.js +2 -1
- package/lib/rules/camelcase.js +29 -17
- package/lib/rules/capitalized-comments.js +2 -1
- package/lib/rules/class-methods-use-this.js +2 -1
- package/lib/rules/comma-dangle.js +2 -1
- package/lib/rules/comma-spacing.js +2 -1
- package/lib/rules/comma-style.js +2 -1
- package/lib/rules/complexity.js +3 -16
- package/lib/rules/computed-property-spacing.js +2 -1
- package/lib/rules/consistent-return.js +2 -1
- package/lib/rules/consistent-this.js +2 -1
- package/lib/rules/constructor-super.js +2 -1
- package/lib/rules/curly.js +2 -1
- package/lib/rules/default-case.js +2 -1
- package/lib/rules/dot-location.js +2 -1
- package/lib/rules/dot-notation.js +2 -1
- package/lib/rules/eol-last.js +10 -1
- package/lib/rules/eqeqeq.js +2 -1
- package/lib/rules/for-direction.js +2 -1
- package/lib/rules/func-call-spacing.js +2 -1
- package/lib/rules/func-name-matching.js +2 -1
- package/lib/rules/func-names.js +2 -1
- package/lib/rules/func-style.js +2 -1
- package/lib/rules/function-paren-newline.js +2 -1
- package/lib/rules/generator-star-spacing.js +2 -1
- package/lib/rules/getter-return.js +2 -1
- package/lib/rules/global-require.js +2 -1
- package/lib/rules/guard-for-in.js +2 -1
- package/lib/rules/handle-callback-err.js +2 -1
- package/lib/rules/id-blacklist.js +2 -1
- package/lib/rules/id-length.js +2 -1
- package/lib/rules/id-match.js +2 -1
- package/lib/rules/implicit-arrow-linebreak.js +2 -1
- package/lib/rules/indent-legacy.js +2 -1
- package/lib/rules/indent.js +13 -2
- package/lib/rules/init-declarations.js +2 -1
- package/lib/rules/jsx-quotes.js +2 -1
- package/lib/rules/key-spacing.js +2 -1
- package/lib/rules/keyword-spacing.js +2 -1
- package/lib/rules/line-comment-position.js +2 -1
- package/lib/rules/linebreak-style.js +2 -1
- package/lib/rules/lines-around-comment.js +2 -1
- package/lib/rules/lines-around-directive.js +2 -1
- package/lib/rules/lines-between-class-members.js +53 -4
- package/lib/rules/max-depth.js +2 -1
- package/lib/rules/max-len.js +2 -1
- package/lib/rules/max-lines.js +2 -1
- package/lib/rules/max-nested-callbacks.js +2 -1
- package/lib/rules/max-params.js +2 -1
- package/lib/rules/max-statements-per-line.js +2 -1
- package/lib/rules/max-statements.js +2 -1
- package/lib/rules/multiline-comment-style.js +2 -1
- package/lib/rules/multiline-ternary.js +2 -1
- package/lib/rules/new-cap.js +2 -1
- package/lib/rules/new-parens.js +2 -1
- package/lib/rules/newline-after-var.js +2 -1
- package/lib/rules/newline-before-return.js +2 -1
- package/lib/rules/newline-per-chained-call.js +2 -1
- package/lib/rules/no-alert.js +2 -1
- package/lib/rules/no-array-constructor.js +2 -1
- package/lib/rules/no-await-in-loop.js +2 -1
- package/lib/rules/no-bitwise.js +2 -1
- package/lib/rules/no-buffer-constructor.js +2 -1
- package/lib/rules/no-caller.js +2 -1
- package/lib/rules/no-case-declarations.js +2 -1
- package/lib/rules/no-catch-shadow.js +2 -1
- package/lib/rules/no-class-assign.js +2 -1
- package/lib/rules/no-compare-neg-zero.js +2 -1
- package/lib/rules/no-cond-assign.js +2 -1
- package/lib/rules/no-confusing-arrow.js +2 -1
- package/lib/rules/no-console.js +2 -1
- package/lib/rules/no-const-assign.js +2 -1
- package/lib/rules/no-constant-condition.js +2 -1
- package/lib/rules/no-continue.js +2 -1
- package/lib/rules/no-control-regex.js +2 -1
- package/lib/rules/no-debugger.js +2 -1
- package/lib/rules/no-delete-var.js +2 -1
- package/lib/rules/no-div-regex.js +2 -1
- package/lib/rules/no-dupe-args.js +2 -1
- package/lib/rules/no-dupe-class-members.js +2 -1
- package/lib/rules/no-dupe-keys.js +2 -1
- package/lib/rules/no-duplicate-case.js +2 -1
- package/lib/rules/no-duplicate-imports.js +2 -1
- package/lib/rules/no-else-return.js +2 -1
- package/lib/rules/no-empty-character-class.js +2 -1
- package/lib/rules/no-empty-function.js +2 -1
- package/lib/rules/no-empty-pattern.js +2 -1
- package/lib/rules/no-empty.js +2 -1
- package/lib/rules/no-eq-null.js +2 -1
- package/lib/rules/no-eval.js +2 -1
- package/lib/rules/no-ex-assign.js +2 -1
- package/lib/rules/no-extend-native.js +2 -1
- package/lib/rules/no-extra-bind.js +2 -1
- package/lib/rules/no-extra-boolean-cast.js +2 -1
- package/lib/rules/no-extra-label.js +2 -1
- package/lib/rules/no-extra-parens.js +3 -2
- package/lib/rules/no-extra-semi.js +2 -1
- package/lib/rules/no-fallthrough.js +2 -1
- package/lib/rules/no-floating-decimal.js +2 -1
- package/lib/rules/no-func-assign.js +2 -1
- package/lib/rules/no-global-assign.js +2 -1
- package/lib/rules/no-implicit-coercion.js +2 -1
- package/lib/rules/no-implicit-globals.js +2 -1
- package/lib/rules/no-implied-eval.js +2 -1
- package/lib/rules/no-inline-comments.js +2 -1
- package/lib/rules/no-inner-declarations.js +2 -1
- package/lib/rules/no-invalid-regexp.js +2 -1
- package/lib/rules/no-invalid-this.js +2 -1
- package/lib/rules/no-irregular-whitespace.js +2 -1
- package/lib/rules/no-iterator.js +2 -1
- package/lib/rules/no-label-var.js +2 -1
- package/lib/rules/no-labels.js +2 -1
- package/lib/rules/no-lone-blocks.js +2 -1
- package/lib/rules/no-lonely-if.js +2 -1
- package/lib/rules/no-loop-func.js +2 -1
- package/lib/rules/no-magic-numbers.js +2 -1
- package/lib/rules/no-mixed-operators.js +2 -1
- package/lib/rules/no-mixed-requires.js +2 -1
- package/lib/rules/no-mixed-spaces-and-tabs.js +2 -1
- package/lib/rules/no-multi-assign.js +2 -1
- package/lib/rules/no-multi-spaces.js +2 -1
- package/lib/rules/no-multi-str.js +2 -1
- package/lib/rules/no-multiple-empty-lines.js +2 -1
- package/lib/rules/no-native-reassign.js +2 -1
- package/lib/rules/no-negated-condition.js +2 -1
- package/lib/rules/no-negated-in-lhs.js +2 -1
- package/lib/rules/no-nested-ternary.js +2 -1
- package/lib/rules/no-new-func.js +2 -1
- package/lib/rules/no-new-object.js +2 -1
- package/lib/rules/no-new-require.js +2 -1
- package/lib/rules/no-new-symbol.js +2 -1
- package/lib/rules/no-new-wrappers.js +2 -1
- package/lib/rules/no-new.js +2 -1
- package/lib/rules/no-obj-calls.js +2 -1
- package/lib/rules/no-octal-escape.js +2 -1
- package/lib/rules/no-octal.js +2 -1
- package/lib/rules/no-param-reassign.js +2 -1
- package/lib/rules/no-path-concat.js +2 -1
- package/lib/rules/no-plusplus.js +2 -1
- package/lib/rules/no-process-env.js +2 -1
- package/lib/rules/no-process-exit.js +2 -1
- package/lib/rules/no-proto.js +2 -1
- package/lib/rules/no-prototype-builtins.js +2 -1
- package/lib/rules/no-redeclare.js +2 -1
- package/lib/rules/no-regex-spaces.js +2 -1
- package/lib/rules/no-restricted-globals.js +2 -1
- package/lib/rules/no-restricted-imports.js +2 -1
- package/lib/rules/no-restricted-modules.js +2 -1
- package/lib/rules/no-restricted-properties.js +2 -1
- package/lib/rules/no-restricted-syntax.js +2 -1
- package/lib/rules/no-return-assign.js +2 -1
- package/lib/rules/no-return-await.js +5 -1
- package/lib/rules/no-script-url.js +2 -1
- package/lib/rules/no-self-assign.js +2 -1
- package/lib/rules/no-self-compare.js +2 -1
- package/lib/rules/no-sequences.js +2 -1
- package/lib/rules/no-shadow-restricted-names.js +2 -1
- package/lib/rules/no-shadow.js +2 -1
- package/lib/rules/no-spaced-func.js +2 -1
- package/lib/rules/no-sparse-arrays.js +2 -1
- package/lib/rules/no-sync.js +2 -1
- package/lib/rules/no-tabs.js +2 -1
- package/lib/rules/no-template-curly-in-string.js +2 -1
- package/lib/rules/no-ternary.js +2 -1
- package/lib/rules/no-this-before-super.js +2 -1
- package/lib/rules/no-throw-literal.js +2 -1
- package/lib/rules/no-trailing-spaces.js +2 -1
- package/lib/rules/no-undef-init.js +2 -1
- package/lib/rules/no-undef.js +2 -1
- package/lib/rules/no-undefined.js +2 -1
- package/lib/rules/no-underscore-dangle.js +2 -1
- package/lib/rules/no-unexpected-multiline.js +2 -1
- package/lib/rules/no-unmodified-loop-condition.js +81 -79
- package/lib/rules/no-unneeded-ternary.js +2 -1
- package/lib/rules/no-unreachable.js +2 -1
- package/lib/rules/no-unsafe-finally.js +2 -1
- package/lib/rules/no-unsafe-negation.js +2 -1
- package/lib/rules/no-unused-expressions.js +2 -1
- package/lib/rules/no-unused-labels.js +2 -1
- package/lib/rules/no-unused-vars.js +10 -14
- package/lib/rules/no-use-before-define.js +2 -1
- package/lib/rules/no-useless-call.js +2 -1
- package/lib/rules/no-useless-computed-key.js +2 -1
- package/lib/rules/no-useless-concat.js +2 -1
- package/lib/rules/no-useless-constructor.js +2 -1
- package/lib/rules/no-useless-escape.js +2 -1
- package/lib/rules/no-useless-rename.js +2 -1
- package/lib/rules/no-useless-return.js +2 -1
- package/lib/rules/no-var.js +2 -1
- package/lib/rules/no-void.js +2 -1
- package/lib/rules/no-warning-comments.js +2 -1
- package/lib/rules/no-whitespace-before-property.js +2 -1
- package/lib/rules/no-with.js +2 -1
- package/lib/rules/nonblock-statement-body-position.js +2 -1
- package/lib/rules/object-curly-newline.js +2 -1
- package/lib/rules/object-curly-spacing.js +2 -1
- package/lib/rules/object-property-newline.js +2 -1
- package/lib/rules/object-shorthand.js +2 -1
- package/lib/rules/one-var-declaration-per-line.js +2 -1
- package/lib/rules/one-var.js +42 -8
- package/lib/rules/operator-assignment.js +2 -1
- package/lib/rules/operator-linebreak.js +2 -1
- package/lib/rules/padded-blocks.js +2 -1
- package/lib/rules/padding-line-between-statements.js +2 -1
- package/lib/rules/prefer-arrow-callback.js +2 -1
- package/lib/rules/prefer-const.js +2 -1
- package/lib/rules/prefer-destructuring.js +2 -1
- package/lib/rules/prefer-numeric-literals.js +2 -1
- package/lib/rules/prefer-promise-reject-errors.js +2 -1
- package/lib/rules/prefer-reflect.js +2 -1
- package/lib/rules/prefer-rest-params.js +2 -1
- package/lib/rules/prefer-spread.js +2 -1
- package/lib/rules/prefer-template.js +2 -1
- package/lib/rules/quote-props.js +2 -1
- package/lib/rules/quotes.js +2 -1
- package/lib/rules/radix.js +2 -1
- package/lib/rules/require-await.js +2 -1
- package/lib/rules/require-jsdoc.js +2 -1
- package/lib/rules/require-yield.js +2 -1
- package/lib/rules/rest-spread-spacing.js +2 -1
- package/lib/rules/semi-spacing.js +2 -1
- package/lib/rules/semi-style.js +2 -1
- package/lib/rules/semi.js +2 -1
- package/lib/rules/sort-imports.js +2 -1
- package/lib/rules/sort-keys.js +2 -1
- package/lib/rules/sort-vars.js +2 -1
- package/lib/rules/space-before-blocks.js +2 -1
- package/lib/rules/space-before-function-paren.js +2 -1
- package/lib/rules/space-in-parens.js +2 -1
- package/lib/rules/space-infix-ops.js +2 -1
- package/lib/rules/space-unary-ops.js +2 -1
- package/lib/rules/spaced-comment.js +2 -1
- package/lib/rules/strict.js +2 -1
- package/lib/rules/switch-colon-spacing.js +2 -1
- package/lib/rules/symbol-description.js +2 -1
- package/lib/rules/template-curly-spacing.js +2 -1
- package/lib/rules/template-tag-spacing.js +2 -1
- package/lib/rules/unicode-bom.js +2 -1
- package/lib/rules/use-isnan.js +2 -1
- package/lib/rules/valid-jsdoc.js +2 -1
- package/lib/rules/valid-typeof.js +2 -1
- package/lib/rules/vars-on-top.js +2 -1
- package/lib/rules/wrap-iife.js +2 -1
- package/lib/rules/wrap-regex.js +2 -1
- package/lib/rules/yield-star-spacing.js +2 -1
- package/lib/rules/yoda.js +2 -1
- package/lib/testers/rule-tester.js +63 -30
- package/lib/util/interpolate.js +24 -0
- package/lib/util/source-code.js +41 -6
- package/lib/util/traverser.js +163 -15
- package/package.json +3 -3
@@ -76,7 +76,8 @@ module.exports = {
|
|
76
76
|
docs: {
|
77
77
|
description: "disallow redundant return statements",
|
78
78
|
category: "Best Practices",
|
79
|
-
recommended: false
|
79
|
+
recommended: false,
|
80
|
+
url: "https://eslint.org/docs/rules/no-useless-return"
|
80
81
|
},
|
81
82
|
fixable: "code",
|
82
83
|
schema: []
|
package/lib/rules/no-var.js
CHANGED
package/lib/rules/no-void.js
CHANGED
@@ -19,7 +19,8 @@ module.exports = {
|
|
19
19
|
docs: {
|
20
20
|
description: "disallow whitespace before properties",
|
21
21
|
category: "Stylistic Issues",
|
22
|
-
recommended: false
|
22
|
+
recommended: false,
|
23
|
+
url: "https://eslint.org/docs/rules/no-whitespace-before-property"
|
23
24
|
},
|
24
25
|
|
25
26
|
fixable: "whitespace",
|
package/lib/rules/no-with.js
CHANGED
@@ -15,7 +15,8 @@ module.exports = {
|
|
15
15
|
docs: {
|
16
16
|
description: "enforce the location of single-line statements",
|
17
17
|
category: "Stylistic Issues",
|
18
|
-
recommended: false
|
18
|
+
recommended: false,
|
19
|
+
url: "https://eslint.org/docs/rules/nonblock-statement-body-position"
|
19
20
|
},
|
20
21
|
fixable: "whitespace",
|
21
22
|
schema: [
|
@@ -97,7 +97,8 @@ module.exports = {
|
|
97
97
|
docs: {
|
98
98
|
description: "enforce consistent line breaks inside braces",
|
99
99
|
category: "Stylistic Issues",
|
100
|
-
recommended: false
|
100
|
+
recommended: false,
|
101
|
+
url: "https://eslint.org/docs/rules/object-curly-newline"
|
101
102
|
},
|
102
103
|
fixable: "whitespace",
|
103
104
|
schema: [
|
@@ -15,7 +15,8 @@ module.exports = {
|
|
15
15
|
docs: {
|
16
16
|
description: "enforce consistent spacing inside braces",
|
17
17
|
category: "Stylistic Issues",
|
18
|
-
recommended: false
|
18
|
+
recommended: false,
|
19
|
+
url: "https://eslint.org/docs/rules/object-curly-spacing"
|
19
20
|
},
|
20
21
|
|
21
22
|
fixable: "whitespace",
|
@@ -14,7 +14,8 @@ module.exports = {
|
|
14
14
|
docs: {
|
15
15
|
description: "enforce placing object properties on separate lines",
|
16
16
|
category: "Stylistic Issues",
|
17
|
-
recommended: false
|
17
|
+
recommended: false,
|
18
|
+
url: "https://eslint.org/docs/rules/object-property-newline"
|
18
19
|
},
|
19
20
|
|
20
21
|
schema: [
|
@@ -27,7 +27,8 @@ module.exports = {
|
|
27
27
|
docs: {
|
28
28
|
description: "require or disallow method and property shorthand syntax for object literals",
|
29
29
|
category: "ECMAScript 6",
|
30
|
-
recommended: false
|
30
|
+
recommended: false,
|
31
|
+
url: "https://eslint.org/docs/rules/object-shorthand"
|
31
32
|
},
|
32
33
|
|
33
34
|
fixable: "code",
|
@@ -13,7 +13,8 @@ module.exports = {
|
|
13
13
|
docs: {
|
14
14
|
description: "require or disallow newlines around variable declarations",
|
15
15
|
category: "Stylistic Issues",
|
16
|
-
recommended: false
|
16
|
+
recommended: false,
|
17
|
+
url: "https://eslint.org/docs/rules/one-var-declaration-per-line"
|
17
18
|
},
|
18
19
|
|
19
20
|
schema: [
|
package/lib/rules/one-var.js
CHANGED
@@ -14,7 +14,8 @@ module.exports = {
|
|
14
14
|
docs: {
|
15
15
|
description: "enforce variables to be declared either together or separately in functions",
|
16
16
|
category: "Stylistic Issues",
|
17
|
-
recommended: false
|
17
|
+
recommended: false,
|
18
|
+
url: "https://eslint.org/docs/rules/one-var"
|
18
19
|
},
|
19
20
|
|
20
21
|
schema: [
|
@@ -26,6 +27,9 @@ module.exports = {
|
|
26
27
|
{
|
27
28
|
type: "object",
|
28
29
|
properties: {
|
30
|
+
separateRequires: {
|
31
|
+
type: "boolean"
|
32
|
+
},
|
29
33
|
var: {
|
30
34
|
enum: ["always", "never"]
|
31
35
|
},
|
@@ -62,21 +66,23 @@ module.exports = {
|
|
62
66
|
|
63
67
|
const mode = context.options[0] || MODE_ALWAYS;
|
64
68
|
|
65
|
-
const options = {
|
66
|
-
};
|
69
|
+
const options = {};
|
67
70
|
|
68
71
|
if (typeof mode === "string") { // simple options configuration with just a string
|
69
72
|
options.var = { uninitialized: mode, initialized: mode };
|
70
73
|
options.let = { uninitialized: mode, initialized: mode };
|
71
74
|
options.const = { uninitialized: mode, initialized: mode };
|
72
75
|
} else if (typeof mode === "object") { // options configuration is an object
|
73
|
-
if (mode.hasOwnProperty("
|
76
|
+
if (mode.hasOwnProperty("separateRequires")) {
|
77
|
+
options.separateRequires = !!mode.separateRequires;
|
78
|
+
}
|
79
|
+
if (mode.hasOwnProperty("var")) {
|
74
80
|
options.var = { uninitialized: mode.var, initialized: mode.var };
|
75
81
|
}
|
76
|
-
if (mode.hasOwnProperty("let")
|
82
|
+
if (mode.hasOwnProperty("let")) {
|
77
83
|
options.let = { uninitialized: mode.let, initialized: mode.let };
|
78
84
|
}
|
79
|
-
if (mode.hasOwnProperty("const")
|
85
|
+
if (mode.hasOwnProperty("const")) {
|
80
86
|
options.const = { uninitialized: mode.const, initialized: mode.const };
|
81
87
|
}
|
82
88
|
if (mode.hasOwnProperty("uninitialized")) {
|
@@ -158,7 +164,17 @@ module.exports = {
|
|
158
164
|
}
|
159
165
|
|
160
166
|
/**
|
161
|
-
*
|
167
|
+
* Check if a variable declaration is a require.
|
168
|
+
* @param {ASTNode} decl variable declaration Node
|
169
|
+
* @returns {bool} if decl is a require, return true; else return false.
|
170
|
+
* @private
|
171
|
+
*/
|
172
|
+
function isRequire(decl) {
|
173
|
+
return decl.init && decl.init.type === "CallExpression" && decl.init.callee.name === "require";
|
174
|
+
}
|
175
|
+
|
176
|
+
/**
|
177
|
+
* Records whether initialized/uninitialized/required variables are defined in current scope.
|
162
178
|
* @param {string} statementType node.kind, one of: "var", "let", or "const"
|
163
179
|
* @param {ASTNode[]} declarations List of declarations
|
164
180
|
* @param {Object} currentScope The scope being investigated
|
@@ -173,7 +189,11 @@ module.exports = {
|
|
173
189
|
}
|
174
190
|
} else {
|
175
191
|
if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) {
|
176
|
-
|
192
|
+
if (options.separateRequires && isRequire(declarations[i])) {
|
193
|
+
currentScope.required = true;
|
194
|
+
} else {
|
195
|
+
currentScope.initialized = true;
|
196
|
+
}
|
177
197
|
}
|
178
198
|
}
|
179
199
|
}
|
@@ -228,6 +248,7 @@ module.exports = {
|
|
228
248
|
const declarationCounts = countDeclarations(declarations);
|
229
249
|
const currentOptions = options[statementType] || {};
|
230
250
|
const currentScope = getCurrentScope(statementType);
|
251
|
+
const hasRequires = declarations.some(isRequire);
|
231
252
|
|
232
253
|
if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) {
|
233
254
|
if (currentScope.uninitialized || currentScope.initialized) {
|
@@ -245,6 +266,9 @@ module.exports = {
|
|
245
266
|
return false;
|
246
267
|
}
|
247
268
|
}
|
269
|
+
if (currentScope.required && hasRequires) {
|
270
|
+
return false;
|
271
|
+
}
|
248
272
|
recordTypes(statementType, declarations, currentScope);
|
249
273
|
return true;
|
250
274
|
}
|
@@ -275,6 +299,16 @@ module.exports = {
|
|
275
299
|
|
276
300
|
const declarations = node.declarations;
|
277
301
|
const declarationCounts = countDeclarations(declarations);
|
302
|
+
const mixedRequires = declarations.some(isRequire) && !declarations.every(isRequire);
|
303
|
+
|
304
|
+
if (options[type].initialized === MODE_ALWAYS) {
|
305
|
+
if (options.separateRequires && mixedRequires) {
|
306
|
+
context.report({
|
307
|
+
node,
|
308
|
+
message: "Split requires to be separated into a single block."
|
309
|
+
});
|
310
|
+
}
|
311
|
+
}
|
278
312
|
|
279
313
|
// always
|
280
314
|
if (!hasOnlyOneStatement(type, declarations)) {
|
@@ -92,7 +92,8 @@ module.exports = {
|
|
92
92
|
docs: {
|
93
93
|
description: "require or disallow assignment operator shorthand where possible",
|
94
94
|
category: "Stylistic Issues",
|
95
|
-
recommended: false
|
95
|
+
recommended: false,
|
96
|
+
url: "https://eslint.org/docs/rules/operator-assignment"
|
96
97
|
},
|
97
98
|
|
98
99
|
schema: [
|
@@ -394,7 +394,8 @@ module.exports = {
|
|
394
394
|
docs: {
|
395
395
|
description: "require or disallow padding lines between statements",
|
396
396
|
category: "Stylistic Issues",
|
397
|
-
recommended: false
|
397
|
+
recommended: false,
|
398
|
+
url: "https://eslint.org/docs/rules/padding-line-between-statements"
|
398
399
|
},
|
399
400
|
fixable: "whitespace",
|
400
401
|
schema: {
|
@@ -134,7 +134,8 @@ module.exports = {
|
|
134
134
|
docs: {
|
135
135
|
description: "require using arrow functions for callbacks",
|
136
136
|
category: "ECMAScript 6",
|
137
|
-
recommended: false
|
137
|
+
recommended: false,
|
138
|
+
url: "https://eslint.org/docs/rules/prefer-arrow-callback"
|
138
139
|
},
|
139
140
|
|
140
141
|
schema: [
|
@@ -233,7 +233,8 @@ module.exports = {
|
|
233
233
|
docs: {
|
234
234
|
description: "require `const` declarations for variables that are never reassigned after declared",
|
235
235
|
category: "ECMAScript 6",
|
236
|
-
recommended: false
|
236
|
+
recommended: false,
|
237
|
+
url: "https://eslint.org/docs/rules/prefer-const"
|
237
238
|
},
|
238
239
|
|
239
240
|
fixable: "code",
|
@@ -41,7 +41,8 @@ module.exports = {
|
|
41
41
|
docs: {
|
42
42
|
description: "disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
|
43
43
|
category: "ECMAScript 6",
|
44
|
-
recommended: false
|
44
|
+
recommended: false,
|
45
|
+
url: "https://eslint.org/docs/rules/prefer-numeric-literals"
|
45
46
|
},
|
46
47
|
|
47
48
|
schema: [],
|
@@ -15,7 +15,8 @@ module.exports = {
|
|
15
15
|
docs: {
|
16
16
|
description: "require using Error objects as Promise rejection reasons",
|
17
17
|
category: "Best Practices",
|
18
|
-
recommended: false
|
18
|
+
recommended: false,
|
19
|
+
url: "https://eslint.org/docs/rules/prefer-promise-reject-errors"
|
19
20
|
},
|
20
21
|
fixable: null,
|
21
22
|
schema: [
|
@@ -103,7 +103,8 @@ module.exports = {
|
|
103
103
|
docs: {
|
104
104
|
description: "require template literals instead of string concatenation",
|
105
105
|
category: "ECMAScript 6",
|
106
|
-
recommended: false
|
106
|
+
recommended: false,
|
107
|
+
url: "https://eslint.org/docs/rules/prefer-template"
|
107
108
|
},
|
108
109
|
|
109
110
|
schema: [],
|
package/lib/rules/quote-props.js
CHANGED
package/lib/rules/quotes.js
CHANGED
@@ -79,7 +79,8 @@ module.exports = {
|
|
79
79
|
docs: {
|
80
80
|
description: "enforce the consistent use of either backticks, double, or single quotes",
|
81
81
|
category: "Stylistic Issues",
|
82
|
-
recommended: false
|
82
|
+
recommended: false,
|
83
|
+
url: "https://eslint.org/docs/rules/quotes"
|
83
84
|
},
|
84
85
|
|
85
86
|
fixable: "code",
|
package/lib/rules/radix.js
CHANGED
@@ -81,7 +81,8 @@ module.exports = {
|
|
81
81
|
docs: {
|
82
82
|
description: "enforce the consistent use of the radix argument when using `parseInt()`",
|
83
83
|
category: "Best Practices",
|
84
|
-
recommended: false
|
84
|
+
recommended: false,
|
85
|
+
url: "https://eslint.org/docs/rules/radix"
|
85
86
|
},
|
86
87
|
|
87
88
|
schema: [
|
@@ -34,7 +34,8 @@ module.exports = {
|
|
34
34
|
docs: {
|
35
35
|
description: "disallow async functions which have no `await` expression",
|
36
36
|
category: "Best Practices",
|
37
|
-
recommended: false
|
37
|
+
recommended: false,
|
38
|
+
url: "https://eslint.org/docs/rules/require-await"
|
38
39
|
},
|
39
40
|
schema: []
|
40
41
|
},
|
@@ -14,7 +14,8 @@ module.exports = {
|
|
14
14
|
docs: {
|
15
15
|
description: "enforce spacing between rest and spread operators and their expressions",
|
16
16
|
category: "ECMAScript 6",
|
17
|
-
recommended: false
|
17
|
+
recommended: false,
|
18
|
+
url: "https://eslint.org/docs/rules/rest-spread-spacing"
|
18
19
|
},
|
19
20
|
fixable: "whitespace",
|
20
21
|
schema: [
|
@@ -16,7 +16,8 @@ module.exports = {
|
|
16
16
|
docs: {
|
17
17
|
description: "enforce consistent spacing before and after semicolons",
|
18
18
|
category: "Stylistic Issues",
|
19
|
-
recommended: false
|
19
|
+
recommended: false,
|
20
|
+
url: "https://eslint.org/docs/rules/semi-spacing"
|
20
21
|
},
|
21
22
|
|
22
23
|
fixable: "whitespace",
|
package/lib/rules/semi-style.js
CHANGED
@@ -68,7 +68,8 @@ module.exports = {
|
|
68
68
|
docs: {
|
69
69
|
description: "enforce location of semicolons",
|
70
70
|
category: "Stylistic Issues",
|
71
|
-
recommended: false
|
71
|
+
recommended: false,
|
72
|
+
url: "https://eslint.org/docs/rules/semi-style"
|
72
73
|
},
|
73
74
|
schema: [{ enum: ["last", "first"] }],
|
74
75
|
fixable: "whitespace"
|
package/lib/rules/semi.js
CHANGED
package/lib/rules/sort-keys.js
CHANGED
package/lib/rules/sort-vars.js
CHANGED
@@ -14,7 +14,8 @@ module.exports = {
|
|
14
14
|
docs: {
|
15
15
|
description: "require variables within the same declaration block to be sorted",
|
16
16
|
category: "Stylistic Issues",
|
17
|
-
recommended: false
|
17
|
+
recommended: false,
|
18
|
+
url: "https://eslint.org/docs/rules/sort-vars"
|
18
19
|
},
|
19
20
|
|
20
21
|
schema: [
|
@@ -16,7 +16,8 @@ module.exports = {
|
|
16
16
|
docs: {
|
17
17
|
description: "enforce consistent spacing before blocks",
|
18
18
|
category: "Stylistic Issues",
|
19
|
-
recommended: false
|
19
|
+
recommended: false,
|
20
|
+
url: "https://eslint.org/docs/rules/space-before-blocks"
|
20
21
|
},
|
21
22
|
|
22
23
|
fixable: "whitespace",
|
@@ -19,7 +19,8 @@ module.exports = {
|
|
19
19
|
docs: {
|
20
20
|
description: "enforce consistent spacing before `function` definition opening parenthesis",
|
21
21
|
category: "Stylistic Issues",
|
22
|
-
recommended: false
|
22
|
+
recommended: false,
|
23
|
+
url: "https://eslint.org/docs/rules/space-before-function-paren"
|
23
24
|
},
|
24
25
|
|
25
26
|
fixable: "whitespace",
|
@@ -15,7 +15,8 @@ module.exports = {
|
|
15
15
|
docs: {
|
16
16
|
description: "enforce consistent spacing inside parentheses",
|
17
17
|
category: "Stylistic Issues",
|
18
|
-
recommended: false
|
18
|
+
recommended: false,
|
19
|
+
url: "https://eslint.org/docs/rules/space-in-parens"
|
19
20
|
},
|
20
21
|
|
21
22
|
fixable: "whitespace",
|
@@ -19,7 +19,8 @@ module.exports = {
|
|
19
19
|
docs: {
|
20
20
|
description: "enforce consistent spacing before or after unary operators",
|
21
21
|
category: "Stylistic Issues",
|
22
|
-
recommended: false
|
22
|
+
recommended: false,
|
23
|
+
url: "https://eslint.org/docs/rules/space-unary-ops"
|
23
24
|
},
|
24
25
|
|
25
26
|
fixable: "whitespace",
|
@@ -158,7 +158,8 @@ module.exports = {
|
|
158
158
|
docs: {
|
159
159
|
description: "enforce consistent spacing after the `//` or `/*` in a comment",
|
160
160
|
category: "Stylistic Issues",
|
161
|
-
recommended: false
|
161
|
+
recommended: false,
|
162
|
+
url: "https://eslint.org/docs/rules/spaced-comment"
|
162
163
|
},
|
163
164
|
|
164
165
|
fixable: "whitespace",
|
package/lib/rules/strict.js
CHANGED
@@ -20,7 +20,8 @@ module.exports = {
|
|
20
20
|
docs: {
|
21
21
|
description: "enforce spacing around colons of switch statements",
|
22
22
|
category: "Stylistic Issues",
|
23
|
-
recommended: false
|
23
|
+
recommended: false,
|
24
|
+
url: "https://eslint.org/docs/rules/switch-colon-spacing"
|
24
25
|
},
|
25
26
|
schema: [
|
26
27
|
{
|