eslint 9.35.0 → 9.36.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
CHANGED
@@ -277,6 +277,11 @@ Nitin Kumar
|
|
277
277
|
The people who review and fix bugs and help triage issues.
|
278
278
|
|
279
279
|
<table><tbody><tr><td align="center" valign="top" width="11%">
|
280
|
+
<a href="https://github.com/DMartens">
|
281
|
+
<img src="https://github.com/DMartens.png?s=75" width="75" height="75" alt="fnx's Avatar"><br />
|
282
|
+
fnx
|
283
|
+
</a>
|
284
|
+
</td><td align="center" valign="top" width="11%">
|
280
285
|
<a href="https://github.com/JoshuaKGoldberg">
|
281
286
|
<img src="https://github.com/JoshuaKGoldberg.png?s=75" width="75" height="75" alt="Josh Goldberg ✨'s Avatar"><br />
|
282
287
|
Josh Goldberg ✨
|
@@ -328,7 +333,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
|
328
333
|
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
|
329
334
|
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
|
330
335
|
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
|
331
|
-
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://
|
336
|
+
<p><a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
332
337
|
<h3>Technology Sponsors</h3>
|
333
338
|
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
|
334
339
|
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
|
@@ -278,6 +278,12 @@ module.exports = {
|
|
278
278
|
meta: {
|
279
279
|
type: "problem",
|
280
280
|
|
281
|
+
defaultOptions: [
|
282
|
+
{
|
283
|
+
allowEscape: false,
|
284
|
+
},
|
285
|
+
],
|
286
|
+
|
281
287
|
docs: {
|
282
288
|
description:
|
283
289
|
"Disallow characters which are made with multiple code points in character class syntax",
|
@@ -293,7 +299,6 @@ module.exports = {
|
|
293
299
|
properties: {
|
294
300
|
allowEscape: {
|
295
301
|
type: "boolean",
|
296
|
-
default: false,
|
297
302
|
},
|
298
303
|
},
|
299
304
|
additionalProperties: false,
|
@@ -313,7 +318,7 @@ module.exports = {
|
|
313
318
|
},
|
314
319
|
},
|
315
320
|
create(context) {
|
316
|
-
const allowEscape = context.options
|
321
|
+
const [{ allowEscape }] = context.options;
|
317
322
|
const sourceCode = context.sourceCode;
|
318
323
|
const parser = new RegExpParser();
|
319
324
|
const checkedPatternNodes = new Set();
|
@@ -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,7 +81,7 @@ function getErrorCause(throwStatement) {
|
|
73
81
|
return UNKNOWN_CAUSE;
|
74
82
|
}
|
75
83
|
|
76
|
-
const
|
84
|
+
const causeProperties = errorOptions.properties.filter(
|
77
85
|
prop =>
|
78
86
|
prop.type === "Property" &&
|
79
87
|
prop.key.type === "Identifier" &&
|
@@ -81,7 +89,13 @@ function getErrorCause(throwStatement) {
|
|
81
89
|
!prop.computed, // It is hard to accurately identify the value of computed props
|
82
90
|
);
|
83
91
|
|
84
|
-
|
92
|
+
const causeProperty = causeProperties.at(-1);
|
93
|
+
return causeProperty
|
94
|
+
? {
|
95
|
+
value: causeProperty.value,
|
96
|
+
multipleDefinitions: causeProperties.length > 1,
|
97
|
+
}
|
98
|
+
: null;
|
85
99
|
}
|
86
100
|
|
87
101
|
// Error options exist, but too complicated to be analyzed/fixed
|
@@ -138,6 +152,13 @@ function findParentCatch(node) {
|
|
138
152
|
module.exports = {
|
139
153
|
meta: {
|
140
154
|
type: "suggestion",
|
155
|
+
|
156
|
+
defaultOptions: [
|
157
|
+
{
|
158
|
+
requireCatchParameter: false,
|
159
|
+
},
|
160
|
+
],
|
161
|
+
|
141
162
|
docs: {
|
142
163
|
description:
|
143
164
|
"Disallow losing originally caught error when re-throwing custom errors",
|
@@ -158,7 +179,6 @@ module.exports = {
|
|
158
179
|
properties: {
|
159
180
|
requireCatchParameter: {
|
160
181
|
type: "boolean",
|
161
|
-
default: false,
|
162
182
|
description:
|
163
183
|
"Requires the catch blocks to always have the caught error parameter so it is not discarded.",
|
164
184
|
},
|
@@ -185,7 +205,7 @@ module.exports = {
|
|
185
205
|
|
186
206
|
create(context) {
|
187
207
|
const sourceCode = context.sourceCode;
|
188
|
-
const
|
208
|
+
const [{ requireCatchParameter }] = context.options;
|
189
209
|
|
190
210
|
//----------------------------------------------------------------------
|
191
211
|
// Helpers
|
@@ -273,7 +293,7 @@ module.exports = {
|
|
273
293
|
|
274
294
|
// Check if there are throw statements and caught error is being ignored
|
275
295
|
if (!caughtError) {
|
276
|
-
if (
|
296
|
+
if (requireCatchParameter) {
|
277
297
|
context.report({
|
278
298
|
node: throwStatement,
|
279
299
|
messageId: "missingCatchErrorParam",
|
@@ -284,14 +304,14 @@ module.exports = {
|
|
284
304
|
}
|
285
305
|
|
286
306
|
// Check if there is a cause attached to the new error
|
287
|
-
const
|
307
|
+
const errorCauseInfo = getErrorCause(throwStatement);
|
288
308
|
|
289
|
-
if (
|
309
|
+
if (errorCauseInfo === UNKNOWN_CAUSE) {
|
290
310
|
// Error options exist, but too complicated to be analyzed/fixed
|
291
311
|
return;
|
292
312
|
}
|
293
313
|
|
294
|
-
if (
|
314
|
+
if (errorCauseInfo === null) {
|
295
315
|
// If there is no `cause` attached to the error being thrown.
|
296
316
|
context.report({
|
297
317
|
messageId: "missingCause",
|
@@ -433,42 +453,52 @@ module.exports = {
|
|
433
453
|
return;
|
434
454
|
}
|
435
455
|
|
436
|
-
|
456
|
+
const { value: thrownErrorCause } = errorCauseInfo;
|
457
|
+
|
458
|
+
// If there is an attached cause, verify that it matches the caught error
|
437
459
|
if (
|
438
460
|
!(
|
439
461
|
thrownErrorCause.type === "Identifier" &&
|
440
462
|
thrownErrorCause.name === caughtError.name
|
441
463
|
)
|
442
464
|
) {
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
465
|
+
const suggest = errorCauseInfo.multipleDefinitions
|
466
|
+
? null // If there are multiple `cause` definitions, a suggestion could be confusing.
|
467
|
+
: [
|
468
|
+
{
|
469
|
+
messageId: "includeCause",
|
470
|
+
fix(fixer) {
|
471
|
+
/*
|
472
|
+
* In case `cause` is attached using object property shorthand or as a method or accessor.
|
473
|
+
* e.g. throw Error("fail", { cause });
|
474
|
+
* throw Error("fail", { cause() { doSomething(); } });
|
475
|
+
* throw Error("fail", { get cause() { return error; } });
|
476
|
+
*/
|
477
|
+
if (
|
478
|
+
thrownErrorCause.parent
|
479
|
+
.method ||
|
480
|
+
thrownErrorCause.parent
|
481
|
+
.shorthand ||
|
482
|
+
thrownErrorCause.parent.kind !==
|
483
|
+
"init"
|
484
|
+
) {
|
485
|
+
return fixer.replaceText(
|
486
|
+
thrownErrorCause.parent,
|
487
|
+
`cause: ${caughtError.name}`,
|
488
|
+
);
|
489
|
+
}
|
490
|
+
|
459
491
|
return fixer.replaceText(
|
460
|
-
thrownErrorCause
|
461
|
-
|
492
|
+
thrownErrorCause,
|
493
|
+
caughtError.name,
|
462
494
|
);
|
463
|
-
}
|
464
|
-
|
465
|
-
return fixer.replaceText(
|
466
|
-
thrownErrorCause,
|
467
|
-
caughtError.name,
|
468
|
-
);
|
495
|
+
},
|
469
496
|
},
|
470
|
-
|
471
|
-
|
497
|
+
];
|
498
|
+
context.report({
|
499
|
+
messageId: "incorrectCause",
|
500
|
+
node: thrownErrorCause,
|
501
|
+
suggest,
|
472
502
|
});
|
473
503
|
return;
|
474
504
|
}
|
@@ -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) {
|
package/lib/types/index.d.ts
CHANGED
package/lib/types/rules.d.ts
CHANGED
@@ -84,6 +84,18 @@ type ValidNoRestrictedImportPatternOptions =
|
|
84
84
|
EitherGroupOrRegEx &
|
85
85
|
EitherNameSpecifiers;
|
86
86
|
|
87
|
+
interface CapitalizedCommentsCommonOptions {
|
88
|
+
ignorePattern?: string;
|
89
|
+
/**
|
90
|
+
* @default false
|
91
|
+
*/
|
92
|
+
ignoreInlineComments?: boolean;
|
93
|
+
/**
|
94
|
+
* @default false
|
95
|
+
*/
|
96
|
+
ignoreConsecutiveComments?: boolean;
|
97
|
+
}
|
98
|
+
|
87
99
|
//-----------------------------------------------------------------------------
|
88
100
|
// Public types
|
89
101
|
//-----------------------------------------------------------------------------
|
@@ -396,17 +408,13 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
396
408
|
"capitalized-comments": Linter.RuleEntry<
|
397
409
|
[
|
398
410
|
"always" | "never",
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
* @default false
|
407
|
-
*/
|
408
|
-
ignoreConsecutiveComments: boolean;
|
409
|
-
}>,
|
411
|
+
(
|
412
|
+
| CapitalizedCommentsCommonOptions
|
413
|
+
| Partial<{
|
414
|
+
line: CapitalizedCommentsCommonOptions;
|
415
|
+
block: CapitalizedCommentsCommonOptions;
|
416
|
+
}>
|
417
|
+
),
|
410
418
|
]
|
411
419
|
>;
|
412
420
|
|
@@ -1014,6 +1022,7 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
1014
1022
|
*/
|
1015
1023
|
properties: "always" | "never";
|
1016
1024
|
exceptions: string[];
|
1025
|
+
exceptionPatterns: string[];
|
1017
1026
|
}>,
|
1018
1027
|
]
|
1019
1028
|
>;
|
@@ -1032,6 +1041,10 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
1032
1041
|
* @default false
|
1033
1042
|
*/
|
1034
1043
|
properties: boolean;
|
1044
|
+
/**
|
1045
|
+
* @default false
|
1046
|
+
*/
|
1047
|
+
classFields: boolean;
|
1035
1048
|
/**
|
1036
1049
|
* @default false
|
1037
1050
|
*/
|
@@ -1655,7 +1668,21 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
1655
1668
|
* @since 5.0.0-alpha.3
|
1656
1669
|
* @see https://eslint.org/docs/latest/rules/max-classes-per-file
|
1657
1670
|
*/
|
1658
|
-
"max-classes-per-file": Linter.RuleEntry<
|
1671
|
+
"max-classes-per-file": Linter.RuleEntry<
|
1672
|
+
[
|
1673
|
+
| number
|
1674
|
+
| Partial<{
|
1675
|
+
/**
|
1676
|
+
* @default false
|
1677
|
+
*/
|
1678
|
+
ignoreExpressions: boolean;
|
1679
|
+
/**
|
1680
|
+
* @default 1
|
1681
|
+
*/
|
1682
|
+
max: number;
|
1683
|
+
}>,
|
1684
|
+
]
|
1685
|
+
>;
|
1659
1686
|
|
1660
1687
|
/**
|
1661
1688
|
* Rule to enforce a maximum depth that blocks can be nested.
|
@@ -1665,12 +1692,18 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
1665
1692
|
*/
|
1666
1693
|
"max-depth": Linter.RuleEntry<
|
1667
1694
|
[
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1695
|
+
| number
|
1696
|
+
| Partial<{
|
1697
|
+
/**
|
1698
|
+
* @deprecated
|
1699
|
+
* @default 4
|
1700
|
+
*/
|
1701
|
+
maximum: number;
|
1702
|
+
/**
|
1703
|
+
* @default 4
|
1704
|
+
*/
|
1705
|
+
max: number;
|
1706
|
+
}>,
|
1674
1707
|
]
|
1675
1708
|
>;
|
1676
1709
|
|
@@ -1758,24 +1791,25 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
1758
1791
|
*/
|
1759
1792
|
"max-lines-per-function": Linter.RuleEntry<
|
1760
1793
|
[
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1794
|
+
| number
|
1795
|
+
| Partial<{
|
1796
|
+
/**
|
1797
|
+
* @default 50
|
1798
|
+
*/
|
1799
|
+
max: number;
|
1800
|
+
/**
|
1801
|
+
* @default false
|
1802
|
+
*/
|
1803
|
+
skipBlankLines: boolean;
|
1804
|
+
/**
|
1805
|
+
* @default false
|
1806
|
+
*/
|
1807
|
+
skipComments: boolean;
|
1808
|
+
/**
|
1809
|
+
* @default false
|
1810
|
+
*/
|
1811
|
+
IIFEs: boolean;
|
1812
|
+
}>,
|
1779
1813
|
]
|
1780
1814
|
>;
|
1781
1815
|
|
@@ -1787,13 +1821,18 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
1787
1821
|
*/
|
1788
1822
|
"max-nested-callbacks": Linter.RuleEntry<
|
1789
1823
|
[
|
1824
|
+
| number
|
1790
1825
|
| Partial<{
|
1826
|
+
/**
|
1827
|
+
* @deprecated
|
1828
|
+
* @default 10
|
1829
|
+
*/
|
1830
|
+
maximum: number;
|
1791
1831
|
/**
|
1792
1832
|
* @default 10
|
1793
1833
|
*/
|
1794
1834
|
max: number;
|
1795
|
-
}
|
1796
|
-
| number,
|
1835
|
+
}>,
|
1797
1836
|
]
|
1798
1837
|
>;
|
1799
1838
|
|
@@ -1805,7 +1844,13 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
1805
1844
|
*/
|
1806
1845
|
"max-params": Linter.RuleEntry<
|
1807
1846
|
[
|
1847
|
+
| number
|
1808
1848
|
| Partial<{
|
1849
|
+
/**
|
1850
|
+
* @deprecated
|
1851
|
+
* @default 3
|
1852
|
+
*/
|
1853
|
+
maximum: number;
|
1809
1854
|
/**
|
1810
1855
|
* @default 3
|
1811
1856
|
*/
|
@@ -1814,8 +1859,7 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
1814
1859
|
* @default false
|
1815
1860
|
*/
|
1816
1861
|
countVoidThis: boolean;
|
1817
|
-
}
|
1818
|
-
| number,
|
1862
|
+
}>,
|
1819
1863
|
]
|
1820
1864
|
>;
|
1821
1865
|
|
@@ -1827,17 +1871,26 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
1827
1871
|
*/
|
1828
1872
|
"max-statements": Linter.RuleEntry<
|
1829
1873
|
[
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1874
|
+
(
|
1875
|
+
| number
|
1876
|
+
| Partial<{
|
1877
|
+
/**
|
1878
|
+
* @deprecated
|
1879
|
+
* @default 10
|
1880
|
+
*/
|
1881
|
+
maximum: number;
|
1882
|
+
/**
|
1883
|
+
* @default 10
|
1884
|
+
*/
|
1885
|
+
max: number;
|
1886
|
+
}>
|
1887
|
+
),
|
1888
|
+
Partial<{
|
1889
|
+
/**
|
1890
|
+
* @default false
|
1891
|
+
*/
|
1892
|
+
ignoreTopLevelFunctions: boolean;
|
1893
|
+
}>,
|
1841
1894
|
]
|
1842
1895
|
>;
|
1843
1896
|
|
@@ -2014,7 +2067,24 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
2014
2067
|
"no-bitwise": Linter.RuleEntry<
|
2015
2068
|
[
|
2016
2069
|
Partial<{
|
2017
|
-
|
2070
|
+
/**
|
2071
|
+
* @default []
|
2072
|
+
*/
|
2073
|
+
allow: Array<
|
2074
|
+
| "^"
|
2075
|
+
| "|"
|
2076
|
+
| "&"
|
2077
|
+
| "<<"
|
2078
|
+
| ">>"
|
2079
|
+
| ">>>"
|
2080
|
+
| "^="
|
2081
|
+
| "|="
|
2082
|
+
| "&="
|
2083
|
+
| "<<="
|
2084
|
+
| ">>="
|
2085
|
+
| ">>>="
|
2086
|
+
| "~"
|
2087
|
+
>;
|
2018
2088
|
/**
|
2019
2089
|
* @default false
|
2020
2090
|
*/
|
@@ -2166,9 +2236,9 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
2166
2236
|
[
|
2167
2237
|
{
|
2168
2238
|
/**
|
2169
|
-
* @default
|
2239
|
+
* @default "allExceptWhileTrue"
|
2170
2240
|
*/
|
2171
|
-
checkLoops: boolean;
|
2241
|
+
checkLoops: "all" | "allExceptWhileTrue" | "none" | boolean;
|
2172
2242
|
},
|
2173
2243
|
]
|
2174
2244
|
>;
|
@@ -2395,7 +2465,16 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
2395
2465
|
* @since 1.7.0
|
2396
2466
|
* @see https://eslint.org/docs/latest/rules/no-empty-pattern
|
2397
2467
|
*/
|
2398
|
-
"no-empty-pattern": Linter.RuleEntry<
|
2468
|
+
"no-empty-pattern": Linter.RuleEntry<
|
2469
|
+
[
|
2470
|
+
Partial<{
|
2471
|
+
/**
|
2472
|
+
* @default false
|
2473
|
+
*/
|
2474
|
+
allowObjectPatternsAsParameters: boolean;
|
2475
|
+
}>,
|
2476
|
+
]
|
2477
|
+
>;
|
2399
2478
|
|
2400
2479
|
/**
|
2401
2480
|
* Rule to disallow empty static blocks.
|
@@ -2668,7 +2747,16 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
2668
2747
|
* @since 2.0.0-alpha-1
|
2669
2748
|
* @see https://eslint.org/docs/latest/rules/no-implicit-globals
|
2670
2749
|
*/
|
2671
|
-
"no-implicit-globals": Linter.RuleEntry<
|
2750
|
+
"no-implicit-globals": Linter.RuleEntry<
|
2751
|
+
[
|
2752
|
+
Partial<{
|
2753
|
+
/**
|
2754
|
+
* @default false
|
2755
|
+
*/
|
2756
|
+
lexicalBindings: boolean;
|
2757
|
+
}>,
|
2758
|
+
]
|
2759
|
+
>;
|
2672
2760
|
|
2673
2761
|
/**
|
2674
2762
|
* Rule to disallow the use of `eval()`-like methods.
|
@@ -2695,7 +2783,13 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
2695
2783
|
* @since 0.10.0
|
2696
2784
|
* @see https://eslint.org/docs/latest/rules/no-inline-comments
|
2697
2785
|
*/
|
2698
|
-
"no-inline-comments": Linter.RuleEntry<
|
2786
|
+
"no-inline-comments": Linter.RuleEntry<
|
2787
|
+
[
|
2788
|
+
Partial<{
|
2789
|
+
ignorePattern: string;
|
2790
|
+
}>,
|
2791
|
+
]
|
2792
|
+
>;
|
2699
2793
|
|
2700
2794
|
/**
|
2701
2795
|
* Rule to disallow variable or `function` declarations in nested blocks.
|
@@ -2703,7 +2797,17 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
2703
2797
|
* @since 0.6.0
|
2704
2798
|
* @see https://eslint.org/docs/latest/rules/no-inner-declarations
|
2705
2799
|
*/
|
2706
|
-
"no-inner-declarations": Linter.RuleEntry<
|
2800
|
+
"no-inner-declarations": Linter.RuleEntry<
|
2801
|
+
[
|
2802
|
+
"functions" | "both",
|
2803
|
+
Partial<{
|
2804
|
+
/**
|
2805
|
+
* @default "allow"
|
2806
|
+
*/
|
2807
|
+
blockScopedFunctions: "allow" | "disallow";
|
2808
|
+
}>,
|
2809
|
+
]
|
2810
|
+
>;
|
2707
2811
|
|
2708
2812
|
/**
|
2709
2813
|
* Rule to disallow invalid regular expression strings in `RegExp` constructors.
|
@@ -2767,6 +2871,10 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
2767
2871
|
* @default false
|
2768
2872
|
*/
|
2769
2873
|
skipTemplates: boolean;
|
2874
|
+
/**
|
2875
|
+
* @default false
|
2876
|
+
*/
|
2877
|
+
skipJSXText: boolean;
|
2770
2878
|
}>,
|
2771
2879
|
]
|
2772
2880
|
>;
|
@@ -2855,11 +2963,19 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
2855
2963
|
/**
|
2856
2964
|
* @default []
|
2857
2965
|
*/
|
2858
|
-
ignore: number
|
2966
|
+
ignore: Array<number | string>;
|
2859
2967
|
/**
|
2860
2968
|
* @default false
|
2861
2969
|
*/
|
2862
2970
|
ignoreArrayIndexes: boolean;
|
2971
|
+
/**
|
2972
|
+
* @default false
|
2973
|
+
*/
|
2974
|
+
ignoreDefaultValues: boolean;
|
2975
|
+
/**
|
2976
|
+
* @default false
|
2977
|
+
*/
|
2978
|
+
ignoreClassFieldInitialValues: boolean;
|
2863
2979
|
/**
|
2864
2980
|
* @default false
|
2865
2981
|
*/
|
@@ -2981,7 +3097,16 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
2981
3097
|
* @since 3.14.0
|
2982
3098
|
* @see https://eslint.org/docs/latest/rules/no-multi-assign
|
2983
3099
|
*/
|
2984
|
-
"no-multi-assign": Linter.RuleEntry<
|
3100
|
+
"no-multi-assign": Linter.RuleEntry<
|
3101
|
+
[
|
3102
|
+
Partial<{
|
3103
|
+
/**
|
3104
|
+
* @default false
|
3105
|
+
*/
|
3106
|
+
ignoreNonDeclaration: boolean;
|
3107
|
+
}>,
|
3108
|
+
]
|
3109
|
+
>;
|
2985
3110
|
|
2986
3111
|
/**
|
2987
3112
|
* Rule to disallow multiple spaces.
|
@@ -3555,7 +3680,16 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
3555
3680
|
* @since 2.0.0-rc.0
|
3556
3681
|
* @see https://eslint.org/docs/latest/rules/no-self-assign
|
3557
3682
|
*/
|
3558
|
-
"no-self-assign": Linter.RuleEntry<
|
3683
|
+
"no-self-assign": Linter.RuleEntry<
|
3684
|
+
[
|
3685
|
+
Partial<{
|
3686
|
+
/**
|
3687
|
+
* @default true
|
3688
|
+
*/
|
3689
|
+
props: boolean;
|
3690
|
+
}>,
|
3691
|
+
]
|
3692
|
+
>;
|
3559
3693
|
|
3560
3694
|
/**
|
3561
3695
|
* Rule to disallow comparisons where both sides are exactly the same.
|
@@ -3929,12 +4063,13 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
3929
4063
|
/**
|
3930
4064
|
* @default []
|
3931
4065
|
*/
|
3932
|
-
ignore:
|
4066
|
+
ignore: Array<
|
3933
4067
|
| "WhileStatement"
|
3934
4068
|
| "DoWhileStatement"
|
3935
4069
|
| "ForStatement"
|
3936
4070
|
| "ForInStatement"
|
3937
|
-
| "ForOfStatement"
|
4071
|
+
| "ForOfStatement"
|
4072
|
+
>;
|
3938
4073
|
}>,
|
3939
4074
|
]
|
3940
4075
|
>;
|
@@ -4293,7 +4428,7 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
4293
4428
|
*/
|
4294
4429
|
"no-warning-comments": Linter.RuleEntry<
|
4295
4430
|
[
|
4296
|
-
{
|
4431
|
+
Partial<{
|
4297
4432
|
/**
|
4298
4433
|
* @default ["todo", "fixme", "xxx"]
|
4299
4434
|
*/
|
@@ -4302,7 +4437,8 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
4302
4437
|
* @default 'start'
|
4303
4438
|
*/
|
4304
4439
|
location: "start" | "anywhere";
|
4305
|
-
|
4440
|
+
decoration: string[];
|
4441
|
+
}>,
|
4306
4442
|
]
|
4307
4443
|
>;
|
4308
4444
|
|
@@ -4812,6 +4948,9 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
4812
4948
|
"preserve-caught-error": Linter.RuleEntry<
|
4813
4949
|
[
|
4814
4950
|
Partial<{
|
4951
|
+
/**
|
4952
|
+
* @default false
|
4953
|
+
*/
|
4815
4954
|
requireCatchParameter: boolean;
|
4816
4955
|
}>,
|
4817
4956
|
]
|
@@ -5339,7 +5478,7 @@ export interface ESLintRules extends Linter.RulesRecord {
|
|
5339
5478
|
*/
|
5340
5479
|
enforceForSwitchCase: boolean;
|
5341
5480
|
/**
|
5342
|
-
* @default
|
5481
|
+
* @default false
|
5343
5482
|
*/
|
5344
5483
|
enforceForIndexOf: boolean;
|
5345
5484
|
}>,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.36.0",
|
4
4
|
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
|
5
5
|
"description": "An AST-based pattern checker for JavaScript.",
|
6
6
|
"type": "commonjs",
|
@@ -110,7 +110,7 @@
|
|
110
110
|
"@eslint/config-helpers": "^0.3.1",
|
111
111
|
"@eslint/core": "^0.15.2",
|
112
112
|
"@eslint/eslintrc": "^3.3.1",
|
113
|
-
"@eslint/js": "9.
|
113
|
+
"@eslint/js": "9.36.0",
|
114
114
|
"@eslint/plugin-kit": "^0.3.5",
|
115
115
|
"@humanfs/node": "^0.16.6",
|
116
116
|
"@humanwhocodes/module-importer": "^1.0.1",
|