eslint 9.35.0 → 9.37.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/README.md +7 -2
- package/lib/cli-engine/lint-result-cache.js +47 -29
- package/lib/eslint/eslint-helpers.js +6 -3
- package/lib/eslint/eslint.js +151 -37
- package/lib/eslint/worker.js +1 -3
- package/lib/linter/esquery.js +1 -1
- package/lib/rules/array-bracket-newline.js +1 -1
- package/lib/rules/array-bracket-spacing.js +1 -1
- package/lib/rules/array-element-newline.js +1 -1
- package/lib/rules/arrow-parens.js +1 -1
- package/lib/rules/arrow-spacing.js +1 -1
- package/lib/rules/block-spacing.js +1 -1
- package/lib/rules/brace-style.js +1 -1
- package/lib/rules/comma-dangle.js +1 -1
- package/lib/rules/comma-spacing.js +1 -1
- package/lib/rules/comma-style.js +1 -1
- package/lib/rules/computed-property-spacing.js +1 -1
- package/lib/rules/dot-location.js +1 -1
- package/lib/rules/eol-last.js +1 -1
- package/lib/rules/func-call-spacing.js +2 -2
- package/lib/rules/function-call-argument-newline.js +1 -1
- package/lib/rules/function-paren-newline.js +1 -1
- package/lib/rules/generator-star-spacing.js +1 -1
- package/lib/rules/implicit-arrow-linebreak.js +1 -1
- package/lib/rules/indent-legacy.js +1 -0
- package/lib/rules/indent.js +1 -1
- package/lib/rules/jsx-quotes.js +1 -1
- package/lib/rules/key-spacing.js +1 -1
- package/lib/rules/keyword-spacing.js +1 -1
- package/lib/rules/line-comment-position.js +1 -1
- package/lib/rules/linebreak-style.js +1 -1
- package/lib/rules/lines-around-comment.js +1 -1
- package/lib/rules/lines-around-directive.js +1 -1
- package/lib/rules/lines-between-class-members.js +1 -1
- package/lib/rules/max-len.js +1 -1
- package/lib/rules/max-statements-per-line.js +1 -1
- package/lib/rules/multiline-comment-style.js +1 -1
- package/lib/rules/multiline-ternary.js +1 -1
- package/lib/rules/new-parens.js +1 -1
- package/lib/rules/newline-after-var.js +1 -1
- package/lib/rules/newline-before-return.js +1 -1
- package/lib/rules/newline-per-chained-call.js +1 -1
- package/lib/rules/no-confusing-arrow.js +1 -1
- package/lib/rules/no-extra-parens.js +1 -1
- package/lib/rules/no-extra-semi.js +1 -1
- package/lib/rules/no-floating-decimal.js +1 -1
- package/lib/rules/no-loss-of-precision.js +5 -8
- package/lib/rules/no-misleading-character-class.js +7 -2
- package/lib/rules/no-mixed-operators.js +1 -1
- package/lib/rules/no-mixed-spaces-and-tabs.js +1 -1
- package/lib/rules/no-multi-spaces.js +1 -1
- package/lib/rules/no-multiple-empty-lines.js +1 -1
- package/lib/rules/no-restricted-imports.js +171 -4
- package/lib/rules/no-spaced-func.js +1 -1
- package/lib/rules/no-tabs.js +1 -1
- package/lib/rules/no-trailing-spaces.js +1 -1
- package/lib/rules/no-whitespace-before-property.js +1 -1
- package/lib/rules/nonblock-statement-body-position.js +1 -1
- package/lib/rules/object-curly-newline.js +1 -1
- package/lib/rules/object-curly-spacing.js +1 -1
- package/lib/rules/object-property-newline.js +1 -1
- package/lib/rules/one-var-declaration-per-line.js +1 -1
- package/lib/rules/operator-linebreak.js +1 -1
- package/lib/rules/padded-blocks.js +1 -1
- package/lib/rules/padding-line-between-statements.js +1 -1
- package/lib/rules/preserve-caught-error.js +70 -44
- package/lib/rules/quote-props.js +1 -1
- package/lib/rules/quotes.js +1 -1
- package/lib/rules/require-unicode-regexp.js +3 -1
- package/lib/rules/rest-spread-spacing.js +1 -1
- package/lib/rules/semi-spacing.js +1 -1
- package/lib/rules/semi-style.js +1 -1
- package/lib/rules/semi.js +1 -1
- package/lib/rules/space-before-blocks.js +1 -1
- package/lib/rules/space-before-function-paren.js +1 -1
- package/lib/rules/space-in-parens.js +1 -1
- package/lib/rules/space-infix-ops.js +1 -1
- package/lib/rules/space-unary-ops.js +1 -1
- package/lib/rules/spaced-comment.js +1 -1
- package/lib/rules/switch-colon-spacing.js +1 -1
- package/lib/rules/template-curly-spacing.js +1 -1
- package/lib/rules/template-tag-spacing.js +1 -1
- package/lib/rules/wrap-iife.js +1 -1
- package/lib/rules/wrap-regex.js +1 -1
- package/lib/rules/yield-star-spacing.js +1 -1
- package/lib/types/index.d.ts +10 -5
- package/lib/types/rules.d.ts +207 -66
- package/package.json +6 -6
package/lib/rules/no-tabs.js
CHANGED
@@ -24,7 +24,7 @@ module.exports = {
|
|
24
24
|
message: "Formatting rules are being moved out of ESLint core.",
|
25
25
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
26
26
|
deprecatedSince: "8.53.0",
|
27
|
-
availableUntil: "
|
27
|
+
availableUntil: "11.0.0",
|
28
28
|
replacedBy: [
|
29
29
|
{
|
30
30
|
message:
|
@@ -30,7 +30,7 @@ module.exports = {
|
|
30
30
|
message: "Formatting rules are being moved out of ESLint core.",
|
31
31
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
32
32
|
deprecatedSince: "8.53.0",
|
33
|
-
availableUntil: "
|
33
|
+
availableUntil: "11.0.0",
|
34
34
|
replacedBy: [
|
35
35
|
{
|
36
36
|
message:
|
@@ -22,7 +22,7 @@ module.exports = {
|
|
22
22
|
message: "Formatting rules are being moved out of ESLint core.",
|
23
23
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
24
24
|
deprecatedSince: "8.53.0",
|
25
|
-
availableUntil: "
|
25
|
+
availableUntil: "11.0.0",
|
26
26
|
replacedBy: [
|
27
27
|
{
|
28
28
|
message:
|
@@ -18,7 +18,7 @@ module.exports = {
|
|
18
18
|
message: "Formatting rules are being moved out of ESLint core.",
|
19
19
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
20
20
|
deprecatedSince: "8.53.0",
|
21
|
-
availableUntil: "
|
21
|
+
availableUntil: "11.0.0",
|
22
22
|
replacedBy: [
|
23
23
|
{
|
24
24
|
message:
|
@@ -162,7 +162,7 @@ module.exports = {
|
|
162
162
|
message: "Formatting rules are being moved out of ESLint core.",
|
163
163
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
164
164
|
deprecatedSince: "8.53.0",
|
165
|
-
availableUntil: "
|
165
|
+
availableUntil: "11.0.0",
|
166
166
|
replacedBy: [
|
167
167
|
{
|
168
168
|
message:
|
@@ -18,7 +18,7 @@ module.exports = {
|
|
18
18
|
message: "Formatting rules are being moved out of ESLint core.",
|
19
19
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
20
20
|
deprecatedSince: "8.53.0",
|
21
|
-
availableUntil: "
|
21
|
+
availableUntil: "11.0.0",
|
22
22
|
replacedBy: [
|
23
23
|
{
|
24
24
|
message:
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
message: "Formatting rules are being moved out of ESLint core.",
|
18
18
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
19
19
|
deprecatedSince: "8.53.0",
|
20
|
-
availableUntil: "
|
20
|
+
availableUntil: "11.0.0",
|
21
21
|
replacedBy: [
|
22
22
|
{
|
23
23
|
message:
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
16
16
|
message: "Formatting rules are being moved out of ESLint core.",
|
17
17
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
18
18
|
deprecatedSince: "8.53.0",
|
19
|
-
availableUntil: "
|
19
|
+
availableUntil: "11.0.0",
|
20
20
|
replacedBy: [
|
21
21
|
{
|
22
22
|
message:
|
@@ -23,7 +23,7 @@ module.exports = {
|
|
23
23
|
message: "Formatting rules are being moved out of ESLint core.",
|
24
24
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
25
25
|
deprecatedSince: "8.53.0",
|
26
|
-
availableUntil: "
|
26
|
+
availableUntil: "11.0.0",
|
27
27
|
replacedBy: [
|
28
28
|
{
|
29
29
|
message:
|
@@ -23,7 +23,7 @@ module.exports = {
|
|
23
23
|
message: "Formatting rules are being moved out of ESLint core.",
|
24
24
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
25
25
|
deprecatedSince: "8.53.0",
|
26
|
-
availableUntil: "
|
26
|
+
availableUntil: "11.0.0",
|
27
27
|
replacedBy: [
|
28
28
|
{
|
29
29
|
message:
|
@@ -393,7 +393,7 @@ module.exports = {
|
|
393
393
|
message: "Formatting rules are being moved out of ESLint core.",
|
394
394
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
395
395
|
deprecatedSince: "8.53.0",
|
396
|
-
availableUntil: "
|
396
|
+
availableUntil: "11.0.0",
|
397
397
|
replacedBy: [
|
398
398
|
{
|
399
399
|
message:
|
@@ -10,9 +10,15 @@
|
|
10
10
|
|
11
11
|
const astUtils = require("./utils/ast-utils");
|
12
12
|
|
13
|
-
|
13
|
+
//------------------------------------------------------------------------------
|
14
|
+
// Types
|
15
|
+
//------------------------------------------------------------------------------
|
16
|
+
|
17
|
+
/** @typedef {import("estree").Node} ASTNode */
|
18
|
+
|
19
|
+
//------------------------------------------------------------------------------
|
14
20
|
// Helpers
|
15
|
-
|
21
|
+
//------------------------------------------------------------------------------
|
16
22
|
|
17
23
|
/*
|
18
24
|
* This is an indicator of an error cause node, that is too complicated to be detected and fixed.
|
@@ -32,9 +38,11 @@ const BUILT_IN_ERROR_TYPES = new Set([
|
|
32
38
|
]);
|
33
39
|
|
34
40
|
/**
|
35
|
-
* Finds and returns
|
41
|
+
* Finds and returns information about the `cause` property of an error being thrown.
|
36
42
|
* @param {ASTNode} throwStatement `ThrowStatement` to be checked.
|
37
|
-
* @returns {ASTNode | UNKNOWN_CAUSE | null}
|
43
|
+
* @returns {{ value: ASTNode; multipleDefinitions: boolean; } | UNKNOWN_CAUSE | null}
|
44
|
+
* Information about the `cause` of the error being thrown, such as the value node and
|
45
|
+
* whether there are multiple definitions of `cause`. `null` if there is no `cause`.
|
38
46
|
*/
|
39
47
|
function getErrorCause(throwStatement) {
|
40
48
|
const throwExpression = throwStatement.argument;
|
@@ -73,15 +81,17 @@ function getErrorCause(throwStatement) {
|
|
73
81
|
return UNKNOWN_CAUSE;
|
74
82
|
}
|
75
83
|
|
76
|
-
const
|
77
|
-
prop =>
|
78
|
-
prop.type === "Property" &&
|
79
|
-
prop.key.type === "Identifier" &&
|
80
|
-
prop.key.name === "cause" &&
|
81
|
-
!prop.computed, // It is hard to accurately identify the value of computed props
|
84
|
+
const causeProperties = errorOptions.properties.filter(
|
85
|
+
prop => astUtils.getStaticPropertyName(prop) === "cause",
|
82
86
|
);
|
83
87
|
|
84
|
-
|
88
|
+
const causeProperty = causeProperties.at(-1);
|
89
|
+
return causeProperty
|
90
|
+
? {
|
91
|
+
value: causeProperty.value,
|
92
|
+
multipleDefinitions: causeProperties.length > 1,
|
93
|
+
}
|
94
|
+
: null;
|
85
95
|
}
|
86
96
|
|
87
97
|
// Error options exist, but too complicated to be analyzed/fixed
|
@@ -138,6 +148,13 @@ function findParentCatch(node) {
|
|
138
148
|
module.exports = {
|
139
149
|
meta: {
|
140
150
|
type: "suggestion",
|
151
|
+
|
152
|
+
defaultOptions: [
|
153
|
+
{
|
154
|
+
requireCatchParameter: false,
|
155
|
+
},
|
156
|
+
],
|
157
|
+
|
141
158
|
docs: {
|
142
159
|
description:
|
143
160
|
"Disallow losing originally caught error when re-throwing custom errors",
|
@@ -158,7 +175,6 @@ module.exports = {
|
|
158
175
|
properties: {
|
159
176
|
requireCatchParameter: {
|
160
177
|
type: "boolean",
|
161
|
-
default: false,
|
162
178
|
description:
|
163
179
|
"Requires the catch blocks to always have the caught error parameter so it is not discarded.",
|
164
180
|
},
|
@@ -185,7 +201,7 @@ module.exports = {
|
|
185
201
|
|
186
202
|
create(context) {
|
187
203
|
const sourceCode = context.sourceCode;
|
188
|
-
const
|
204
|
+
const [{ requireCatchParameter }] = context.options;
|
189
205
|
|
190
206
|
//----------------------------------------------------------------------
|
191
207
|
// Helpers
|
@@ -273,7 +289,7 @@ module.exports = {
|
|
273
289
|
|
274
290
|
// Check if there are throw statements and caught error is being ignored
|
275
291
|
if (!caughtError) {
|
276
|
-
if (
|
292
|
+
if (requireCatchParameter) {
|
277
293
|
context.report({
|
278
294
|
node: throwStatement,
|
279
295
|
messageId: "missingCatchErrorParam",
|
@@ -284,14 +300,14 @@ module.exports = {
|
|
284
300
|
}
|
285
301
|
|
286
302
|
// Check if there is a cause attached to the new error
|
287
|
-
const
|
303
|
+
const errorCauseInfo = getErrorCause(throwStatement);
|
288
304
|
|
289
|
-
if (
|
305
|
+
if (errorCauseInfo === UNKNOWN_CAUSE) {
|
290
306
|
// Error options exist, but too complicated to be analyzed/fixed
|
291
307
|
return;
|
292
308
|
}
|
293
309
|
|
294
|
-
if (
|
310
|
+
if (errorCauseInfo === null) {
|
295
311
|
// If there is no `cause` attached to the error being thrown.
|
296
312
|
context.report({
|
297
313
|
messageId: "missingCause",
|
@@ -433,42 +449,52 @@ module.exports = {
|
|
433
449
|
return;
|
434
450
|
}
|
435
451
|
|
436
|
-
|
452
|
+
const { value: thrownErrorCause } = errorCauseInfo;
|
453
|
+
|
454
|
+
// If there is an attached cause, verify that it matches the caught error
|
437
455
|
if (
|
438
456
|
!(
|
439
457
|
thrownErrorCause.type === "Identifier" &&
|
440
458
|
thrownErrorCause.name === caughtError.name
|
441
459
|
)
|
442
460
|
) {
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
461
|
+
const suggest = errorCauseInfo.multipleDefinitions
|
462
|
+
? null // If there are multiple `cause` definitions, a suggestion could be confusing.
|
463
|
+
: [
|
464
|
+
{
|
465
|
+
messageId: "includeCause",
|
466
|
+
fix(fixer) {
|
467
|
+
/*
|
468
|
+
* In case `cause` is attached using object property shorthand or as a method or accessor.
|
469
|
+
* e.g. throw Error("fail", { cause });
|
470
|
+
* throw Error("fail", { cause() { doSomething(); } });
|
471
|
+
* throw Error("fail", { get cause() { return error; } });
|
472
|
+
*/
|
473
|
+
if (
|
474
|
+
thrownErrorCause.parent
|
475
|
+
.method ||
|
476
|
+
thrownErrorCause.parent
|
477
|
+
.shorthand ||
|
478
|
+
thrownErrorCause.parent.kind !==
|
479
|
+
"init"
|
480
|
+
) {
|
481
|
+
return fixer.replaceText(
|
482
|
+
thrownErrorCause.parent,
|
483
|
+
`cause: ${caughtError.name}`,
|
484
|
+
);
|
485
|
+
}
|
486
|
+
|
459
487
|
return fixer.replaceText(
|
460
|
-
thrownErrorCause
|
461
|
-
|
488
|
+
thrownErrorCause,
|
489
|
+
caughtError.name,
|
462
490
|
);
|
463
|
-
}
|
464
|
-
|
465
|
-
return fixer.replaceText(
|
466
|
-
thrownErrorCause,
|
467
|
-
caughtError.name,
|
468
|
-
);
|
491
|
+
},
|
469
492
|
},
|
470
|
-
|
471
|
-
|
493
|
+
];
|
494
|
+
context.report({
|
495
|
+
messageId: "incorrectCause",
|
496
|
+
node: thrownErrorCause,
|
497
|
+
suggest,
|
472
498
|
});
|
473
499
|
return;
|
474
500
|
}
|
package/lib/rules/quote-props.js
CHANGED
@@ -24,7 +24,7 @@ module.exports = {
|
|
24
24
|
message: "Formatting rules are being moved out of ESLint core.",
|
25
25
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
26
26
|
deprecatedSince: "8.53.0",
|
27
|
-
availableUntil: "
|
27
|
+
availableUntil: "11.0.0",
|
28
28
|
replacedBy: [
|
29
29
|
{
|
30
30
|
message:
|
package/lib/rules/quotes.js
CHANGED
@@ -101,7 +101,7 @@ module.exports = {
|
|
101
101
|
message: "Formatting rules are being moved out of ESLint core.",
|
102
102
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
103
103
|
deprecatedSince: "8.53.0",
|
104
|
-
availableUntil: "
|
104
|
+
availableUntil: "11.0.0",
|
105
105
|
replacedBy: [
|
106
106
|
{
|
107
107
|
message:
|
@@ -47,6 +47,8 @@ module.exports = {
|
|
47
47
|
meta: {
|
48
48
|
type: "suggestion",
|
49
49
|
|
50
|
+
defaultOptions: [{}],
|
51
|
+
|
50
52
|
docs: {
|
51
53
|
description:
|
52
54
|
"Enforce the use of `u` or `v` flag on regular expressions",
|
@@ -79,7 +81,7 @@ module.exports = {
|
|
79
81
|
create(context) {
|
80
82
|
const sourceCode = context.sourceCode;
|
81
83
|
|
82
|
-
const { requireFlag } = context.options
|
84
|
+
const [{ requireFlag }] = context.options;
|
83
85
|
|
84
86
|
return {
|
85
87
|
"Literal[regex]"(node) {
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
message: "Formatting rules are being moved out of ESLint core.",
|
18
18
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
19
19
|
deprecatedSince: "8.53.0",
|
20
|
-
availableUntil: "
|
20
|
+
availableUntil: "11.0.0",
|
21
21
|
replacedBy: [
|
22
22
|
{
|
23
23
|
message:
|
@@ -19,7 +19,7 @@ module.exports = {
|
|
19
19
|
message: "Formatting rules are being moved out of ESLint core.",
|
20
20
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
21
21
|
deprecatedSince: "8.53.0",
|
22
|
-
availableUntil: "
|
22
|
+
availableUntil: "11.0.0",
|
23
23
|
replacedBy: [
|
24
24
|
{
|
25
25
|
message:
|
package/lib/rules/semi-style.js
CHANGED
@@ -89,7 +89,7 @@ module.exports = {
|
|
89
89
|
message: "Formatting rules are being moved out of ESLint core.",
|
90
90
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
91
91
|
deprecatedSince: "8.53.0",
|
92
|
-
availableUntil: "
|
92
|
+
availableUntil: "11.0.0",
|
93
93
|
replacedBy: [
|
94
94
|
{
|
95
95
|
message:
|
package/lib/rules/semi.js
CHANGED
@@ -23,7 +23,7 @@ module.exports = {
|
|
23
23
|
message: "Formatting rules are being moved out of ESLint core.",
|
24
24
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
25
25
|
deprecatedSince: "8.53.0",
|
26
|
-
availableUntil: "
|
26
|
+
availableUntil: "11.0.0",
|
27
27
|
replacedBy: [
|
28
28
|
{
|
29
29
|
message:
|
@@ -42,7 +42,7 @@ module.exports = {
|
|
42
42
|
message: "Formatting rules are being moved out of ESLint core.",
|
43
43
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
44
44
|
deprecatedSince: "8.53.0",
|
45
|
-
availableUntil: "
|
45
|
+
availableUntil: "11.0.0",
|
46
46
|
replacedBy: [
|
47
47
|
{
|
48
48
|
message:
|
@@ -22,7 +22,7 @@ module.exports = {
|
|
22
22
|
message: "Formatting rules are being moved out of ESLint core.",
|
23
23
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
24
24
|
deprecatedSince: "8.53.0",
|
25
|
-
availableUntil: "
|
25
|
+
availableUntil: "11.0.0",
|
26
26
|
replacedBy: [
|
27
27
|
{
|
28
28
|
message:
|
@@ -18,7 +18,7 @@ module.exports = {
|
|
18
18
|
message: "Formatting rules are being moved out of ESLint core.",
|
19
19
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
20
20
|
deprecatedSince: "8.53.0",
|
21
|
-
availableUntil: "
|
21
|
+
availableUntil: "11.0.0",
|
22
22
|
replacedBy: [
|
23
23
|
{
|
24
24
|
message:
|
@@ -18,7 +18,7 @@ module.exports = {
|
|
18
18
|
message: "Formatting rules are being moved out of ESLint core.",
|
19
19
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
20
20
|
deprecatedSince: "8.53.0",
|
21
|
-
availableUntil: "
|
21
|
+
availableUntil: "11.0.0",
|
22
22
|
replacedBy: [
|
23
23
|
{
|
24
24
|
message:
|
@@ -22,7 +22,7 @@ module.exports = {
|
|
22
22
|
message: "Formatting rules are being moved out of ESLint core.",
|
23
23
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
24
24
|
deprecatedSince: "8.53.0",
|
25
|
-
availableUntil: "
|
25
|
+
availableUntil: "11.0.0",
|
26
26
|
replacedBy: [
|
27
27
|
{
|
28
28
|
message:
|
@@ -147,7 +147,7 @@ module.exports = {
|
|
147
147
|
message: "Formatting rules are being moved out of ESLint core.",
|
148
148
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
149
149
|
deprecatedSince: "8.53.0",
|
150
|
-
availableUntil: "
|
150
|
+
availableUntil: "11.0.0",
|
151
151
|
replacedBy: [
|
152
152
|
{
|
153
153
|
message:
|
@@ -23,7 +23,7 @@ module.exports = {
|
|
23
23
|
message: "Formatting rules are being moved out of ESLint core.",
|
24
24
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
25
25
|
deprecatedSince: "8.53.0",
|
26
|
-
availableUntil: "
|
26
|
+
availableUntil: "11.0.0",
|
27
27
|
replacedBy: [
|
28
28
|
{
|
29
29
|
message:
|
@@ -23,7 +23,7 @@ module.exports = {
|
|
23
23
|
message: "Formatting rules are being moved out of ESLint core.",
|
24
24
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
25
25
|
deprecatedSince: "8.53.0",
|
26
|
-
availableUntil: "
|
26
|
+
availableUntil: "11.0.0",
|
27
27
|
replacedBy: [
|
28
28
|
{
|
29
29
|
message:
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
message: "Formatting rules are being moved out of ESLint core.",
|
18
18
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
19
19
|
deprecatedSince: "8.53.0",
|
20
|
-
availableUntil: "
|
20
|
+
availableUntil: "11.0.0",
|
21
21
|
replacedBy: [
|
22
22
|
{
|
23
23
|
message:
|
package/lib/rules/wrap-iife.js
CHANGED
@@ -44,7 +44,7 @@ module.exports = {
|
|
44
44
|
message: "Formatting rules are being moved out of ESLint core.",
|
45
45
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
46
46
|
deprecatedSince: "8.53.0",
|
47
|
-
availableUntil: "
|
47
|
+
availableUntil: "11.0.0",
|
48
48
|
replacedBy: [
|
49
49
|
{
|
50
50
|
message:
|
package/lib/rules/wrap-regex.js
CHANGED
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
message: "Formatting rules are being moved out of ESLint core.",
|
18
18
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
19
19
|
deprecatedSince: "8.53.0",
|
20
|
-
availableUntil: "
|
20
|
+
availableUntil: "11.0.0",
|
21
21
|
replacedBy: [
|
22
22
|
{
|
23
23
|
message:
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
17
17
|
message: "Formatting rules are being moved out of ESLint core.",
|
18
18
|
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
19
19
|
deprecatedSince: "8.53.0",
|
20
|
-
availableUntil: "
|
20
|
+
availableUntil: "11.0.0",
|
21
21
|
replacedBy: [
|
22
22
|
{
|
23
23
|
message:
|
package/lib/types/index.d.ts
CHANGED
@@ -47,12 +47,14 @@ export namespace AST {
|
|
47
47
|
| "Boolean"
|
48
48
|
| "Null"
|
49
49
|
| "Identifier"
|
50
|
+
| "PrivateIdentifier"
|
50
51
|
| "Keyword"
|
51
52
|
| "Punctuator"
|
52
53
|
| "JSXIdentifier"
|
53
54
|
| "JSXText"
|
54
55
|
| "Numeric"
|
55
56
|
| "String"
|
57
|
+
| "Template"
|
56
58
|
| "RegularExpression";
|
57
59
|
|
58
60
|
interface Token {
|
@@ -92,6 +94,8 @@ export namespace Scope {
|
|
92
94
|
| "block"
|
93
95
|
| "catch"
|
94
96
|
| "class"
|
97
|
+
| "class-field-initializer"
|
98
|
+
| "class-static-block"
|
95
99
|
| "for"
|
96
100
|
| "function"
|
97
101
|
| "function-expression-name"
|
@@ -1961,7 +1965,7 @@ export class ESLint {
|
|
1961
1965
|
|
1962
1966
|
calculateConfigForFile(filePath: string): Promise<any>;
|
1963
1967
|
|
1964
|
-
findConfigFile(): Promise<string | undefined>;
|
1968
|
+
findConfigFile(filePath?: string): Promise<string | undefined>;
|
1965
1969
|
|
1966
1970
|
isPathIgnored(filePath: string): Promise<boolean>;
|
1967
1971
|
|
@@ -2043,7 +2047,7 @@ export namespace ESLint {
|
|
2043
2047
|
|
2044
2048
|
// Autofix
|
2045
2049
|
fix?: boolean | ((message: Linter.LintMessage) => boolean) | undefined;
|
2046
|
-
fixTypes?: FixType[] | undefined;
|
2050
|
+
fixTypes?: FixType[] | null | undefined;
|
2047
2051
|
|
2048
2052
|
// Cache-related
|
2049
2053
|
cache?: boolean | undefined;
|
@@ -2077,7 +2081,7 @@ export namespace ESLint {
|
|
2077
2081
|
|
2078
2082
|
// Autofix
|
2079
2083
|
fix?: boolean | ((message: Linter.LintMessage) => boolean) | undefined;
|
2080
|
-
fixTypes?: FixType[] | undefined;
|
2084
|
+
fixTypes?: FixType[] | null | undefined;
|
2081
2085
|
|
2082
2086
|
// Cache-related
|
2083
2087
|
cache?: boolean | undefined;
|
@@ -2166,9 +2170,10 @@ export namespace ESLint {
|
|
2166
2170
|
|
2167
2171
|
/**
|
2168
2172
|
* The raw deprecated info provided by the rule.
|
2169
|
-
*
|
2173
|
+
* - Undefined if the rule's `meta.deprecated` property is a boolean.
|
2174
|
+
* - Unset when using the legacy eslintrc configuration.
|
2170
2175
|
*/
|
2171
|
-
info?: DeprecatedInfo;
|
2176
|
+
info?: DeprecatedInfo | undefined;
|
2172
2177
|
}
|
2173
2178
|
|
2174
2179
|
/**
|