eslint 9.36.0 → 9.38.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 +11 -1
- package/lib/cli-engine/lint-result-cache.js +47 -29
- package/lib/eslint/eslint-helpers.js +7 -4
- 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/callback-return.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/complexity.js +6 -0
- 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/global-require.js +1 -1
- package/lib/rules/handle-callback-err.js +1 -1
- package/lib/rules/id-blacklist.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-buffer-constructor.js +1 -1
- package/lib/rules/no-catch-shadow.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 +206 -211
- package/lib/rules/no-mixed-operators.js +1 -1
- package/lib/rules/no-mixed-requires.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-native-reassign.js +1 -1
- package/lib/rules/no-negated-in-lhs.js +1 -1
- package/lib/rules/no-new-object.js +1 -1
- package/lib/rules/no-new-require.js +1 -1
- package/lib/rules/no-new-symbol.js +1 -1
- package/lib/rules/no-path-concat.js +1 -1
- package/lib/rules/no-process-env.js +1 -1
- package/lib/rules/no-process-exit.js +1 -1
- package/lib/rules/no-restricted-imports.js +171 -4
- package/lib/rules/no-restricted-modules.js +1 -1
- package/lib/rules/no-spaced-func.js +1 -1
- package/lib/rules/no-sync.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 +1 -5
- package/lib/rules/quote-props.js +1 -1
- package/lib/rules/quotes.js +1 -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/shared/serialization.js +1 -1
- package/lib/types/config-api.d.ts +6 -2
- package/lib/types/index.d.ts +92 -407
- package/lib/types/rules.d.ts +2 -0
- package/package.json +9 -9
|
@@ -41,6 +41,11 @@ const arrayOfStringsOrObjects = {
|
|
|
41
41
|
type: "string",
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
|
+
allowTypeImports: {
|
|
45
|
+
type: "boolean",
|
|
46
|
+
description:
|
|
47
|
+
"Whether to allow type-only imports for a path.",
|
|
48
|
+
},
|
|
44
49
|
},
|
|
45
50
|
additionalProperties: false,
|
|
46
51
|
required: ["name"],
|
|
@@ -105,6 +110,11 @@ const arrayOfStringsOrObjectPatterns = {
|
|
|
105
110
|
caseSensitive: {
|
|
106
111
|
type: "boolean",
|
|
107
112
|
},
|
|
113
|
+
allowTypeImports: {
|
|
114
|
+
type: "boolean",
|
|
115
|
+
description:
|
|
116
|
+
"Whether to allow type-only imports for a pattern.",
|
|
117
|
+
},
|
|
108
118
|
},
|
|
109
119
|
additionalProperties: false,
|
|
110
120
|
not: {
|
|
@@ -137,6 +147,8 @@ const arrayOfStringsOrObjectPatterns = {
|
|
|
137
147
|
module.exports = {
|
|
138
148
|
meta: {
|
|
139
149
|
type: "suggestion",
|
|
150
|
+
dialects: ["typescript", "javascript"],
|
|
151
|
+
language: "javascript",
|
|
140
152
|
|
|
141
153
|
docs: {
|
|
142
154
|
description: "Disallow specified modules when loaded by `import`",
|
|
@@ -261,6 +273,7 @@ module.exports = {
|
|
|
261
273
|
message: importSource.message,
|
|
262
274
|
importNames: importSource.importNames,
|
|
263
275
|
allowImportNames: importSource.allowImportNames,
|
|
276
|
+
allowTypeImports: importSource.allowTypeImports,
|
|
264
277
|
});
|
|
265
278
|
}
|
|
266
279
|
return memo;
|
|
@@ -291,6 +304,7 @@ module.exports = {
|
|
|
291
304
|
importNamePattern,
|
|
292
305
|
allowImportNames,
|
|
293
306
|
allowImportNamePattern,
|
|
307
|
+
allowTypeImports,
|
|
294
308
|
}) => ({
|
|
295
309
|
...(group
|
|
296
310
|
? {
|
|
@@ -313,6 +327,7 @@ module.exports = {
|
|
|
313
327
|
importNamePattern,
|
|
314
328
|
allowImportNames,
|
|
315
329
|
allowImportNamePattern,
|
|
330
|
+
allowTypeImports,
|
|
316
331
|
}),
|
|
317
332
|
);
|
|
318
333
|
|
|
@@ -324,6 +339,48 @@ module.exports = {
|
|
|
324
339
|
return {};
|
|
325
340
|
}
|
|
326
341
|
|
|
342
|
+
/**
|
|
343
|
+
* Check if the node is a type-only import
|
|
344
|
+
* @param {ASTNode} node The node to check
|
|
345
|
+
* @returns {boolean} Whether the node is a type-only import
|
|
346
|
+
*/
|
|
347
|
+
function isTypeOnlyImport(node) {
|
|
348
|
+
return (
|
|
349
|
+
node.importKind === "type" ||
|
|
350
|
+
(node.specifiers?.length > 0 &&
|
|
351
|
+
node.specifiers.every(
|
|
352
|
+
specifier => specifier.importKind === "type",
|
|
353
|
+
))
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Check if a specifier is type-only
|
|
359
|
+
* @param {ASTNode} specifier The specifier to check
|
|
360
|
+
* @returns {boolean} Whether the specifier is type-only
|
|
361
|
+
*/
|
|
362
|
+
function isTypeOnlySpecifier(specifier) {
|
|
363
|
+
return (
|
|
364
|
+
specifier.importKind === "type" ||
|
|
365
|
+
specifier.exportKind === "type"
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Check if the node is a type-only export
|
|
371
|
+
* @param {ASTNode} node The node to check
|
|
372
|
+
* @returns {boolean} Whether the node is a type-only export
|
|
373
|
+
*/
|
|
374
|
+
function isTypeOnlyExport(node) {
|
|
375
|
+
return (
|
|
376
|
+
node.exportKind === "type" ||
|
|
377
|
+
(node.specifiers?.length > 0 &&
|
|
378
|
+
node.specifiers.every(
|
|
379
|
+
specifier => specifier.exportKind === "type",
|
|
380
|
+
))
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
|
|
327
384
|
/**
|
|
328
385
|
* Report a restricted path.
|
|
329
386
|
* @param {string} importSource path of the import
|
|
@@ -344,6 +401,28 @@ module.exports = {
|
|
|
344
401
|
restrictedPathEntry.importNames;
|
|
345
402
|
const allowedImportNames =
|
|
346
403
|
restrictedPathEntry.allowImportNames;
|
|
404
|
+
const allowTypeImports =
|
|
405
|
+
restrictedPathEntry.allowTypeImports;
|
|
406
|
+
|
|
407
|
+
// Skip if this is a type-only import and it's allowed for this specific entry
|
|
408
|
+
if (
|
|
409
|
+
allowTypeImports &&
|
|
410
|
+
(node.type === "ImportDeclaration" ||
|
|
411
|
+
node.type === "TSImportEqualsDeclaration") &&
|
|
412
|
+
isTypeOnlyImport(node)
|
|
413
|
+
) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// Skip if this is a type-only export and it's allowed for this specific entry
|
|
418
|
+
if (
|
|
419
|
+
allowTypeImports &&
|
|
420
|
+
(node.type === "ExportNamedDeclaration" ||
|
|
421
|
+
node.type === "ExportAllDeclaration") &&
|
|
422
|
+
isTypeOnlyExport(node)
|
|
423
|
+
) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
347
426
|
|
|
348
427
|
if (!restrictedImportNames && !allowedImportNames) {
|
|
349
428
|
context.report({
|
|
@@ -400,6 +479,14 @@ module.exports = {
|
|
|
400
479
|
restrictedImportNames.includes(importName)
|
|
401
480
|
) {
|
|
402
481
|
specifiers.forEach(specifier => {
|
|
482
|
+
// Skip if this is a type-only import specifier and type imports are allowed
|
|
483
|
+
if (
|
|
484
|
+
allowTypeImports &&
|
|
485
|
+
isTypeOnlySpecifier(specifier.specifier)
|
|
486
|
+
) {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
|
|
403
490
|
context.report({
|
|
404
491
|
node,
|
|
405
492
|
messageId: customMessage
|
|
@@ -420,6 +507,14 @@ module.exports = {
|
|
|
420
507
|
!allowedImportNames.includes(importName)
|
|
421
508
|
) {
|
|
422
509
|
specifiers.forEach(specifier => {
|
|
510
|
+
// Skip if this is a type-only import specifier and type imports are allowed
|
|
511
|
+
if (
|
|
512
|
+
allowTypeImports &&
|
|
513
|
+
isTypeOnlySpecifier(specifier.specifier)
|
|
514
|
+
) {
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
|
|
423
518
|
context.report({
|
|
424
519
|
node,
|
|
425
520
|
loc: specifier.loc,
|
|
@@ -446,11 +541,30 @@ module.exports = {
|
|
|
446
541
|
* @param {Object} group contains an Ignore instance for paths, the customMessage to show on failure,
|
|
447
542
|
* and any restricted import names that have been specified in the config
|
|
448
543
|
* @param {Map<string,Object[]>} importNames Map of import names that are being imported
|
|
544
|
+
* @param {string} importSource the import source string
|
|
449
545
|
* @returns {void}
|
|
450
546
|
* @private
|
|
451
547
|
*/
|
|
452
|
-
function reportPathForPatterns(node, group, importNames) {
|
|
453
|
-
|
|
548
|
+
function reportPathForPatterns(node, group, importNames, importSource) {
|
|
549
|
+
// Skip if this is a type-only import and it's allowed
|
|
550
|
+
if (
|
|
551
|
+
group.allowTypeImports &&
|
|
552
|
+
(node.type === "ImportDeclaration" ||
|
|
553
|
+
node.type === "TSImportEqualsDeclaration") &&
|
|
554
|
+
isTypeOnlyImport(node)
|
|
555
|
+
) {
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// Skip if this is a type-only export and it's allowed
|
|
560
|
+
if (
|
|
561
|
+
group.allowTypeImports &&
|
|
562
|
+
(node.type === "ExportNamedDeclaration" ||
|
|
563
|
+
node.type === "ExportAllDeclaration") &&
|
|
564
|
+
isTypeOnlyExport(node)
|
|
565
|
+
) {
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
454
568
|
|
|
455
569
|
const customMessage = group.customMessage;
|
|
456
570
|
const restrictedImportNames = group.importNames;
|
|
@@ -553,6 +667,14 @@ module.exports = {
|
|
|
553
667
|
restrictedImportNamePattern.test(importName))
|
|
554
668
|
) {
|
|
555
669
|
specifiers.forEach(specifier => {
|
|
670
|
+
// Skip if this is a type-only import specifier and type imports are allowed
|
|
671
|
+
if (
|
|
672
|
+
group.allowTypeImports &&
|
|
673
|
+
isTypeOnlySpecifier(specifier.specifier)
|
|
674
|
+
) {
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
|
|
556
678
|
context.report({
|
|
557
679
|
node,
|
|
558
680
|
messageId: customMessage
|
|
@@ -573,6 +695,14 @@ module.exports = {
|
|
|
573
695
|
!allowedImportNames.includes(importName)
|
|
574
696
|
) {
|
|
575
697
|
specifiers.forEach(specifier => {
|
|
698
|
+
// Skip if this is a type-only import specifier and type imports are allowed
|
|
699
|
+
if (
|
|
700
|
+
group.allowTypeImports &&
|
|
701
|
+
isTypeOnlySpecifier(specifier.specifier)
|
|
702
|
+
) {
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
|
|
576
706
|
context.report({
|
|
577
707
|
node,
|
|
578
708
|
messageId: customMessage
|
|
@@ -592,6 +722,14 @@ module.exports = {
|
|
|
592
722
|
!allowedImportNamePattern.test(importName)
|
|
593
723
|
) {
|
|
594
724
|
specifiers.forEach(specifier => {
|
|
725
|
+
// Skip if this is a type-only import specifier and type imports are allowed
|
|
726
|
+
if (
|
|
727
|
+
group.allowTypeImports &&
|
|
728
|
+
isTypeOnlySpecifier(specifier.specifier)
|
|
729
|
+
) {
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
|
|
595
733
|
context.report({
|
|
596
734
|
node,
|
|
597
735
|
messageId: customMessage
|
|
@@ -640,7 +778,7 @@ module.exports = {
|
|
|
640
778
|
} else if (node.specifiers) {
|
|
641
779
|
for (const specifier of node.specifiers) {
|
|
642
780
|
let name;
|
|
643
|
-
const specifierData = { loc: specifier.loc };
|
|
781
|
+
const specifierData = { loc: specifier.loc, specifier };
|
|
644
782
|
|
|
645
783
|
if (specifier.type === "ImportDefaultSpecifier") {
|
|
646
784
|
name = "default";
|
|
@@ -665,7 +803,12 @@ module.exports = {
|
|
|
665
803
|
checkRestrictedPathAndReport(importSource, importNames, node);
|
|
666
804
|
restrictedPatternGroups.forEach(group => {
|
|
667
805
|
if (isRestrictedPattern(importSource, group)) {
|
|
668
|
-
reportPathForPatterns(
|
|
806
|
+
reportPathForPatterns(
|
|
807
|
+
node,
|
|
808
|
+
group,
|
|
809
|
+
importNames,
|
|
810
|
+
importSource,
|
|
811
|
+
);
|
|
669
812
|
}
|
|
670
813
|
});
|
|
671
814
|
}
|
|
@@ -678,6 +821,30 @@ module.exports = {
|
|
|
678
821
|
}
|
|
679
822
|
},
|
|
680
823
|
ExportAllDeclaration: checkNode,
|
|
824
|
+
// Add support for TypeScript import equals declarations
|
|
825
|
+
TSImportEqualsDeclaration(node) {
|
|
826
|
+
if (node.moduleReference.type === "TSExternalModuleReference") {
|
|
827
|
+
const importSource = node.moduleReference.expression.value;
|
|
828
|
+
const importNames = new Map();
|
|
829
|
+
|
|
830
|
+
// Use existing logic with the actual node
|
|
831
|
+
checkRestrictedPathAndReport(
|
|
832
|
+
importSource,
|
|
833
|
+
importNames,
|
|
834
|
+
node,
|
|
835
|
+
);
|
|
836
|
+
restrictedPatternGroups.forEach(group => {
|
|
837
|
+
if (isRestrictedPattern(importSource, group)) {
|
|
838
|
+
reportPathForPatterns(
|
|
839
|
+
node,
|
|
840
|
+
group,
|
|
841
|
+
importNames,
|
|
842
|
+
importSource,
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
},
|
|
681
848
|
};
|
|
682
849
|
},
|
|
683
850
|
};
|
|
@@ -52,7 +52,7 @@ module.exports = {
|
|
|
52
52
|
message: "Node.js rules were moved out of ESLint core.",
|
|
53
53
|
url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
|
|
54
54
|
deprecatedSince: "7.0.0",
|
|
55
|
-
availableUntil:
|
|
55
|
+
availableUntil: "11.0.0",
|
|
56
56
|
replacedBy: [
|
|
57
57
|
{
|
|
58
58
|
message:
|
|
@@ -26,7 +26,7 @@ module.exports = {
|
|
|
26
26
|
message: "Formatting rules are being moved out of ESLint core.",
|
|
27
27
|
url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
|
|
28
28
|
deprecatedSince: "3.3.0",
|
|
29
|
-
availableUntil: "
|
|
29
|
+
availableUntil: "11.0.0",
|
|
30
30
|
replacedBy: [
|
|
31
31
|
{
|
|
32
32
|
message:
|
package/lib/rules/no-sync.js
CHANGED
|
@@ -17,7 +17,7 @@ module.exports = {
|
|
|
17
17
|
message: "Node.js rules were moved out of ESLint core.",
|
|
18
18
|
url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
|
|
19
19
|
deprecatedSince: "7.0.0",
|
|
20
|
-
availableUntil:
|
|
20
|
+
availableUntil: "11.0.0",
|
|
21
21
|
replacedBy: [
|
|
22
22
|
{
|
|
23
23
|
message:
|
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:
|
|
@@ -82,11 +82,7 @@ function getErrorCause(throwStatement) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
const causeProperties = errorOptions.properties.filter(
|
|
85
|
-
prop =>
|
|
86
|
-
prop.type === "Property" &&
|
|
87
|
-
prop.key.type === "Identifier" &&
|
|
88
|
-
prop.key.name === "cause" &&
|
|
89
|
-
!prop.computed, // It is hard to accurately identify the value of computed props
|
|
85
|
+
prop => astUtils.getStaticPropertyName(prop) === "cause",
|
|
90
86
|
);
|
|
91
87
|
|
|
92
88
|
const causeProperty = causeProperties.at(-1);
|
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:
|
|
@@ -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:
|
|
@@ -56,7 +56,7 @@ function isSerializable(val, seenObjects = new Set()) {
|
|
|
56
56
|
/*
|
|
57
57
|
* We're creating a new Set of seen objects because we want to
|
|
58
58
|
* ensure that `val` doesn't appear again in this path, but it can appear
|
|
59
|
-
* in other paths. This allows for
|
|
59
|
+
* in other paths. This allows for reusing objects in the graph, as long as
|
|
60
60
|
* there are no cycles.
|
|
61
61
|
*/
|
|
62
62
|
!isSerializable(
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* @author Nicholas C. Zakas
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
type Config,
|
|
8
|
+
defineConfig,
|
|
9
|
+
globalIgnores,
|
|
10
|
+
} from "@eslint/config-helpers";
|
|
7
11
|
|
|
8
|
-
export { defineConfig, globalIgnores };
|
|
12
|
+
export { type Config, defineConfig, globalIgnores };
|