eslint 5.7.0 → 5.11.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 +76 -0
- package/README.md +2 -2
- package/conf/eslint-recommended.js +1 -0
- package/lib/cli-engine.js +129 -32
- package/lib/cli.js +6 -1
- package/lib/config/autoconfig.js +0 -1
- package/lib/config/config-rule.js +4 -4
- package/lib/config/config-validator.js +2 -2
- package/lib/config.js +15 -2
- package/lib/linter.js +17 -120
- package/lib/options.js +5 -0
- package/lib/rules/accessor-pairs.js +4 -0
- package/lib/rules/array-bracket-newline.js +5 -0
- package/lib/rules/array-bracket-spacing.js +5 -0
- package/lib/rules/array-callback-return.js +2 -0
- package/lib/rules/array-element-newline.js +4 -1
- package/lib/rules/arrow-body-style.js +2 -0
- package/lib/rules/arrow-parens.js +2 -0
- package/lib/rules/arrow-spacing.js +2 -0
- package/lib/rules/block-scoped-var.js +2 -0
- package/lib/rules/block-spacing.js +2 -0
- package/lib/rules/brace-style.js +2 -0
- package/lib/rules/callback-return.js +2 -0
- package/lib/rules/camelcase.js +26 -14
- package/lib/rules/capitalized-comments.js +4 -0
- package/lib/rules/class-methods-use-this.js +3 -0
- package/lib/rules/comma-dangle.js +4 -0
- package/lib/rules/comma-spacing.js +2 -0
- package/lib/rules/comma-style.js +12 -2
- package/lib/rules/complexity.js +2 -0
- package/lib/rules/computed-property-spacing.js +2 -0
- package/lib/rules/consistent-return.js +2 -0
- package/lib/rules/consistent-this.js +2 -0
- package/lib/rules/constructor-super.js +2 -0
- package/lib/rules/curly.js +2 -0
- package/lib/rules/default-case.js +2 -0
- package/lib/rules/dot-location.js +2 -0
- package/lib/rules/dot-notation.js +2 -0
- package/lib/rules/eol-last.js +5 -0
- package/lib/rules/eqeqeq.js +2 -1
- package/lib/rules/for-direction.js +4 -0
- package/lib/rules/func-call-spacing.js +4 -0
- package/lib/rules/func-name-matching.js +3 -0
- package/lib/rules/func-names.js +3 -0
- package/lib/rules/func-style.js +3 -0
- package/lib/rules/function-paren-newline.js +5 -0
- package/lib/rules/generator-star-spacing.js +3 -0
- package/lib/rules/getter-return.js +5 -0
- package/lib/rules/global-require.js +2 -0
- package/lib/rules/guard-for-in.js +2 -0
- package/lib/rules/handle-callback-err.js +3 -1
- package/lib/rules/id-blacklist.js +2 -0
- package/lib/rules/id-length.js +2 -0
- package/lib/rules/id-match.js +101 -27
- package/lib/rules/implicit-arrow-linebreak.js +147 -2
- package/lib/rules/indent-legacy.js +4 -4
- package/lib/rules/indent.js +31 -23
- package/lib/rules/init-declarations.js +2 -0
- package/lib/rules/jsx-quotes.js +2 -0
- package/lib/rules/key-spacing.js +4 -3
- package/lib/rules/keyword-spacing.js +7 -1
- package/lib/rules/line-comment-position.js +2 -0
- package/lib/rules/linebreak-style.js +2 -0
- package/lib/rules/lines-around-comment.js +2 -0
- package/lib/rules/lines-around-directive.js +6 -2
- package/lib/rules/lines-between-class-members.js +2 -0
- package/lib/rules/max-classes-per-file.js +4 -0
- package/lib/rules/max-depth.js +2 -0
- package/lib/rules/max-len.js +2 -0
- package/lib/rules/max-lines-per-function.js +2 -0
- package/lib/rules/max-lines.js +2 -0
- package/lib/rules/max-nested-callbacks.js +2 -0
- package/lib/rules/max-params.js +2 -0
- package/lib/rules/max-statements-per-line.js +2 -0
- package/lib/rules/max-statements.js +2 -0
- package/lib/rules/multiline-comment-style.js +3 -0
- package/lib/rules/multiline-ternary.js +3 -0
- package/lib/rules/new-cap.js +2 -0
- package/lib/rules/new-parens.js +2 -1
- package/lib/rules/newline-after-var.js +5 -2
- package/lib/rules/newline-before-return.js +6 -3
- package/lib/rules/newline-per-chained-call.js +4 -0
- package/lib/rules/no-alert.js +2 -0
- package/lib/rules/no-array-constructor.js +2 -0
- package/lib/rules/no-async-promise-executor.js +3 -0
- package/lib/rules/no-await-in-loop.js +4 -0
- package/lib/rules/no-bitwise.js +2 -0
- package/lib/rules/no-buffer-constructor.js +4 -0
- package/lib/rules/no-caller.js +2 -0
- package/lib/rules/no-case-declarations.js +2 -0
- package/lib/rules/no-catch-shadow.js +6 -3
- package/lib/rules/no-class-assign.js +2 -0
- package/lib/rules/no-compare-neg-zero.js +4 -0
- package/lib/rules/no-cond-assign.js +2 -0
- package/lib/rules/no-confusing-arrow.js +2 -0
- package/lib/rules/no-console.js +2 -0
- package/lib/rules/no-const-assign.js +2 -0
- package/lib/rules/no-constant-condition.js +2 -1
- package/lib/rules/no-continue.js +2 -0
- package/lib/rules/no-control-regex.js +4 -2
- package/lib/rules/no-debugger.js +4 -0
- package/lib/rules/no-delete-var.js +2 -0
- package/lib/rules/no-div-regex.js +2 -0
- package/lib/rules/no-dupe-args.js +2 -0
- package/lib/rules/no-dupe-class-members.js +2 -0
- package/lib/rules/no-dupe-keys.js +2 -0
- package/lib/rules/no-duplicate-case.js +2 -0
- package/lib/rules/no-duplicate-imports.js +2 -0
- package/lib/rules/no-else-return.js +2 -1
- package/lib/rules/no-empty-character-class.js +2 -0
- package/lib/rules/no-empty-function.js +2 -0
- package/lib/rules/no-empty-pattern.js +2 -0
- package/lib/rules/no-empty.js +2 -0
- package/lib/rules/no-eq-null.js +2 -0
- package/lib/rules/no-eval.js +2 -0
- package/lib/rules/no-ex-assign.js +2 -0
- package/lib/rules/no-extend-native.js +2 -0
- 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 +5 -6
- package/lib/rules/no-extra-semi.js +2 -0
- package/lib/rules/no-fallthrough.js +2 -0
- package/lib/rules/no-floating-decimal.js +2 -1
- package/lib/rules/no-func-assign.js +2 -0
- package/lib/rules/no-global-assign.js +2 -0
- package/lib/rules/no-implicit-coercion.js +3 -0
- package/lib/rules/no-implicit-globals.js +2 -0
- package/lib/rules/no-implied-eval.js +3 -1
- package/lib/rules/no-inline-comments.js +2 -0
- package/lib/rules/no-inner-declarations.js +2 -0
- package/lib/rules/no-invalid-regexp.js +2 -0
- package/lib/rules/no-invalid-this.js +2 -0
- package/lib/rules/no-irregular-whitespace.js +7 -9
- package/lib/rules/no-iterator.js +2 -0
- package/lib/rules/no-label-var.js +2 -0
- package/lib/rules/no-labels.js +2 -0
- package/lib/rules/no-lone-blocks.js +2 -0
- package/lib/rules/no-lonely-if.js +2 -1
- package/lib/rules/no-loop-func.js +2 -0
- package/lib/rules/no-magic-numbers.js +3 -0
- package/lib/rules/no-misleading-character-class.js +4 -0
- package/lib/rules/no-mixed-operators.js +3 -0
- package/lib/rules/no-mixed-requires.js +2 -0
- package/lib/rules/no-mixed-spaces-and-tabs.js +2 -0
- package/lib/rules/no-multi-assign.js +3 -0
- package/lib/rules/no-multi-spaces.js +2 -0
- package/lib/rules/no-multi-str.js +2 -0
- package/lib/rules/no-multiple-empty-lines.js +2 -0
- package/lib/rules/no-native-reassign.js +4 -1
- package/lib/rules/no-negated-condition.js +2 -0
- package/lib/rules/no-negated-in-lhs.js +5 -2
- package/lib/rules/no-nested-ternary.js +2 -0
- package/lib/rules/no-new-func.js +2 -0
- package/lib/rules/no-new-object.js +2 -0
- package/lib/rules/no-new-require.js +2 -0
- package/lib/rules/no-new-symbol.js +2 -0
- package/lib/rules/no-new-wrappers.js +2 -0
- package/lib/rules/no-new.js +2 -0
- package/lib/rules/no-obj-calls.js +2 -0
- package/lib/rules/no-octal-escape.js +2 -0
- package/lib/rules/no-octal.js +2 -0
- package/lib/rules/no-param-reassign.js +2 -0
- package/lib/rules/no-path-concat.js +2 -0
- package/lib/rules/no-plusplus.js +2 -0
- package/lib/rules/no-process-env.js +2 -0
- package/lib/rules/no-process-exit.js +2 -0
- package/lib/rules/no-proto.js +2 -0
- package/lib/rules/no-prototype-builtins.js +2 -0
- package/lib/rules/no-redeclare.js +2 -0
- package/lib/rules/no-regex-spaces.js +2 -1
- package/lib/rules/no-restricted-globals.js +2 -0
- package/lib/rules/no-restricted-imports.js +41 -23
- package/lib/rules/no-restricted-modules.js +2 -0
- package/lib/rules/no-restricted-properties.js +2 -0
- package/lib/rules/no-restricted-syntax.js +2 -0
- package/lib/rules/no-return-assign.js +2 -0
- package/lib/rules/no-return-await.js +4 -0
- package/lib/rules/no-script-url.js +2 -0
- package/lib/rules/no-self-assign.js +2 -0
- package/lib/rules/no-self-compare.js +2 -0
- package/lib/rules/no-sequences.js +2 -0
- package/lib/rules/no-shadow-restricted-names.js +2 -0
- package/lib/rules/no-shadow.js +2 -0
- package/lib/rules/no-spaced-func.js +4 -1
- package/lib/rules/no-sparse-arrays.js +2 -0
- package/lib/rules/no-sync.js +2 -0
- package/lib/rules/no-tabs.js +2 -0
- package/lib/rules/no-template-curly-in-string.js +2 -0
- package/lib/rules/no-ternary.js +2 -0
- package/lib/rules/no-this-before-super.js +2 -1
- package/lib/rules/no-throw-literal.js +2 -0
- package/lib/rules/no-trailing-spaces.js +2 -0
- package/lib/rules/no-undef-init.js +2 -1
- package/lib/rules/no-undef.js +2 -0
- package/lib/rules/no-undefined.js +2 -0
- package/lib/rules/no-underscore-dangle.js +2 -0
- package/lib/rules/no-unexpected-multiline.js +2 -0
- package/lib/rules/no-unmodified-loop-condition.js +2 -0
- package/lib/rules/no-unneeded-ternary.js +2 -0
- package/lib/rules/no-unreachable.js +2 -1
- package/lib/rules/no-unsafe-finally.js +2 -0
- package/lib/rules/no-unsafe-negation.js +3 -0
- package/lib/rules/no-unused-expressions.js +2 -0
- package/lib/rules/no-unused-labels.js +2 -1
- package/lib/rules/no-unused-vars.js +36 -12
- package/lib/rules/no-use-before-define.js +2 -0
- package/lib/rules/no-useless-call.js +2 -0
- package/lib/rules/no-useless-catch.js +51 -0
- package/lib/rules/no-useless-computed-key.js +2 -1
- package/lib/rules/no-useless-concat.js +2 -0
- package/lib/rules/no-useless-constructor.js +2 -0
- package/lib/rules/no-useless-escape.js +2 -0
- package/lib/rules/no-useless-rename.js +4 -0
- package/lib/rules/no-useless-return.js +3 -0
- package/lib/rules/no-var.js +2 -0
- package/lib/rules/no-void.js +2 -0
- package/lib/rules/no-warning-comments.js +2 -0
- package/lib/rules/no-whitespace-before-property.js +2 -0
- package/lib/rules/no-with.js +2 -0
- package/lib/rules/nonblock-statement-body-position.js +4 -0
- package/lib/rules/object-curly-newline.js +4 -1
- package/lib/rules/object-curly-spacing.js +2 -0
- package/lib/rules/object-property-newline.js +3 -2
- package/lib/rules/object-shorthand.js +2 -0
- package/lib/rules/one-var-declaration-per-line.js +2 -0
- package/lib/rules/one-var.js +2 -1
- package/lib/rules/operator-assignment.js +2 -0
- package/lib/rules/operator-linebreak.js +2 -0
- package/lib/rules/padded-blocks.js +2 -0
- package/lib/rules/padding-line-between-statements.js +41 -0
- package/lib/rules/prefer-arrow-callback.js +2 -0
- package/lib/rules/prefer-const.js +116 -11
- package/lib/rules/prefer-destructuring.js +3 -0
- package/lib/rules/prefer-numeric-literals.js +2 -1
- package/lib/rules/prefer-object-spread.js +4 -0
- package/lib/rules/prefer-promise-reject-errors.js +4 -0
- package/lib/rules/prefer-reflect.js +4 -1
- package/lib/rules/prefer-rest-params.js +2 -0
- package/lib/rules/prefer-spread.js +2 -1
- package/lib/rules/prefer-template.js +2 -1
- package/lib/rules/quote-props.js +2 -0
- package/lib/rules/quotes.js +50 -25
- package/lib/rules/radix.js +2 -0
- package/lib/rules/require-atomic-updates.js +4 -0
- package/lib/rules/require-await.js +3 -0
- package/lib/rules/require-jsdoc.js +6 -1
- package/lib/rules/require-unicode-regexp.js +4 -0
- package/lib/rules/require-yield.js +2 -0
- package/lib/rules/rest-spread-spacing.js +4 -0
- package/lib/rules/semi-spacing.js +2 -0
- package/lib/rules/semi-style.js +3 -0
- package/lib/rules/semi.js +2 -0
- package/lib/rules/sort-imports.js +2 -0
- package/lib/rules/sort-keys.js +3 -0
- package/lib/rules/sort-vars.js +2 -0
- package/lib/rules/space-before-blocks.js +46 -35
- package/lib/rules/space-before-function-paren.js +2 -0
- package/lib/rules/space-in-parens.js +2 -1
- package/lib/rules/space-infix-ops.js +6 -1
- package/lib/rules/space-unary-ops.js +2 -0
- package/lib/rules/spaced-comment.js +2 -0
- package/lib/rules/strict.js +2 -0
- package/lib/rules/switch-colon-spacing.js +4 -0
- package/lib/rules/symbol-description.js +2 -0
- package/lib/rules/template-curly-spacing.js +2 -0
- package/lib/rules/template-tag-spacing.js +2 -0
- package/lib/rules/unicode-bom.js +2 -0
- package/lib/rules/use-isnan.js +2 -0
- package/lib/rules/valid-jsdoc.js +6 -1
- package/lib/rules/valid-typeof.js +2 -0
- package/lib/rules/vars-on-top.js +2 -0
- package/lib/rules/wrap-iife.js +2 -0
- package/lib/rules/wrap-regex.js +3 -1
- package/lib/rules/yield-star-spacing.js +2 -0
- package/lib/rules/yoda.js +2 -0
- package/lib/testers/rule-tester.js +2 -2
- package/lib/util/config-comment-parser.js +144 -0
- package/lib/util/glob-utils.js +1 -1
- package/lib/{ignored-paths.js → util/ignored-paths.js} +4 -4
- package/lib/{report-translator.js → util/report-translator.js} +2 -2
- package/lib/util/source-code.js +2 -1
- package/messages/all-files-ignored.txt +1 -1
- package/package.json +10 -11
package/lib/rules/yoda.js
CHANGED
@@ -397,7 +397,7 @@ class RuleTester {
|
|
397
397
|
*/
|
398
398
|
function assertASTDidntChange(beforeAST, afterAST) {
|
399
399
|
if (!lodash.isEqual(beforeAST, afterAST)) {
|
400
|
-
assert.fail(
|
400
|
+
assert.fail("Rule should not modify AST.");
|
401
401
|
}
|
402
402
|
}
|
403
403
|
|
@@ -551,7 +551,7 @@ class RuleTester {
|
|
551
551
|
} else {
|
552
552
|
|
553
553
|
// Message was an unexpected type
|
554
|
-
assert.fail(
|
554
|
+
assert.fail(`Error should be a string, object, or RegExp, but found (${util.inspect(message)})`);
|
555
555
|
}
|
556
556
|
}
|
557
557
|
}
|
@@ -0,0 +1,144 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview Config Comment Parser
|
3
|
+
* @author Nicholas C. Zakas
|
4
|
+
*/
|
5
|
+
|
6
|
+
/* eslint-disable class-methods-use-this*/
|
7
|
+
"use strict";
|
8
|
+
|
9
|
+
//------------------------------------------------------------------------------
|
10
|
+
// Requirements
|
11
|
+
//------------------------------------------------------------------------------
|
12
|
+
|
13
|
+
const levn = require("levn"),
|
14
|
+
ConfigOps = require("../config/config-ops");
|
15
|
+
|
16
|
+
const debug = require("debug")("eslint:config-comment-parser");
|
17
|
+
|
18
|
+
//------------------------------------------------------------------------------
|
19
|
+
// Public Interface
|
20
|
+
//------------------------------------------------------------------------------
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Object to parse ESLint configuration comments inside JavaScript files.
|
24
|
+
* @name ConfigCommentParser
|
25
|
+
*/
|
26
|
+
module.exports = class ConfigCommentParser {
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Parses a list of "name:boolean_value" or/and "name" options divided by comma or
|
30
|
+
* whitespace. Used for "global" and "exported" comments.
|
31
|
+
* @param {string} string The string to parse.
|
32
|
+
* @param {Comment} comment The comment node which has the string.
|
33
|
+
* @returns {Object} Result map object of names and boolean values
|
34
|
+
*/
|
35
|
+
parseBooleanConfig(string, comment) {
|
36
|
+
debug("Parsing Boolean config");
|
37
|
+
|
38
|
+
const items = {};
|
39
|
+
|
40
|
+
// Collapse whitespace around `:` and `,` to make parsing easier
|
41
|
+
const trimmedString = string.replace(/\s*([:,])\s*/g, "$1");
|
42
|
+
|
43
|
+
trimmedString.split(/\s|,+/).forEach(name => {
|
44
|
+
if (!name) {
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
|
48
|
+
// value defaults to "false" (if not provided), e.g: "foo" => ["foo", "false"]
|
49
|
+
const [key, value = "false"] = name.split(":");
|
50
|
+
|
51
|
+
items[key] = {
|
52
|
+
value: value === "true",
|
53
|
+
comment
|
54
|
+
};
|
55
|
+
});
|
56
|
+
return items;
|
57
|
+
}
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Parses a JSON-like config.
|
61
|
+
* @param {string} string The string to parse.
|
62
|
+
* @param {Object} location Start line and column of comments for potential error message.
|
63
|
+
* @returns {({success: true, config: Object}|{success: false, error: Problem})} Result map object
|
64
|
+
*/
|
65
|
+
parseJsonConfig(string, location) {
|
66
|
+
debug("Parsing JSON config");
|
67
|
+
|
68
|
+
let items = {};
|
69
|
+
|
70
|
+
// Parses a JSON-like comment by the same way as parsing CLI option.
|
71
|
+
try {
|
72
|
+
items = levn.parse("Object", string) || {};
|
73
|
+
|
74
|
+
// Some tests say that it should ignore invalid comments such as `/*eslint no-alert:abc*/`.
|
75
|
+
// Also, commaless notations have invalid severity:
|
76
|
+
// "no-alert: 2 no-console: 2" --> {"no-alert": "2 no-console: 2"}
|
77
|
+
// Should ignore that case as well.
|
78
|
+
if (ConfigOps.isEverySeverityValid(items)) {
|
79
|
+
return {
|
80
|
+
success: true,
|
81
|
+
config: items
|
82
|
+
};
|
83
|
+
}
|
84
|
+
} catch (ex) {
|
85
|
+
|
86
|
+
debug("Levn parsing failed; falling back to manual parsing.");
|
87
|
+
|
88
|
+
// ignore to parse the string by a fallback.
|
89
|
+
}
|
90
|
+
|
91
|
+
/*
|
92
|
+
* Optionator cannot parse commaless notations.
|
93
|
+
* But we are supporting that. So this is a fallback for that.
|
94
|
+
*/
|
95
|
+
items = {};
|
96
|
+
const normalizedString = string.replace(/([a-zA-Z0-9\-/]+):/g, "\"$1\":").replace(/(]|[0-9])\s+(?=")/, "$1,");
|
97
|
+
|
98
|
+
try {
|
99
|
+
items = JSON.parse(`{${normalizedString}}`);
|
100
|
+
} catch (ex) {
|
101
|
+
debug("Manual parsing failed.");
|
102
|
+
|
103
|
+
return {
|
104
|
+
success: false,
|
105
|
+
error: {
|
106
|
+
ruleId: null,
|
107
|
+
fatal: true,
|
108
|
+
severity: 2,
|
109
|
+
message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`,
|
110
|
+
line: location.start.line,
|
111
|
+
column: location.start.column + 1
|
112
|
+
}
|
113
|
+
};
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
return {
|
118
|
+
success: true,
|
119
|
+
config: items
|
120
|
+
};
|
121
|
+
}
|
122
|
+
|
123
|
+
/**
|
124
|
+
* Parses a config of values separated by comma.
|
125
|
+
* @param {string} string The string to parse.
|
126
|
+
* @returns {Object} Result map of values and true values
|
127
|
+
*/
|
128
|
+
parseListConfig(string) {
|
129
|
+
debug("Parsing list config");
|
130
|
+
|
131
|
+
const items = {};
|
132
|
+
|
133
|
+
// Collapse whitespace around commas
|
134
|
+
string.replace(/\s*,\s*/g, ",").split(/,+/).forEach(name => {
|
135
|
+
const trimmedName = name.trim();
|
136
|
+
|
137
|
+
if (trimmedName) {
|
138
|
+
items[trimmedName] = true;
|
139
|
+
}
|
140
|
+
});
|
141
|
+
return items;
|
142
|
+
}
|
143
|
+
|
144
|
+
};
|
package/lib/util/glob-utils.js
CHANGED
@@ -14,7 +14,7 @@ const lodash = require("lodash"),
|
|
14
14
|
GlobSync = require("./glob"),
|
15
15
|
|
16
16
|
pathUtils = require("./path-utils"),
|
17
|
-
IgnoredPaths = require("
|
17
|
+
IgnoredPaths = require("./ignored-paths");
|
18
18
|
|
19
19
|
const debug = require("debug")("eslint:glob-utils");
|
20
20
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
const fs = require("fs"),
|
13
13
|
path = require("path"),
|
14
14
|
ignore = require("ignore"),
|
15
|
-
pathUtils = require("./
|
15
|
+
pathUtils = require("./path-utils");
|
16
16
|
|
17
17
|
const debug = require("debug")("eslint:ignored-paths");
|
18
18
|
|
@@ -296,7 +296,7 @@ class IgnoredPaths {
|
|
296
296
|
/**
|
297
297
|
* read ignore filepath
|
298
298
|
* @param {string} filePath, file to add to ig
|
299
|
-
* @returns {
|
299
|
+
* @returns {Array} raw ignore rules
|
300
300
|
*/
|
301
301
|
readIgnoreFile(filePath) {
|
302
302
|
if (typeof this.cache[filePath] === "undefined") {
|
@@ -307,8 +307,8 @@ class IgnoredPaths {
|
|
307
307
|
|
308
308
|
/**
|
309
309
|
* add ignore file to node-ignore instance
|
310
|
-
* @param {Object} ig
|
311
|
-
* @param {string} filePath
|
310
|
+
* @param {Object} ig instance of node-ignore
|
311
|
+
* @param {string} filePath file to add to ig
|
312
312
|
* @returns {void}
|
313
313
|
*/
|
314
314
|
addIgnoreFile(ig, filePath) {
|
@@ -10,8 +10,8 @@
|
|
10
10
|
//------------------------------------------------------------------------------
|
11
11
|
|
12
12
|
const assert = require("assert");
|
13
|
-
const ruleFixer = require("./
|
14
|
-
const interpolate = require("./
|
13
|
+
const ruleFixer = require("./rule-fixer");
|
14
|
+
const interpolate = require("./interpolate");
|
15
15
|
|
16
16
|
//------------------------------------------------------------------------------
|
17
17
|
// Typedefs
|
package/lib/util/source-code.js
CHANGED
@@ -87,7 +87,7 @@ class SourceCode extends TokenStore {
|
|
87
87
|
* @param {string|Object} textOrConfig - The source code text or config object.
|
88
88
|
* @param {string} textOrConfig.text - The source code text.
|
89
89
|
* @param {ASTNode} textOrConfig.ast - The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
|
90
|
-
* @param {Object|null} textOrConfig.parserServices - The parser
|
90
|
+
* @param {Object|null} textOrConfig.parserServices - The parser services.
|
91
91
|
* @param {ScopeManager|null} textOrConfig.scopeManager - The scope of this source code.
|
92
92
|
* @param {Object|null} textOrConfig.visitorKeys - The visitor keys to traverse AST.
|
93
93
|
* @param {ASTNode} [astIfNoConfig] - The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
|
@@ -316,6 +316,7 @@ class SourceCode extends TokenStore {
|
|
316
316
|
* @returns {Token|null} The Block comment token containing the JSDoc comment
|
317
317
|
* for the given node or null if not found.
|
318
318
|
* @public
|
319
|
+
* @deprecated
|
319
320
|
*/
|
320
321
|
getJSDocComment(node) {
|
321
322
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
You are linting "<%= pattern %>", but all of the files matching the glob pattern "<%= pattern %>" are ignored.
|
2
2
|
|
3
3
|
If you don't want to lint these files, remove the pattern "<%= pattern %>" from the list of arguments passed to ESLint.
|
4
4
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.11.0",
|
4
4
|
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
|
5
5
|
"description": "An AST-based pattern checker for JavaScript.",
|
6
6
|
"bin": {
|
@@ -11,11 +11,11 @@
|
|
11
11
|
"test": "node Makefile.js test",
|
12
12
|
"lint": "node Makefile.js lint",
|
13
13
|
"fuzz": "node Makefile.js fuzz",
|
14
|
-
"release": "node Makefile.js
|
15
|
-
"
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
14
|
+
"generate-release": "node Makefile.js generateRelease",
|
15
|
+
"generate-alpharelease": "node Makefile.js generatePrerelease -- alpha",
|
16
|
+
"generate-betarelease": "node Makefile.js generatePrerelease -- beta",
|
17
|
+
"generate-rcrelease": "node Makefile.js generatePrerelease -- rc",
|
18
|
+
"publish-release": "node Makefile.js publishRelease",
|
19
19
|
"docs": "node Makefile.js docs",
|
20
20
|
"gensite": "node Makefile.js gensite",
|
21
21
|
"browserify": "node Makefile.js browserify",
|
@@ -44,7 +44,7 @@
|
|
44
44
|
"eslint-scope": "^4.0.0",
|
45
45
|
"eslint-utils": "^1.3.1",
|
46
46
|
"eslint-visitor-keys": "^1.0.0",
|
47
|
-
"espree": "^
|
47
|
+
"espree": "^5.0.0",
|
48
48
|
"esquery": "^1.0.1",
|
49
49
|
"esutils": "^2.0.2",
|
50
50
|
"file-entry-cache": "^2.0.0",
|
@@ -54,7 +54,6 @@
|
|
54
54
|
"ignore": "^4.0.6",
|
55
55
|
"imurmurhash": "^0.1.4",
|
56
56
|
"inquirer": "^6.1.0",
|
57
|
-
"is-resolvable": "^1.1.0",
|
58
57
|
"js-yaml": "^3.12.0",
|
59
58
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
60
59
|
"levn": "^0.3.0",
|
@@ -87,10 +86,10 @@
|
|
87
86
|
"coveralls": "^3.0.1",
|
88
87
|
"dateformat": "^3.0.3",
|
89
88
|
"ejs": "^2.6.1",
|
90
|
-
"eslint-plugin-eslint-plugin": "^1.
|
91
|
-
"eslint-plugin-node": "^
|
89
|
+
"eslint-plugin-eslint-plugin": "^1.4.1",
|
90
|
+
"eslint-plugin-node": "^8.0.0",
|
92
91
|
"eslint-plugin-rulesdir": "^0.1.0",
|
93
|
-
"eslint-release": "^
|
92
|
+
"eslint-release": "^1.2.0",
|
94
93
|
"eslint-rule-composer": "^0.3.0",
|
95
94
|
"eslump": "^1.6.2",
|
96
95
|
"esprima": "^4.0.1",
|