eslint 7.24.0 → 7.28.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 +54 -0
- package/README.md +7 -7
- package/bin/eslint.js +2 -12
- package/lib/cli-engine/cli-engine.js +2 -7
- package/lib/cli-engine/file-enumerator.js +1 -1
- package/lib/cli-engine/formatters/html.js +193 -9
- package/lib/init/autoconfig.js +2 -2
- package/lib/init/config-file.js +1 -0
- package/lib/init/config-initializer.js +14 -1
- package/lib/init/npm-utils.js +1 -0
- package/lib/linter/apply-disable-directives.js +15 -3
- package/lib/linter/linter.js +18 -12
- package/lib/linter/node-event-generator.js +43 -6
- package/lib/rule-tester/rule-tester.js +14 -10
- package/lib/rules/arrow-body-style.js +21 -11
- package/lib/rules/comma-dangle.js +16 -7
- package/lib/rules/comma-spacing.js +1 -1
- package/lib/rules/complexity.js +2 -3
- package/lib/rules/consistent-return.js +2 -2
- package/lib/rules/eol-last.js +2 -7
- package/lib/rules/indent.js +8 -9
- package/lib/rules/max-lines-per-function.js +2 -3
- package/lib/rules/max-lines.js +32 -7
- package/lib/rules/max-params.js +2 -3
- package/lib/rules/max-statements.js +2 -3
- package/lib/rules/no-duplicate-imports.js +214 -66
- package/lib/rules/no-fallthrough.js +2 -8
- package/lib/rules/no-implicit-coercion.js +21 -2
- package/lib/rules/no-restricted-imports.js +61 -24
- package/lib/rules/no-unused-vars.js +51 -13
- package/lib/rules/no-useless-backreference.js +1 -2
- package/lib/rules/no-useless-computed-key.js +8 -2
- package/lib/rules/no-warning-comments.js +1 -1
- package/lib/rules/object-curly-newline.js +19 -4
- package/lib/rules/radix.js +19 -3
- package/lib/rules/require-atomic-updates.js +23 -20
- package/lib/rules/spaced-comment.js +2 -2
- package/lib/rules/utils/ast-utils.js +2 -2
- package/lib/shared/deprecation-warnings.js +12 -3
- package/lib/shared/string-utils.js +22 -0
- package/lib/source-code/source-code.js +6 -5
- package/lib/source-code/token-store/utils.js +4 -12
- package/messages/{all-files-ignored.txt → all-files-ignored.js} +10 -2
- package/messages/extend-config-missing.js +13 -0
- package/messages/failed-to-read-json.js +11 -0
- package/messages/file-not-found.js +10 -0
- package/messages/{no-config-found.txt → no-config-found.js} +9 -1
- package/messages/plugin-conflict.js +22 -0
- package/messages/plugin-invalid.js +16 -0
- package/messages/plugin-missing.js +19 -0
- package/messages/{print-config-with-directory-path.txt → print-config-with-directory-path.js} +6 -0
- package/messages/whitespace-found.js +11 -0
- package/package.json +10 -13
- package/lib/cli-engine/formatters/html-template-message.html +0 -8
- package/lib/cli-engine/formatters/html-template-page.html +0 -115
- package/lib/cli-engine/formatters/html-template-result.html +0 -6
- package/messages/extend-config-missing.txt +0 -5
- package/messages/failed-to-read-json.txt +0 -3
- package/messages/file-not-found.txt +0 -2
- package/messages/plugin-conflict.txt +0 -7
- package/messages/plugin-invalid.txt +0 -8
- package/messages/plugin-missing.txt +0 -11
- package/messages/whitespace-found.txt +0 -3
@@ -11,7 +11,6 @@
|
|
11
11
|
|
12
12
|
const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils");
|
13
13
|
const { RegExpParser, visitRegExpAST } = require("regexpp");
|
14
|
-
const lodash = require("lodash");
|
15
14
|
|
16
15
|
//------------------------------------------------------------------------------
|
17
16
|
// Helpers
|
@@ -137,7 +136,7 @@ module.exports = {
|
|
137
136
|
|
138
137
|
// the opposite of the previous when the regex is matching backward in a lookbehind context.
|
139
138
|
messageId = "backward";
|
140
|
-
} else if (
|
139
|
+
} else if (groupCut[groupCut.length - 1].type === "Alternative") {
|
141
140
|
|
142
141
|
// group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive.
|
143
142
|
messageId = "disjunctive";
|
@@ -8,7 +8,6 @@
|
|
8
8
|
// Requirements
|
9
9
|
//------------------------------------------------------------------------------
|
10
10
|
|
11
|
-
const lodash = require("lodash");
|
12
11
|
const astUtils = require("./utils/ast-utils");
|
13
12
|
|
14
13
|
//------------------------------------------------------------------------------
|
@@ -95,9 +94,16 @@ module.exports = {
|
|
95
94
|
}
|
96
95
|
}
|
97
96
|
|
97
|
+
/**
|
98
|
+
* A no-op function to act as placeholder for checking a node when the `enforceForClassMembers` option is `false`.
|
99
|
+
* @returns {void}
|
100
|
+
* @private
|
101
|
+
*/
|
102
|
+
function noop() {}
|
103
|
+
|
98
104
|
return {
|
99
105
|
Property: check,
|
100
|
-
MethodDefinition: enforceForClassMembers ? check :
|
106
|
+
MethodDefinition: enforceForClassMembers ? check : noop
|
101
107
|
};
|
102
108
|
}
|
103
109
|
};
|
@@ -10,7 +10,6 @@
|
|
10
10
|
//------------------------------------------------------------------------------
|
11
11
|
|
12
12
|
const astUtils = require("./utils/ast-utils");
|
13
|
-
const lodash = require("lodash");
|
14
13
|
|
15
14
|
//------------------------------------------------------------------------------
|
16
15
|
// Helpers
|
@@ -69,6 +68,24 @@ function normalizeOptionValue(value) {
|
|
69
68
|
return { multiline, minProperties, consistent };
|
70
69
|
}
|
71
70
|
|
71
|
+
/**
|
72
|
+
* Checks if a value is an object.
|
73
|
+
* @param {any} value The value to check
|
74
|
+
* @returns {boolean} `true` if the value is an object, otherwise `false`
|
75
|
+
*/
|
76
|
+
function isObject(value) {
|
77
|
+
return typeof value === "object" && value !== null;
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Checks if an option is a node-specific option
|
82
|
+
* @param {any} option The option to check
|
83
|
+
* @returns {boolean} `true` if the option is node-specific, otherwise `false`
|
84
|
+
*/
|
85
|
+
function isNodeSpecificOption(option) {
|
86
|
+
return isObject(option) || typeof option === "string";
|
87
|
+
}
|
88
|
+
|
72
89
|
/**
|
73
90
|
* Normalizes a given option value.
|
74
91
|
* @param {string|Object|undefined} options An option value to parse.
|
@@ -80,9 +97,7 @@ function normalizeOptionValue(value) {
|
|
80
97
|
* }} Normalized option object.
|
81
98
|
*/
|
82
99
|
function normalizeOptions(options) {
|
83
|
-
|
84
|
-
|
85
|
-
if (lodash.isPlainObject(options) && Object.values(options).some(isNodeSpecificOption)) {
|
100
|
+
if (isObject(options) && Object.values(options).some(isNodeSpecificOption)) {
|
86
101
|
return {
|
87
102
|
ObjectExpression: normalizeOptionValue(options.ObjectExpression),
|
88
103
|
ObjectPattern: normalizeOptionValue(options.ObjectPattern),
|
package/lib/rules/radix.js
CHANGED
@@ -82,7 +82,8 @@ module.exports = {
|
|
82
82
|
description: "enforce the consistent use of the radix argument when using `parseInt()`",
|
83
83
|
category: "Best Practices",
|
84
84
|
recommended: false,
|
85
|
-
url: "https://eslint.org/docs/rules/radix"
|
85
|
+
url: "https://eslint.org/docs/rules/radix",
|
86
|
+
suggestion: true
|
86
87
|
},
|
87
88
|
|
88
89
|
schema: [
|
@@ -95,7 +96,8 @@ module.exports = {
|
|
95
96
|
missingParameters: "Missing parameters.",
|
96
97
|
redundantRadix: "Redundant radix parameter.",
|
97
98
|
missingRadix: "Missing radix parameter.",
|
98
|
-
invalidRadix: "Invalid radix parameter, must be an integer between 2 and 36."
|
99
|
+
invalidRadix: "Invalid radix parameter, must be an integer between 2 and 36.",
|
100
|
+
addRadixParameter10: "Add radix parameter `10` for parsing decimal numbers."
|
99
101
|
}
|
100
102
|
},
|
101
103
|
|
@@ -123,7 +125,21 @@ module.exports = {
|
|
123
125
|
if (mode === MODE_ALWAYS) {
|
124
126
|
context.report({
|
125
127
|
node,
|
126
|
-
messageId: "missingRadix"
|
128
|
+
messageId: "missingRadix",
|
129
|
+
suggest: [
|
130
|
+
{
|
131
|
+
messageId: "addRadixParameter10",
|
132
|
+
fix(fixer) {
|
133
|
+
const sourceCode = context.getSourceCode();
|
134
|
+
const tokens = sourceCode.getTokens(node);
|
135
|
+
const lastToken = tokens[tokens.length - 1]; // Parenthesis.
|
136
|
+
const secondToLastToken = tokens[tokens.length - 2]; // May or may not be a comma.
|
137
|
+
const hasTrailingComma = secondToLastToken.type === "Punctuator" && secondToLastToken.value === ",";
|
138
|
+
|
139
|
+
return fixer.insertTextBefore(lastToken, hasTrailingComma ? " 10," : ", 10");
|
140
|
+
}
|
141
|
+
}
|
142
|
+
]
|
127
143
|
});
|
128
144
|
}
|
129
145
|
break;
|
@@ -13,6 +13,10 @@
|
|
13
13
|
*/
|
14
14
|
function createReferenceMap(scope, outReferenceMap = new Map()) {
|
15
15
|
for (const reference of scope.references) {
|
16
|
+
if (reference.resolved === null) {
|
17
|
+
continue;
|
18
|
+
}
|
19
|
+
|
16
20
|
outReferenceMap.set(reference.identifier, reference);
|
17
21
|
}
|
18
22
|
for (const childScope of scope.childScopes) {
|
@@ -86,42 +90,42 @@ class SegmentInfo {
|
|
86
90
|
* @returns {void}
|
87
91
|
*/
|
88
92
|
initialize(segment) {
|
89
|
-
const
|
90
|
-
const
|
93
|
+
const outdatedReadVariables = new Set();
|
94
|
+
const freshReadVariables = new Set();
|
91
95
|
|
92
96
|
for (const prevSegment of segment.prevSegments) {
|
93
97
|
const info = this.info.get(prevSegment);
|
94
98
|
|
95
99
|
if (info) {
|
96
|
-
info.
|
97
|
-
info.
|
100
|
+
info.outdatedReadVariables.forEach(Set.prototype.add, outdatedReadVariables);
|
101
|
+
info.freshReadVariables.forEach(Set.prototype.add, freshReadVariables);
|
98
102
|
}
|
99
103
|
}
|
100
104
|
|
101
|
-
this.info.set(segment, {
|
105
|
+
this.info.set(segment, { outdatedReadVariables, freshReadVariables });
|
102
106
|
}
|
103
107
|
|
104
108
|
/**
|
105
109
|
* Mark a given variable as read on given segments.
|
106
110
|
* @param {PathSegment[]} segments The segments that it read the variable on.
|
107
|
-
* @param {
|
111
|
+
* @param {Variable} variable The variable to be read.
|
108
112
|
* @returns {void}
|
109
113
|
*/
|
110
|
-
markAsRead(segments,
|
114
|
+
markAsRead(segments, variable) {
|
111
115
|
for (const segment of segments) {
|
112
116
|
const info = this.info.get(segment);
|
113
117
|
|
114
118
|
if (info) {
|
115
|
-
info.
|
119
|
+
info.freshReadVariables.add(variable);
|
116
120
|
|
117
121
|
// If a variable is freshly read again, then it's no more out-dated.
|
118
|
-
info.
|
122
|
+
info.outdatedReadVariables.delete(variable);
|
119
123
|
}
|
120
124
|
}
|
121
125
|
}
|
122
126
|
|
123
127
|
/**
|
124
|
-
* Move `
|
128
|
+
* Move `freshReadVariables` to `outdatedReadVariables`.
|
125
129
|
* @param {PathSegment[]} segments The segments to process.
|
126
130
|
* @returns {void}
|
127
131
|
*/
|
@@ -130,8 +134,8 @@ class SegmentInfo {
|
|
130
134
|
const info = this.info.get(segment);
|
131
135
|
|
132
136
|
if (info) {
|
133
|
-
info.
|
134
|
-
info.
|
137
|
+
info.freshReadVariables.forEach(Set.prototype.add, info.outdatedReadVariables);
|
138
|
+
info.freshReadVariables.clear();
|
135
139
|
}
|
136
140
|
}
|
137
141
|
}
|
@@ -139,14 +143,14 @@ class SegmentInfo {
|
|
139
143
|
/**
|
140
144
|
* Check if a given variable is outdated on the current segments.
|
141
145
|
* @param {PathSegment[]} segments The current segments.
|
142
|
-
* @param {
|
146
|
+
* @param {Variable} variable The variable to check.
|
143
147
|
* @returns {boolean} `true` if the variable is outdated on the segments.
|
144
148
|
*/
|
145
|
-
isOutdated(segments,
|
149
|
+
isOutdated(segments, variable) {
|
146
150
|
for (const segment of segments) {
|
147
151
|
const info = this.info.get(segment);
|
148
152
|
|
149
|
-
if (info && info.
|
153
|
+
if (info && info.outdatedReadVariables.has(variable)) {
|
150
154
|
return true;
|
151
155
|
}
|
152
156
|
}
|
@@ -214,14 +218,13 @@ module.exports = {
|
|
214
218
|
if (!reference) {
|
215
219
|
return;
|
216
220
|
}
|
217
|
-
const name = reference.identifier.name;
|
218
221
|
const variable = reference.resolved;
|
219
222
|
const writeExpr = getWriteExpr(reference);
|
220
223
|
const isMemberAccess = reference.identifier.parent.type === "MemberExpression";
|
221
224
|
|
222
225
|
// Add a fresh read variable.
|
223
226
|
if (reference.isRead() && !(writeExpr && writeExpr.parent.operator === "=")) {
|
224
|
-
segmentInfo.markAsRead(codePath.currentSegments,
|
227
|
+
segmentInfo.markAsRead(codePath.currentSegments, variable);
|
225
228
|
}
|
226
229
|
|
227
230
|
/*
|
@@ -245,7 +248,7 @@ module.exports = {
|
|
245
248
|
|
246
249
|
/*
|
247
250
|
* Verify assignments.
|
248
|
-
* If the reference exists in `
|
251
|
+
* If the reference exists in `outdatedReadVariables` list, report it.
|
249
252
|
*/
|
250
253
|
":expression:exit"(node) {
|
251
254
|
const { codePath, referenceMap } = stack;
|
@@ -267,9 +270,9 @@ module.exports = {
|
|
267
270
|
assignmentReferences.delete(node);
|
268
271
|
|
269
272
|
for (const reference of references) {
|
270
|
-
const
|
273
|
+
const variable = reference.resolved;
|
271
274
|
|
272
|
-
if (segmentInfo.isOutdated(codePath.currentSegments,
|
275
|
+
if (segmentInfo.isOutdated(codePath.currentSegments, variable)) {
|
273
276
|
context.report({
|
274
277
|
node: node.parent,
|
275
278
|
messageId: "nonAtomicUpdate",
|
@@ -4,7 +4,7 @@
|
|
4
4
|
*/
|
5
5
|
"use strict";
|
6
6
|
|
7
|
-
const
|
7
|
+
const escapeRegExp = require("escape-string-regexp");
|
8
8
|
const astUtils = require("./utils/ast-utils");
|
9
9
|
|
10
10
|
//------------------------------------------------------------------------------
|
@@ -17,7 +17,7 @@ const astUtils = require("./utils/ast-utils");
|
|
17
17
|
* @returns {string} An escaped string.
|
18
18
|
*/
|
19
19
|
function escape(s) {
|
20
|
-
return `(?:${
|
20
|
+
return `(?:${escapeRegExp(s)})`;
|
21
21
|
}
|
22
22
|
|
23
23
|
/**
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
const esutils = require("esutils");
|
13
13
|
const espree = require("espree");
|
14
|
-
const
|
14
|
+
const escapeRegExp = require("escape-string-regexp");
|
15
15
|
const {
|
16
16
|
breakableTypePattern,
|
17
17
|
createGlobalLinebreakMatcher,
|
@@ -1756,7 +1756,7 @@ module.exports = {
|
|
1756
1756
|
* @returns {SourceLocation} The `loc` object.
|
1757
1757
|
*/
|
1758
1758
|
getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) {
|
1759
|
-
const namePattern = new RegExp(`[\\s,]${
|
1759
|
+
const namePattern = new RegExp(`[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`, "gu");
|
1760
1760
|
|
1761
1761
|
// To ignore the first text "global".
|
1762
1762
|
namePattern.lastIndex = comment.value.indexOf("global") + 6;
|
@@ -9,7 +9,6 @@
|
|
9
9
|
//------------------------------------------------------------------------------
|
10
10
|
|
11
11
|
const path = require("path");
|
12
|
-
const lodash = require("lodash");
|
13
12
|
|
14
13
|
//------------------------------------------------------------------------------
|
15
14
|
// Private
|
@@ -28,6 +27,8 @@ const deprecationWarningMessages = {
|
|
28
27
|
"projects in order to avoid loading '~/.eslintrc.*' accidentally."
|
29
28
|
};
|
30
29
|
|
30
|
+
const sourceFileErrorCache = new Set();
|
31
|
+
|
31
32
|
/**
|
32
33
|
* Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted
|
33
34
|
* for each unique file path, but repeated invocations with the same file path have no effect.
|
@@ -36,7 +37,15 @@ const deprecationWarningMessages = {
|
|
36
37
|
* @param {string} errorCode The warning message to show.
|
37
38
|
* @returns {void}
|
38
39
|
*/
|
39
|
-
|
40
|
+
function emitDeprecationWarning(source, errorCode) {
|
41
|
+
const cacheKey = JSON.stringify({ source, errorCode });
|
42
|
+
|
43
|
+
if (sourceFileErrorCache.has(cacheKey)) {
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
|
47
|
+
sourceFileErrorCache.add(cacheKey);
|
48
|
+
|
40
49
|
const rel = path.relative(process.cwd(), source);
|
41
50
|
const message = deprecationWarningMessages[errorCode];
|
42
51
|
|
@@ -45,7 +54,7 @@ const emitDeprecationWarning = lodash.memoize((source, errorCode) => {
|
|
45
54
|
"DeprecationWarning",
|
46
55
|
errorCode
|
47
56
|
);
|
48
|
-
}
|
57
|
+
}
|
49
58
|
|
50
59
|
//------------------------------------------------------------------------------
|
51
60
|
// Public Interface
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview Utilities to operate on strings.
|
3
|
+
* @author Stephen Wade
|
4
|
+
*/
|
5
|
+
|
6
|
+
"use strict";
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Converts the first letter of a string to uppercase.
|
10
|
+
* @param {string} string The string to operate on
|
11
|
+
* @returns {string} The converted string
|
12
|
+
*/
|
13
|
+
function upperCaseFirst(string) {
|
14
|
+
if (string.length <= 1) {
|
15
|
+
return string.toUpperCase();
|
16
|
+
}
|
17
|
+
return string[0].toUpperCase() + string.slice(1);
|
18
|
+
}
|
19
|
+
|
20
|
+
module.exports = {
|
21
|
+
upperCaseFirst
|
22
|
+
};
|
@@ -12,8 +12,7 @@ const
|
|
12
12
|
{ isCommentToken } = require("eslint-utils"),
|
13
13
|
TokenStore = require("./token-store"),
|
14
14
|
astUtils = require("../shared/ast-utils"),
|
15
|
-
Traverser = require("../shared/traverser")
|
16
|
-
lodash = require("lodash");
|
15
|
+
Traverser = require("../shared/traverser");
|
17
16
|
|
18
17
|
//------------------------------------------------------------------------------
|
19
18
|
// Private
|
@@ -531,10 +530,12 @@ class SourceCode extends TokenStore {
|
|
531
530
|
}
|
532
531
|
|
533
532
|
/*
|
534
|
-
* To figure out which line
|
535
|
-
* be inserted into
|
533
|
+
* To figure out which line index is on, determine the last place at which index could
|
534
|
+
* be inserted into lineStartIndices to keep the list sorted.
|
536
535
|
*/
|
537
|
-
const lineNumber =
|
536
|
+
const lineNumber = index >= this.lineStartIndices[this.lineStartIndices.length - 1]
|
537
|
+
? this.lineStartIndices.length
|
538
|
+
: this.lineStartIndices.findIndex(el => index < el);
|
538
539
|
|
539
540
|
return { line: lineNumber, column: index - this.lineStartIndices[lineNumber - 1] };
|
540
541
|
}
|
@@ -4,12 +4,6 @@
|
|
4
4
|
*/
|
5
5
|
"use strict";
|
6
6
|
|
7
|
-
//------------------------------------------------------------------------------
|
8
|
-
// Requirements
|
9
|
-
//------------------------------------------------------------------------------
|
10
|
-
|
11
|
-
const lodash = require("lodash");
|
12
|
-
|
13
7
|
//------------------------------------------------------------------------------
|
14
8
|
// Helpers
|
15
9
|
//------------------------------------------------------------------------------
|
@@ -29,18 +23,16 @@ function getStartLocation(token) {
|
|
29
23
|
//------------------------------------------------------------------------------
|
30
24
|
|
31
25
|
/**
|
32
|
-
*
|
26
|
+
* Finds the index of the first token which is after the given location.
|
33
27
|
* If it was not found, this returns `tokens.length`.
|
34
28
|
* @param {(Token|Comment)[]} tokens It searches the token in this list.
|
35
29
|
* @param {number} location The location to search.
|
36
30
|
* @returns {number} The found index or `tokens.length`.
|
37
31
|
*/
|
38
32
|
exports.search = function search(tokens, location) {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
getStartLocation
|
43
|
-
);
|
33
|
+
const index = tokens.findIndex(el => location <= getStartLocation(el));
|
34
|
+
|
35
|
+
return index === -1 ? tokens.length : index;
|
44
36
|
};
|
45
37
|
|
46
38
|
/**
|
@@ -1,8 +1,16 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
|
-
|
3
|
+
module.exports = function(it) {
|
4
|
+
const { pattern } = it;
|
5
|
+
|
6
|
+
return `
|
7
|
+
You are linting "${pattern}", but all of the files matching the glob pattern "${pattern}" are ignored.
|
8
|
+
|
9
|
+
If you don't want to lint these files, remove the pattern "${pattern}" from the list of arguments passed to ESLint.
|
4
10
|
|
5
11
|
If you do want to lint these files, try the following solutions:
|
6
12
|
|
7
13
|
* Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored.
|
8
14
|
* Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument.
|
15
|
+
`.trimLeft();
|
16
|
+
};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(it) {
|
4
|
+
const { configName, importerName } = it;
|
5
|
+
|
6
|
+
return `
|
7
|
+
ESLint couldn't find the config "${configName}" to extend from. Please check that the name of the config is correct.
|
8
|
+
|
9
|
+
The config "${configName}" was referenced from the config file in "${importerName}".
|
10
|
+
|
11
|
+
If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
|
12
|
+
`.trimLeft();
|
13
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(it) {
|
4
|
+
const { pattern, globDisabled } = it;
|
5
|
+
|
6
|
+
return `
|
7
|
+
No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found.
|
8
|
+
Please check for typing mistakes in the pattern.
|
9
|
+
`.trimLeft();
|
10
|
+
};
|
@@ -1,7 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(it) {
|
4
|
+
const { directoryPath } = it;
|
5
|
+
|
6
|
+
return `
|
1
7
|
ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:
|
2
8
|
|
3
9
|
eslint --init
|
4
10
|
|
5
|
-
ESLint looked for configuration files in
|
11
|
+
ESLint looked for configuration files in ${directoryPath} and its ancestors. If it found none, it then looked in your home directory.
|
6
12
|
|
7
13
|
If you think you already have a configuration file or if you need more help, please stop by the ESLint chat room: https://eslint.org/chat/help
|
14
|
+
`.trimLeft();
|
15
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(it) {
|
4
|
+
const { pluginId, plugins } = it;
|
5
|
+
|
6
|
+
let result = `ESLint couldn't determine the plugin "${pluginId}" uniquely.
|
7
|
+
`;
|
8
|
+
|
9
|
+
for (const { filePath, importerName } of plugins) {
|
10
|
+
result += `
|
11
|
+
- ${filePath} (loaded in "${importerName}")`;
|
12
|
+
}
|
13
|
+
|
14
|
+
result += `
|
15
|
+
|
16
|
+
Please remove the "plugins" setting from either config or remove either plugin installation.
|
17
|
+
|
18
|
+
If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
|
19
|
+
`;
|
20
|
+
|
21
|
+
return result;
|
22
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(it) {
|
4
|
+
const { configName, importerName } = it;
|
5
|
+
|
6
|
+
return `
|
7
|
+
"${configName}" is invalid syntax for a config specifier.
|
8
|
+
|
9
|
+
* If your intention is to extend from a configuration exported from the plugin, add the configuration name after a slash: e.g. "${configName}/myConfig".
|
10
|
+
* If this is the name of a shareable config instead of a plugin, remove the "plugin:" prefix: i.e. "${configName.slice("plugin:".length)}".
|
11
|
+
|
12
|
+
"${configName}" was referenced from the config file in "${importerName}".
|
13
|
+
|
14
|
+
If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
|
15
|
+
`.trimLeft();
|
16
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(it) {
|
4
|
+
const { pluginName, resolvePluginsRelativeTo, importerName } = it;
|
5
|
+
|
6
|
+
return `
|
7
|
+
ESLint couldn't find the plugin "${pluginName}".
|
8
|
+
|
9
|
+
(The package "${pluginName}" was not found when loaded as a Node module from the directory "${resolvePluginsRelativeTo}".)
|
10
|
+
|
11
|
+
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
|
12
|
+
|
13
|
+
npm install ${pluginName}@latest --save-dev
|
14
|
+
|
15
|
+
The plugin "${pluginName}" was referenced from the config file in "${importerName}".
|
16
|
+
|
17
|
+
If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
|
18
|
+
`.trimLeft();
|
19
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(it) {
|
4
|
+
const { pluginName } = it;
|
5
|
+
|
6
|
+
return `
|
7
|
+
ESLint couldn't find the plugin "${pluginName}". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name.
|
8
|
+
|
9
|
+
If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
|
10
|
+
`.trimLeft();
|
11
|
+
};
|