@xylabs/eslint-config-flat 8.3.0 → 8.4.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 +13 -7
- package/dist/neutral/core/index.d.ts.map +1 -1
- package/dist/neutral/index.d.ts +7 -3
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +497 -128
- package/dist/neutral/index.mjs.map +4 -4
- package/dist/neutral/tiers/conflicts.d.ts +2 -0
- package/dist/neutral/tiers/conflicts.d.ts.map +1 -1
- package/dist/neutral/tiers/index.d.ts +1 -1
- package/dist/neutral/tiers/opinionated.d.ts +6 -0
- package/dist/neutral/tiers/opinionated.d.ts.map +1 -1
- package/dist/neutral/tiers/plugin-rules.d.ts.map +1 -1
- package/dist/neutral/tiers/recommendedConfig.d.ts.map +1 -1
- package/dist/neutral/tiers/rule-catalog/index.d.ts +13 -0
- package/dist/neutral/tiers/rule-catalog/index.d.ts.map +1 -0
- package/dist/neutral/tiers/rule-catalog/managed-rules.d.ts +4 -0
- package/dist/neutral/tiers/rule-catalog/managed-rules.d.ts.map +1 -0
- package/dist/neutral/tiers/rule-catalog/type-checked-rules.d.ts +5 -0
- package/dist/neutral/tiers/rule-catalog/type-checked-rules.d.ts.map +1 -0
- package/dist/neutral/tiers/rule-catalog/types.d.ts +20 -0
- package/dist/neutral/tiers/rule-catalog/types.d.ts.map +1 -0
- package/dist/neutral/tiers/tier-builder.d.ts +6 -0
- package/dist/neutral/tiers/tier-builder.d.ts.map +1 -0
- package/dist/neutral/unicorn/index.d.ts +9 -2
- package/dist/neutral/unicorn/index.d.ts.map +1 -1
- package/dist/node/core/index.d.ts.map +1 -1
- package/dist/node/index.d.ts +7 -3
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.mjs +497 -128
- package/dist/node/index.mjs.map +4 -4
- package/dist/node/tiers/conflicts.d.ts +2 -0
- package/dist/node/tiers/conflicts.d.ts.map +1 -1
- package/dist/node/tiers/index.d.ts +1 -1
- package/dist/node/tiers/opinionated.d.ts +6 -0
- package/dist/node/tiers/opinionated.d.ts.map +1 -1
- package/dist/node/tiers/plugin-rules.d.ts.map +1 -1
- package/dist/node/tiers/recommendedConfig.d.ts.map +1 -1
- package/dist/node/tiers/rule-catalog/index.d.ts +13 -0
- package/dist/node/tiers/rule-catalog/index.d.ts.map +1 -0
- package/dist/node/tiers/rule-catalog/managed-rules.d.ts +4 -0
- package/dist/node/tiers/rule-catalog/managed-rules.d.ts.map +1 -0
- package/dist/node/tiers/rule-catalog/type-checked-rules.d.ts +5 -0
- package/dist/node/tiers/rule-catalog/type-checked-rules.d.ts.map +1 -0
- package/dist/node/tiers/rule-catalog/types.d.ts +20 -0
- package/dist/node/tiers/rule-catalog/types.d.ts.map +1 -0
- package/dist/node/tiers/tier-builder.d.ts +6 -0
- package/dist/node/tiers/tier-builder.d.ts.map +1 -0
- package/dist/node/unicorn/index.d.ts +9 -2
- package/dist/node/unicorn/index.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/neutral/index.mjs
CHANGED
|
@@ -226,6 +226,11 @@ var srcImportsConfig = {
|
|
|
226
226
|
|
|
227
227
|
// src/unicorn/index.ts
|
|
228
228
|
import unicornPlugin from "eslint-plugin-unicorn";
|
|
229
|
+
var compareStrings = (left, right) => left.localeCompare(right);
|
|
230
|
+
var unicornRecommendedRules = unicornPlugin.configs.recommended.rules ?? {};
|
|
231
|
+
var unicornUnopinionatedConfig = unicornPlugin.configs.unopinionated;
|
|
232
|
+
var unicornUnopinionatedRules = unicornUnopinionatedConfig.rules ?? {};
|
|
233
|
+
var unicornOpinionatedRules = Object.entries(unicornRecommendedRules).filter(([rule2, severity]) => severity !== "off" && unicornUnopinionatedRules[rule2] === "off").map(([rule2]) => rule2).toSorted(compareStrings);
|
|
229
234
|
var unicornV66MigrationQueue = [
|
|
230
235
|
"unicorn/class-reference-in-static-methods",
|
|
231
236
|
"unicorn/comment-content",
|
|
@@ -294,7 +299,6 @@ var unicornV66MigrationQueue = [
|
|
|
294
299
|
"unicorn/prefer-uint8array-base64",
|
|
295
300
|
"unicorn/prefer-unicode-code-point-escapes",
|
|
296
301
|
"unicorn/prefer-url-href",
|
|
297
|
-
"unicorn/require-array-sort-compare",
|
|
298
302
|
"unicorn/require-proxy-trap-boolean-return"
|
|
299
303
|
];
|
|
300
304
|
var unicornV67MigrationQueue = [
|
|
@@ -314,64 +318,105 @@ var unicornV67MigrationQueue = [
|
|
|
314
318
|
"unicorn/prefer-has-check",
|
|
315
319
|
"unicorn/prefer-map-from-entries"
|
|
316
320
|
];
|
|
321
|
+
var unicornV69MigrationQueue = [
|
|
322
|
+
"unicorn/consistent-conditional-object-spread",
|
|
323
|
+
"unicorn/consistent-tuple-labels",
|
|
324
|
+
"unicorn/default-export-style",
|
|
325
|
+
"unicorn/no-accidental-bitwise-operator",
|
|
326
|
+
"unicorn/no-array-concat-in-loop",
|
|
327
|
+
"unicorn/no-array-sort-for-min-max",
|
|
328
|
+
"unicorn/no-boolean-sort-comparator",
|
|
329
|
+
"unicorn/no-chained-comparison",
|
|
330
|
+
"unicorn/no-collection-bracket-access",
|
|
331
|
+
"unicorn/no-constant-zero-expression",
|
|
332
|
+
"unicorn/no-double-comparison",
|
|
333
|
+
"unicorn/no-duplicate-if-branches",
|
|
334
|
+
"unicorn/no-duplicate-logical-operands",
|
|
335
|
+
"unicorn/no-impossible-length-comparison",
|
|
336
|
+
"unicorn/no-invalid-character-comparison",
|
|
337
|
+
"unicorn/no-invalid-well-known-symbol-methods",
|
|
338
|
+
"unicorn/no-late-event-control",
|
|
339
|
+
"unicorn/no-loop-iterable-mutation",
|
|
340
|
+
"unicorn/no-misrefactored-assignment",
|
|
341
|
+
"unicorn/no-nonstandard-builtin-properties",
|
|
342
|
+
"unicorn/no-selector-as-dom-name",
|
|
343
|
+
"unicorn/no-unnecessary-boolean-comparison",
|
|
344
|
+
"unicorn/no-useless-compound-assignment",
|
|
345
|
+
"unicorn/no-useless-delete-check",
|
|
346
|
+
"unicorn/no-useless-logical-operand",
|
|
347
|
+
"unicorn/no-xor-as-exponentiation",
|
|
348
|
+
"unicorn/prefer-abort-signal-timeout",
|
|
349
|
+
"unicorn/prefer-aggregate-error",
|
|
350
|
+
"unicorn/prefer-array-from-async",
|
|
351
|
+
"unicorn/prefer-array-iterable-methods",
|
|
352
|
+
"unicorn/prefer-boolean-return",
|
|
353
|
+
"unicorn/prefer-continue",
|
|
354
|
+
"unicorn/prefer-dom-node-replace-children",
|
|
355
|
+
"unicorn/prefer-flat-math-min-max",
|
|
356
|
+
"unicorn/prefer-hoisting-branch-code",
|
|
357
|
+
"unicorn/prefer-math-constants",
|
|
358
|
+
"unicorn/prefer-observer-apis",
|
|
359
|
+
"unicorn/prefer-promise-try",
|
|
360
|
+
"unicorn/prefer-promise-with-resolvers",
|
|
361
|
+
"unicorn/prefer-set-methods",
|
|
362
|
+
"unicorn/prefer-single-replace",
|
|
363
|
+
"unicorn/prefer-toggle-attribute",
|
|
364
|
+
"unicorn/prefer-unary-minus",
|
|
365
|
+
"unicorn/prefer-url-can-parse",
|
|
366
|
+
"unicorn/prefer-url-search-parameters",
|
|
367
|
+
"unicorn/prefer-while-loop-condition"
|
|
368
|
+
];
|
|
369
|
+
var unicornMigrationQueueRuleSet = /* @__PURE__ */ new Set([
|
|
370
|
+
...unicornV66MigrationQueue,
|
|
371
|
+
...unicornV67MigrationQueue,
|
|
372
|
+
...unicornV69MigrationQueue
|
|
373
|
+
]);
|
|
374
|
+
function unicornOpinionatedRulesForTier(tier) {
|
|
375
|
+
if (tier < 4) {
|
|
376
|
+
return unicornOpinionatedRules.filter((rule2) => !unicornV67MigrationQueue.includes(rule2) && !unicornV69MigrationQueue.includes(rule2));
|
|
377
|
+
}
|
|
378
|
+
return unicornOpinionatedRules;
|
|
379
|
+
}
|
|
380
|
+
function unicornOpinionatedRuleEntries(severity, tier = 4) {
|
|
381
|
+
return Object.fromEntries(unicornOpinionatedRulesForTier(tier).map((rule2) => [rule2, severity]));
|
|
382
|
+
}
|
|
317
383
|
var unicornExperimentalMigrationQueue = unicornV67MigrationQueue;
|
|
318
384
|
var unicornV66NewRules = unicornV66MigrationQueue;
|
|
319
385
|
function unicornQueueRules(queue, severity) {
|
|
320
|
-
return Object.fromEntries(queue.map((
|
|
386
|
+
return Object.fromEntries(queue.map((rule2) => [rule2, severity]));
|
|
321
387
|
}
|
|
322
388
|
var unicornConfig = {
|
|
323
|
-
...
|
|
389
|
+
...unicornUnopinionatedConfig,
|
|
324
390
|
plugins: { unicorn: unicornPlugin },
|
|
325
391
|
rules: {
|
|
326
|
-
...
|
|
392
|
+
...unicornUnopinionatedRules,
|
|
327
393
|
...unicornQueueRules(unicornV66MigrationQueue, "off"),
|
|
328
394
|
...unicornQueueRules(unicornV67MigrationQueue, "off"),
|
|
395
|
+
...unicornQueueRules(unicornV69MigrationQueue, "off"),
|
|
329
396
|
// Owned by @typescript-eslint/member-ordering
|
|
330
397
|
"unicorn/consistent-class-member-order": ["off"],
|
|
331
398
|
// Owned by max-nested-callbacks
|
|
332
399
|
"unicorn/max-nested-calls": ["off"],
|
|
333
|
-
// Naming preference — too disruptive for org-wide enforcement
|
|
334
|
-
"unicorn/catch-error-name": ["off"],
|
|
335
|
-
// Closure patterns are valid in our codebase
|
|
336
|
-
"unicorn/consistent-function-scoping": ["off"],
|
|
337
400
|
// Tier 3 opinionated — enabled in opinionatedConfig
|
|
338
|
-
"unicorn/filename-case": ["off"],
|
|
339
401
|
"unicorn/new-for-builtins": ["off"],
|
|
340
|
-
"unicorn/no-array-callback-reference": ["off"],
|
|
341
|
-
// Tier 3 opinionated — enabled in opinionatedConfig
|
|
342
|
-
"unicorn/no-await-expression-member": ["off"],
|
|
343
|
-
// Owned by unicorn/no-unnecessary-nested-ternary
|
|
344
|
-
"unicorn/no-nested-ternary": ["off"],
|
|
345
|
-
// Org uses null alongside undefined
|
|
346
|
-
"unicorn/no-null": ["off"],
|
|
347
402
|
// Formatting — candidate for stylistic tier; overlaps @stylistic formatting
|
|
348
403
|
"unicorn/number-literal-case": ["off"],
|
|
404
|
+
"unicorn/consistent-boolean-name": ["off"],
|
|
405
|
+
// Sort comparators are often intentional (locale, numeric, custom keys)
|
|
406
|
+
"unicorn/require-array-sort-compare": ["off"],
|
|
349
407
|
"unicorn/prefer-module": ["off"],
|
|
350
408
|
"unicorn/prefer-top-level-await": ["off"],
|
|
351
|
-
"unicorn/
|
|
409
|
+
"unicorn/name-replacements": ["off"],
|
|
352
410
|
"unicorn/prefer-https": ["off"],
|
|
353
411
|
"unicorn/no-useless-undefined": "warn"
|
|
354
412
|
}
|
|
355
413
|
};
|
|
356
414
|
|
|
357
|
-
// src/workspaces/index.ts
|
|
358
|
-
import workspacesPlugin from "eslint-plugin-workspaces";
|
|
359
|
-
var workspacesConfig = {
|
|
360
|
-
plugins: { workspaces: workspacesPlugin },
|
|
361
|
-
rules: {
|
|
362
|
-
...workspacesPlugin.configs.recommended.rules,
|
|
363
|
-
// Tier 3 opinionated — enabled in opinionatedConfig
|
|
364
|
-
"workspaces/no-relative-imports": ["off"],
|
|
365
|
-
"workspaces/require-dependency": ["off"]
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
|
|
369
415
|
// src/core/index.ts
|
|
370
416
|
var correctnessCoreConfig = [
|
|
371
417
|
scopeConfig(js.configs.recommended, { files: scriptFiles, languageOptions: scriptLanguageOptions }),
|
|
372
418
|
correctnessRulesConfig,
|
|
373
|
-
srcImportsConfig
|
|
374
|
-
workspacesConfig
|
|
419
|
+
srcImportsConfig
|
|
375
420
|
];
|
|
376
421
|
var bestPracticesCoreConfig = [
|
|
377
422
|
scopeConfig(unicornConfig, { files: scriptFiles })
|
|
@@ -479,17 +524,25 @@ var RULE_OWNERSHIP_GROUPS = [
|
|
|
479
524
|
disabled: ["no-extra-boolean-cast", "unicorn/no-useless-boolean-cast"]
|
|
480
525
|
}
|
|
481
526
|
];
|
|
482
|
-
function
|
|
527
|
+
function getRuleSeverity(setting) {
|
|
483
528
|
if (setting === void 0) {
|
|
484
|
-
return
|
|
529
|
+
return void 0;
|
|
485
530
|
}
|
|
486
|
-
|
|
487
|
-
|
|
531
|
+
const level = Array.isArray(setting) ? setting[0] : setting;
|
|
532
|
+
if (level === "off" || level === 0) {
|
|
533
|
+
return "off";
|
|
488
534
|
}
|
|
489
|
-
if (
|
|
490
|
-
return
|
|
535
|
+
if (level === "warn" || level === 1) {
|
|
536
|
+
return "warn";
|
|
491
537
|
}
|
|
492
|
-
|
|
538
|
+
if (level === "error" || level === 2) {
|
|
539
|
+
return "error";
|
|
540
|
+
}
|
|
541
|
+
return void 0;
|
|
542
|
+
}
|
|
543
|
+
function isRuleEnabled(setting) {
|
|
544
|
+
const severity = getRuleSeverity(setting);
|
|
545
|
+
return severity !== void 0 && severity !== "off";
|
|
493
546
|
}
|
|
494
547
|
function mergeConfigRules(configs) {
|
|
495
548
|
const merged = {};
|
|
@@ -745,7 +798,19 @@ var typescriptTypeCheckedConfig = [
|
|
|
745
798
|
typescriptDelegationConfig
|
|
746
799
|
];
|
|
747
800
|
|
|
748
|
-
// src/
|
|
801
|
+
// src/workspaces/index.ts
|
|
802
|
+
import workspacesPlugin from "eslint-plugin-workspaces";
|
|
803
|
+
var workspacesConfig = {
|
|
804
|
+
plugins: { workspaces: workspacesPlugin },
|
|
805
|
+
rules: {
|
|
806
|
+
...workspacesPlugin.configs.recommended.rules,
|
|
807
|
+
// Tier 3 opinionated — enabled in opinionatedConfig
|
|
808
|
+
"workspaces/no-relative-imports": ["off"],
|
|
809
|
+
"workspaces/require-dependency": ["off"]
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
// src/tiers/rule-catalog/managed-rules.ts
|
|
749
814
|
var filenameCaseRuleOptions = {
|
|
750
815
|
cases: {
|
|
751
816
|
camelCase: true,
|
|
@@ -756,15 +821,184 @@ var filenameCaseRuleOptions = {
|
|
|
756
821
|
function filenameCaseRule(severity) {
|
|
757
822
|
return [severity, filenameCaseRuleOptions];
|
|
758
823
|
}
|
|
824
|
+
function rule(name, plugin, category, introducedAtTier, severityAtTier, options, isTypeCheckingRequired = false) {
|
|
825
|
+
return {
|
|
826
|
+
category,
|
|
827
|
+
introducedAtTier,
|
|
828
|
+
isTypeCheckingRequired,
|
|
829
|
+
options,
|
|
830
|
+
plugin,
|
|
831
|
+
rule: name,
|
|
832
|
+
severityAtTier
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
var MANAGED_RULES = [
|
|
836
|
+
// Tier 0 — correctness
|
|
837
|
+
rule("no-unused-vars", "eslint", "correctness", 0, { 0: "off" }),
|
|
838
|
+
rule("no-useless-escape", "eslint", "correctness", 0, { 0: "off" }),
|
|
839
|
+
rule("prefer-spread", "eslint", "correctness", 0, { 0: "off" }),
|
|
840
|
+
rule("no-restricted-imports", "eslint", "correctness", 0, { 0: "error" }),
|
|
841
|
+
rule("@typescript-eslint/no-unused-vars", "@typescript-eslint", "correctness", 0, { 0: "warn" }, [
|
|
842
|
+
"warn",
|
|
843
|
+
{
|
|
844
|
+
argsIgnorePattern: "^_",
|
|
845
|
+
ignoreRestSiblings: true,
|
|
846
|
+
varsIgnorePattern: "^_"
|
|
847
|
+
}
|
|
848
|
+
]),
|
|
849
|
+
rule("@typescript-eslint/require-await", "@typescript-eslint", "correctness", 0, { 0: "off" }),
|
|
850
|
+
rule("@typescript-eslint/explicit-module-boundary-types", "@typescript-eslint", "correctness", 0, { 0: "off" }),
|
|
851
|
+
rule("@typescript-eslint/no-empty-object-type", "@typescript-eslint", "correctness", 0, { 0: "off" }),
|
|
852
|
+
rule("@typescript-eslint/triple-slash-reference", "@typescript-eslint", "correctness", 0, { 0: "off" }),
|
|
853
|
+
rule("@typescript-eslint/strict-boolean-expressions", "@typescript-eslint", "correctness", 0, { 0: "off", 3: "error" }, void 0, true),
|
|
854
|
+
rule("@typescript-eslint/no-deprecated", "@typescript-eslint", "correctness", 0, { 0: "warn", 3: "error" }, void 0, true),
|
|
855
|
+
rule("quotes", "eslint", "correctness", 0, { 0: "off" }),
|
|
856
|
+
rule("semi", "eslint", "correctness", 0, { 0: "off" }),
|
|
857
|
+
rule("require-await", "eslint", "correctness", 0, { 0: "off" }),
|
|
858
|
+
// Tier 1 — consistency
|
|
859
|
+
rule("complexity", "eslint", "consistency", 1, { 1: "error" }, ["error", 18]),
|
|
860
|
+
rule("max-depth", "eslint", "consistency", 1, { 1: "error" }, ["error", 6]),
|
|
861
|
+
rule("max-lines", "eslint", "consistency", 1, { 1: "error" }, ["error", { max: 512, skipBlankLines: true }]),
|
|
862
|
+
rule("array-element-newline", "eslint", "consistency", 1, { 1: "warn", 3: "error" }, ["warn", "consistent"]),
|
|
863
|
+
rule("max-nested-callbacks", "eslint", "consistency", 1, { 1: "error" }),
|
|
864
|
+
rule("max-statements", "eslint", "consistency", 1, { 1: "error" }, ["error", 32]),
|
|
865
|
+
rule("no-tabs", "eslint", "consistency", 1, { 1: "error" }),
|
|
866
|
+
rule("@typescript-eslint/no-empty-function", "@typescript-eslint", "consistency", 1, { 1: "warn", 3: "error" }),
|
|
867
|
+
rule("@stylistic/eol-last", "@stylistic", "consistency", 1, { 1: "warn", 3: "error" }),
|
|
868
|
+
rule("@typescript-eslint/explicit-member-accessibility", "@typescript-eslint", "consistency", 1, { 1: "warn", 3: "error" }, [
|
|
869
|
+
"warn",
|
|
870
|
+
{ accessibility: "no-public" }
|
|
871
|
+
]),
|
|
872
|
+
rule("@stylistic/brace-style", "@stylistic", "consistency", 1, { 1: "warn", 3: "error" }, ["warn", "1tbs", { allowSingleLine: true }]),
|
|
873
|
+
rule("@stylistic/quotes", "@stylistic", "consistency", 1, { 1: "warn", 3: "error" }, ["warn", "single", { avoidEscape: true }]),
|
|
874
|
+
rule("@typescript-eslint/consistent-type-imports", "@typescript-eslint", "consistency", 1, { 1: "warn", 3: "error" }, [
|
|
875
|
+
"warn",
|
|
876
|
+
{ fixStyle: "separate-type-imports", prefer: "type-imports" }
|
|
877
|
+
]),
|
|
878
|
+
rule("@stylistic/object-property-newline", "@stylistic", "consistency", 1, { 1: "warn", 3: "error" }, [
|
|
879
|
+
"warn",
|
|
880
|
+
{ allowAllPropertiesOnSameLine: true }
|
|
881
|
+
]),
|
|
882
|
+
rule("@stylistic/function-call-argument-newline", "@stylistic", "consistency", 1, { 1: "warn", 3: "error" }, ["warn", "consistent"]),
|
|
883
|
+
rule("@stylistic/function-paren-newline", "@stylistic", "consistency", 1, { 1: "warn", 3: "error" }, ["warn", "multiline-arguments"]),
|
|
884
|
+
rule("@stylistic/member-delimiter-style", "@stylistic", "consistency", 1, { 1: "error" }, [
|
|
885
|
+
"error",
|
|
886
|
+
{
|
|
887
|
+
multiline: { delimiter: "none", requireLast: true },
|
|
888
|
+
singleline: { delimiter: "semi", requireLast: false }
|
|
889
|
+
}
|
|
890
|
+
]),
|
|
891
|
+
rule("@stylistic/object-curly-newline", "@stylistic", "consistency", 1, { 1: "warn", 3: "error" }, [
|
|
892
|
+
"warn",
|
|
893
|
+
{
|
|
894
|
+
ExportDeclaration: {
|
|
895
|
+
consistent: false,
|
|
896
|
+
minProperties: 3,
|
|
897
|
+
multiline: true
|
|
898
|
+
},
|
|
899
|
+
ImportDeclaration: {
|
|
900
|
+
consistent: false,
|
|
901
|
+
minProperties: 3,
|
|
902
|
+
multiline: true
|
|
903
|
+
},
|
|
904
|
+
ObjectExpression: {
|
|
905
|
+
consistent: false,
|
|
906
|
+
minProperties: 3,
|
|
907
|
+
multiline: true
|
|
908
|
+
},
|
|
909
|
+
ObjectPattern: {
|
|
910
|
+
consistent: false,
|
|
911
|
+
minProperties: 3,
|
|
912
|
+
multiline: true
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
]),
|
|
916
|
+
rule("@stylistic/max-len", "@stylistic", "consistency", 1, { 1: "warn", 3: "error" }, ["warn", { code: 200 }]),
|
|
917
|
+
rule("no-restricted-syntax", "eslint", "consistency", 1, { 1: "warn", 3: "error" }, [
|
|
918
|
+
"warn",
|
|
919
|
+
{
|
|
920
|
+
message: "Enums are disallowed. Consider using a union of string literals or a `const` object instead.",
|
|
921
|
+
selector: "TSEnumDeclaration"
|
|
922
|
+
}
|
|
923
|
+
]),
|
|
924
|
+
rule("@typescript-eslint/member-ordering", "@typescript-eslint", "consistency", 1, { 1: "warn", 3: "error" }),
|
|
925
|
+
// Tier 2 — best practices (workspaces moved here from tier 0)
|
|
926
|
+
rule("workspaces/no-relative-imports", "workspaces", "best-practices", 2, { 2: "off", 3: "error" }),
|
|
927
|
+
rule("workspaces/require-dependency", "workspaces", "best-practices", 2, { 2: "off", 3: "error" }),
|
|
928
|
+
rule("simple-import-sort/imports", "simple-import-sort", "best-practices", 2, { 2: "warn", 3: "error" }, ["warn"]),
|
|
929
|
+
rule("simple-import-sort/exports", "simple-import-sort", "best-practices", 2, { 2: "warn", 3: "error" }, ["warn"]),
|
|
930
|
+
rule("import-x/default", "import-x", "best-practices", 2, { 2: "off" }),
|
|
931
|
+
rule("import-x/named", "import-x", "best-practices", 2, { 2: "off" }),
|
|
932
|
+
rule("import-x/namespace", "import-x", "best-practices", 2, { 2: "off" }),
|
|
933
|
+
rule("import-x/no-unresolved", "import-x", "best-practices", 2, { 2: "off" }),
|
|
934
|
+
rule("import-x/no-absolute-path", "import-x", "best-practices", 2, { 2: "warn", 3: "error" }),
|
|
935
|
+
rule("import-x/no-cycle", "import-x", "best-practices", 2, { 2: "warn", 3: "error" }, ["warn", { maxDepth: 5 }]),
|
|
936
|
+
rule("import-x/no-deprecated", "import-x", "best-practices", 2, { 2: "off" }),
|
|
937
|
+
rule("import-x/no-named-as-default-member", "import-x", "best-practices", 2, { 2: "off" }),
|
|
938
|
+
rule("import-x/no-named-as-default", "import-x", "best-practices", 2, { 2: "off" }),
|
|
939
|
+
rule("import-x/no-restricted-paths", "import-x", "best-practices", 2, { 2: "warn", 3: "error" }),
|
|
940
|
+
rule("import-x/no-self-import", "import-x", "best-practices", 2, { 2: "warn", 3: "error" }),
|
|
941
|
+
rule("import-x/no-useless-path-segments", "import-x", "best-practices", 2, { 2: "warn", 3: "error" }),
|
|
942
|
+
rule("unicorn/consistent-class-member-order", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
943
|
+
rule("unicorn/max-nested-calls", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
944
|
+
rule("unicorn/catch-error-name", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
945
|
+
rule("unicorn/consistent-function-scoping", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
946
|
+
rule("unicorn/filename-case", "unicorn", "best-practices", 2, { 2: "off", 3: "error" }, filenameCaseRule("error")),
|
|
947
|
+
rule("unicorn/new-for-builtins", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
948
|
+
rule("unicorn/no-array-callback-reference", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
949
|
+
rule("unicorn/no-await-expression-member", "unicorn", "best-practices", 2, { 2: "off", 3: "error" }),
|
|
950
|
+
rule("unicorn/no-nested-ternary", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
951
|
+
rule("unicorn/no-null", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
952
|
+
rule("unicorn/number-literal-case", "unicorn", "best-practices", 2, { 2: "off", 3: "error" }),
|
|
953
|
+
rule("unicorn/prefer-module", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
954
|
+
rule("unicorn/prefer-top-level-await", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
955
|
+
rule("unicorn/prevent-abbreviations", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
956
|
+
rule("unicorn/name-replacements", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
957
|
+
rule("unicorn/prefer-https", "unicorn", "best-practices", 2, { 2: "off" }),
|
|
958
|
+
rule("unicorn/no-useless-undefined", "unicorn", "best-practices", 2, { 2: "warn", 3: "error" }),
|
|
959
|
+
// Tier 3 — opinionated ownership delegations
|
|
960
|
+
rule("no-extra-boolean-cast", "eslint", "opinionated", 3, { 3: "off" }),
|
|
961
|
+
rule("unicorn/no-useless-boolean-cast", "unicorn", "opinionated", 3, { 3: "off" })
|
|
962
|
+
];
|
|
963
|
+
|
|
964
|
+
// src/tiers/opinionated.ts
|
|
965
|
+
var filenameCaseRuleOptions2 = {
|
|
966
|
+
cases: {
|
|
967
|
+
camelCase: true,
|
|
968
|
+
kebabCase: true,
|
|
969
|
+
pascalCase: true
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
function filenameCaseRule2(severity) {
|
|
973
|
+
return [severity, filenameCaseRuleOptions2];
|
|
974
|
+
}
|
|
759
975
|
function unicornQueueRules2(queue, severity) {
|
|
760
|
-
return Object.fromEntries(queue.map((
|
|
976
|
+
return Object.fromEntries(queue.map((rule2) => [rule2, severity]));
|
|
977
|
+
}
|
|
978
|
+
function managedPromotionRules(tier) {
|
|
979
|
+
const rules = {};
|
|
980
|
+
for (const definition of MANAGED_RULES) {
|
|
981
|
+
const severity = definition.severityAtTier[tier];
|
|
982
|
+
if (severity !== "error") {
|
|
983
|
+
continue;
|
|
984
|
+
}
|
|
985
|
+
const priorSeverity = definition.severityAtTier[tier - 1];
|
|
986
|
+
if (priorSeverity === severity) {
|
|
987
|
+
continue;
|
|
988
|
+
}
|
|
989
|
+
rules[definition.rule] = definition.options ?? severity;
|
|
990
|
+
}
|
|
991
|
+
rules["unicorn/filename-case"] = filenameCaseRule2("error");
|
|
992
|
+
rules["no-extra-boolean-cast"] = "off";
|
|
993
|
+
rules["unicorn/no-useless-boolean-cast"] = "off";
|
|
994
|
+
return rules;
|
|
761
995
|
}
|
|
762
996
|
var opinionatedLayerConfig = {
|
|
763
997
|
files: scriptFiles,
|
|
764
998
|
rules: {
|
|
765
999
|
"@typescript-eslint/strict-boolean-expressions": "warn",
|
|
766
1000
|
"no-extra-boolean-cast": "off",
|
|
767
|
-
"unicorn/filename-case":
|
|
1001
|
+
"unicorn/filename-case": filenameCaseRule2("warn"),
|
|
768
1002
|
"unicorn/no-await-expression-member": "warn",
|
|
769
1003
|
"unicorn/no-useless-boolean-cast": "off",
|
|
770
1004
|
"unicorn/number-literal-case": "warn",
|
|
@@ -772,45 +1006,18 @@ var opinionatedLayerConfig = {
|
|
|
772
1006
|
"workspaces/require-dependency": "warn"
|
|
773
1007
|
}
|
|
774
1008
|
};
|
|
1009
|
+
function opinionatedUnicornPresetLayerConfigForTier(tier) {
|
|
1010
|
+
return {
|
|
1011
|
+
files: scriptFiles,
|
|
1012
|
+
rules: unicornOpinionatedRuleEntries("error", tier)
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
var opinionatedUnicornPresetLayerConfig = opinionatedUnicornPresetLayerConfigForTier(3);
|
|
775
1016
|
var opinionatedUnicornV66LayerConfig = {
|
|
776
1017
|
files: scriptFiles,
|
|
777
1018
|
rules: unicornQueueRules2(unicornV66MigrationQueue, "warn")
|
|
778
1019
|
};
|
|
779
|
-
var opinionatedPromotionRules =
|
|
780
|
-
"@stylistic/eol-last": "error",
|
|
781
|
-
"@typescript-eslint/no-empty-function": "error",
|
|
782
|
-
"@typescript-eslint/no-deprecated": "error",
|
|
783
|
-
"array-element-newline": "error",
|
|
784
|
-
"import-x/no-absolute-path": "error",
|
|
785
|
-
"import-x/no-cycle": "error",
|
|
786
|
-
"import-x/no-restricted-paths": "error",
|
|
787
|
-
"import-x/no-self-import": "error",
|
|
788
|
-
"import-x/no-useless-path-segments": "error",
|
|
789
|
-
"no-restricted-syntax": "error",
|
|
790
|
-
"simple-import-sort/exports": "error",
|
|
791
|
-
"simple-import-sort/imports": "error",
|
|
792
|
-
"unicorn/no-useless-undefined": "error",
|
|
793
|
-
"no-extra-boolean-cast": "off",
|
|
794
|
-
"unicorn/no-useless-boolean-cast": "off",
|
|
795
|
-
"unicorn/filename-case": filenameCaseRule("error"),
|
|
796
|
-
...Object.fromEntries([
|
|
797
|
-
"@typescript-eslint/consistent-type-imports",
|
|
798
|
-
"@typescript-eslint/explicit-member-accessibility",
|
|
799
|
-
"@typescript-eslint/member-ordering",
|
|
800
|
-
"@stylistic/brace-style",
|
|
801
|
-
"@stylistic/function-call-argument-newline",
|
|
802
|
-
"@stylistic/function-paren-newline",
|
|
803
|
-
"@stylistic/object-curly-newline",
|
|
804
|
-
"@stylistic/object-property-newline",
|
|
805
|
-
"@stylistic/quotes",
|
|
806
|
-
"@stylistic/max-len",
|
|
807
|
-
"unicorn/no-await-expression-member",
|
|
808
|
-
"unicorn/number-literal-case",
|
|
809
|
-
"workspaces/no-relative-imports",
|
|
810
|
-
"workspaces/require-dependency",
|
|
811
|
-
"@typescript-eslint/strict-boolean-expressions"
|
|
812
|
-
].map((rule) => [rule, "error"]))
|
|
813
|
-
};
|
|
1020
|
+
var opinionatedPromotionRules = managedPromotionRules(3);
|
|
814
1021
|
var opinionatedPromotionLayerConfig = {
|
|
815
1022
|
files: scriptFiles,
|
|
816
1023
|
rules: opinionatedPromotionRules
|
|
@@ -821,82 +1028,169 @@ var experimentalUnicornLayerConfig = {
|
|
|
821
1028
|
files: scriptFiles,
|
|
822
1029
|
rules: unicornQueueRules2(unicornV67MigrationQueue, "warn")
|
|
823
1030
|
};
|
|
1031
|
+
var experimentalUnicornV69LayerConfig = {
|
|
1032
|
+
files: scriptFiles,
|
|
1033
|
+
rules: unicornQueueRules2(unicornV69MigrationQueue, "warn")
|
|
1034
|
+
};
|
|
824
1035
|
var experimentalLayerConfig = experimentalUnicornLayerConfig;
|
|
825
1036
|
var experimentalPromotionRules = experimentalUnicornLayerConfig.rules;
|
|
826
1037
|
|
|
827
|
-
// src/tiers/
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
1038
|
+
// src/tiers/rule-catalog/type-checked-rules.ts
|
|
1039
|
+
import tsPlugin2 from "@typescript-eslint/eslint-plugin";
|
|
1040
|
+
function ruleNamesFromConfigs(configs) {
|
|
1041
|
+
if (!configs) return /* @__PURE__ */ new Set();
|
|
1042
|
+
return new Set(Object.keys(mergeConfigRules(Array.isArray(configs) ? configs : [configs])));
|
|
1043
|
+
}
|
|
1044
|
+
function ruleNamesFromPreset(preset) {
|
|
1045
|
+
return ruleNamesFromConfigs(preset);
|
|
1046
|
+
}
|
|
1047
|
+
function diffRuleSets(typeChecked, untyped) {
|
|
1048
|
+
const onlyTypeChecked = /* @__PURE__ */ new Set();
|
|
1049
|
+
for (const rule2 of typeChecked) {
|
|
1050
|
+
if (!untyped.has(rule2)) {
|
|
1051
|
+
onlyTypeChecked.add(rule2);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
return onlyTypeChecked;
|
|
1055
|
+
}
|
|
1056
|
+
function typescriptPresetRuleDiff() {
|
|
1057
|
+
const flatConfigs2 = tsPlugin2.configs;
|
|
1058
|
+
const recommendedTypeChecked = ruleNamesFromPreset(flatConfigs2["flat/recommended-type-checked"]);
|
|
1059
|
+
const recommended = ruleNamesFromPreset(flatConfigs2["flat/recommended"]);
|
|
1060
|
+
const stylisticTypeChecked = ruleNamesFromPreset(flatConfigs2["flat/stylistic-type-checked"]);
|
|
1061
|
+
const stylistic = ruleNamesFromPreset(flatConfigs2["flat/stylistic"]);
|
|
1062
|
+
return /* @__PURE__ */ new Set([
|
|
1063
|
+
...diffRuleSets(recommendedTypeChecked, recommended),
|
|
1064
|
+
...diffRuleSets(stylisticTypeChecked, stylistic)
|
|
1065
|
+
]);
|
|
1066
|
+
}
|
|
1067
|
+
var EXPLICIT_TYPE_CHECKED_RULES = [
|
|
1068
|
+
"@typescript-eslint/no-deprecated",
|
|
1069
|
+
"@typescript-eslint/strict-boolean-expressions"
|
|
846
1070
|
];
|
|
1071
|
+
var typeCheckedRuleNamesCache = {};
|
|
1072
|
+
function collectTypeCheckedRuleNames() {
|
|
1073
|
+
if (typeCheckedRuleNamesCache.names === void 0) {
|
|
1074
|
+
typeCheckedRuleNamesCache.names = /* @__PURE__ */ new Set([
|
|
1075
|
+
...typescriptPresetRuleDiff(),
|
|
1076
|
+
...EXPLICIT_TYPE_CHECKED_RULES
|
|
1077
|
+
]);
|
|
1078
|
+
}
|
|
1079
|
+
return typeCheckedRuleNamesCache.names;
|
|
1080
|
+
}
|
|
1081
|
+
function buildTypeCheckGateRules() {
|
|
1082
|
+
return Object.fromEntries(
|
|
1083
|
+
[...collectTypeCheckedRuleNames()].map((rule2) => [rule2, "off"])
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
// src/tiers/rule-catalog/index.ts
|
|
1088
|
+
function severityForTier(definition, tier) {
|
|
1089
|
+
let resolved;
|
|
1090
|
+
for (let current = 0; current <= tier; current = current + 1) {
|
|
1091
|
+
const severity = definition.severityAtTier[current];
|
|
1092
|
+
if (severity !== void 0) {
|
|
1093
|
+
resolved = severity;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
return resolved;
|
|
1097
|
+
}
|
|
1098
|
+
function managedRulesForTier(tier, isTypeChecked) {
|
|
1099
|
+
return MANAGED_RULES.filter((definition) => definition.introducedAtTier <= tier && (!definition.isTypeCheckingRequired || isTypeChecked));
|
|
1100
|
+
}
|
|
1101
|
+
function buildManagedRulesMap(tier, isTypeChecked) {
|
|
1102
|
+
const rules = {};
|
|
1103
|
+
for (const definition of managedRulesForTier(tier, isTypeChecked)) {
|
|
1104
|
+
const severity = severityForTier(definition, tier);
|
|
1105
|
+
if (severity === void 0) {
|
|
1106
|
+
continue;
|
|
1107
|
+
}
|
|
1108
|
+
rules[definition.rule] = severity === "off" ? "off" : definition.options ?? severity;
|
|
1109
|
+
}
|
|
1110
|
+
return rules;
|
|
1111
|
+
}
|
|
1112
|
+
function buildManagedRulesLayer(tier, isTypeChecked) {
|
|
1113
|
+
return {
|
|
1114
|
+
files: scriptFiles,
|
|
1115
|
+
rules: buildManagedRulesMap(tier, isTypeChecked)
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
function buildTypeCheckGateLayer() {
|
|
1119
|
+
return {
|
|
1120
|
+
files: scriptFiles,
|
|
1121
|
+
rules: buildTypeCheckGateRules()
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
function findEnabledTypeCheckedRules(rules) {
|
|
1125
|
+
const typeCheckedRuleNames = collectTypeCheckedRuleNames();
|
|
1126
|
+
return [...typeCheckedRuleNames].filter((rule2) => {
|
|
1127
|
+
const severity = getRuleSeverity(rules[rule2]);
|
|
1128
|
+
return severity !== void 0 && severity !== "off";
|
|
1129
|
+
}).toSorted();
|
|
1130
|
+
}
|
|
1131
|
+
function categoryForTier(tier) {
|
|
1132
|
+
switch (tier) {
|
|
1133
|
+
case 0: {
|
|
1134
|
+
return "correctness";
|
|
1135
|
+
}
|
|
1136
|
+
case 1: {
|
|
1137
|
+
return "consistency";
|
|
1138
|
+
}
|
|
1139
|
+
case 2: {
|
|
1140
|
+
return "best-practices";
|
|
1141
|
+
}
|
|
1142
|
+
case 3: {
|
|
1143
|
+
return "opinionated";
|
|
1144
|
+
}
|
|
1145
|
+
case 4: {
|
|
1146
|
+
return "experimental";
|
|
1147
|
+
}
|
|
1148
|
+
default: {
|
|
1149
|
+
const unsupported = tier;
|
|
1150
|
+
throw new Error(`Unsupported lint tier ${unsupported}`);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
// src/tiers/tier-builder.ts
|
|
847
1156
|
function mergeTierConfigs(...parts) {
|
|
848
1157
|
return parts.flat();
|
|
849
1158
|
}
|
|
850
|
-
function
|
|
1159
|
+
function structuralTier0(isTypeChecked) {
|
|
851
1160
|
return mergeTierConfigs(
|
|
852
1161
|
markdownConfig,
|
|
853
1162
|
correctnessCoreConfig,
|
|
854
1163
|
isTypeChecked ? typescriptTypeCheckedCorrectnessConfig : typescriptCorrectnessConfig
|
|
855
1164
|
);
|
|
856
1165
|
}
|
|
857
|
-
function
|
|
1166
|
+
function structuralTier1(isTypeChecked) {
|
|
858
1167
|
return mergeTierConfigs(
|
|
859
|
-
|
|
1168
|
+
structuralTier0(isTypeChecked),
|
|
860
1169
|
[consistencyRulesConfig],
|
|
861
1170
|
isTypeChecked ? typescriptTypeCheckedConsistencyConfig : typescriptConsistencyConfig,
|
|
862
1171
|
[typescriptDelegationConfig]
|
|
863
1172
|
);
|
|
864
1173
|
}
|
|
865
|
-
function
|
|
1174
|
+
function structuralTier2(isTypeChecked) {
|
|
866
1175
|
return mergeTierConfigs(
|
|
867
|
-
|
|
1176
|
+
structuralTier1(isTypeChecked),
|
|
868
1177
|
bestPracticesCoreConfig,
|
|
869
|
-
importConfig
|
|
870
|
-
|
|
871
|
-
}
|
|
872
|
-
function buildTier3(isTypeChecked) {
|
|
873
|
-
return mergeTierConfigs(
|
|
874
|
-
buildTier2(isTypeChecked),
|
|
875
|
-
[opinionatedUnicornV66LayerConfig, opinionatedPromotionLayerConfig]
|
|
876
|
-
);
|
|
877
|
-
}
|
|
878
|
-
function buildTier4(isTypeChecked) {
|
|
879
|
-
return mergeTierConfigs(
|
|
880
|
-
buildTier3(isTypeChecked),
|
|
881
|
-
[experimentalUnicornLayerConfig]
|
|
1178
|
+
importConfig,
|
|
1179
|
+
[workspacesConfig]
|
|
882
1180
|
);
|
|
883
1181
|
}
|
|
884
|
-
function
|
|
1182
|
+
function structuralLayersForTier(tier, isTypeChecked) {
|
|
885
1183
|
switch (tier) {
|
|
886
1184
|
case 0: {
|
|
887
|
-
return
|
|
1185
|
+
return structuralTier0(isTypeChecked);
|
|
888
1186
|
}
|
|
889
1187
|
case 1: {
|
|
890
|
-
return
|
|
891
|
-
}
|
|
892
|
-
case 2: {
|
|
893
|
-
return buildTier2(isTypeChecked);
|
|
894
|
-
}
|
|
895
|
-
case 3: {
|
|
896
|
-
return buildTier3(isTypeChecked);
|
|
1188
|
+
return structuralTier1(isTypeChecked);
|
|
897
1189
|
}
|
|
1190
|
+
case 2:
|
|
1191
|
+
case 3:
|
|
898
1192
|
case 4: {
|
|
899
|
-
return
|
|
1193
|
+
return structuralTier2(isTypeChecked);
|
|
900
1194
|
}
|
|
901
1195
|
default: {
|
|
902
1196
|
const unsupported = tier;
|
|
@@ -904,6 +1198,56 @@ function buildTierConfig(tier, isTypeChecked) {
|
|
|
904
1198
|
}
|
|
905
1199
|
}
|
|
906
1200
|
}
|
|
1201
|
+
function appendTypeCheckGate(configs, isTypeChecked) {
|
|
1202
|
+
if (isTypeChecked) {
|
|
1203
|
+
return configs;
|
|
1204
|
+
}
|
|
1205
|
+
return [...configs, buildTypeCheckGateLayer()];
|
|
1206
|
+
}
|
|
1207
|
+
function opinionatedLayersForTier(tier) {
|
|
1208
|
+
if (tier < 3) {
|
|
1209
|
+
return [];
|
|
1210
|
+
}
|
|
1211
|
+
const layers = [
|
|
1212
|
+
opinionatedUnicornPresetLayerConfigForTier(tier),
|
|
1213
|
+
opinionatedUnicornV66LayerConfig
|
|
1214
|
+
];
|
|
1215
|
+
if (tier >= 4) {
|
|
1216
|
+
layers.push(experimentalUnicornLayerConfig, experimentalUnicornV69LayerConfig);
|
|
1217
|
+
}
|
|
1218
|
+
return layers;
|
|
1219
|
+
}
|
|
1220
|
+
var globalIgnoresConfig = { ignores };
|
|
1221
|
+
function buildTierConfig(tier, isTypeChecked) {
|
|
1222
|
+
const configs = mergeTierConfigs(
|
|
1223
|
+
[globalIgnoresConfig],
|
|
1224
|
+
structuralLayersForTier(tier, isTypeChecked),
|
|
1225
|
+
opinionatedLayersForTier(tier),
|
|
1226
|
+
[buildManagedRulesLayer(tier, isTypeChecked)]
|
|
1227
|
+
);
|
|
1228
|
+
return appendTypeCheckGate(configs, isTypeChecked);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
// src/tiers/recommendedConfig.ts
|
|
1232
|
+
var DEFAULT_RECOMMENDED_CONFIG_OPTIONS = {
|
|
1233
|
+
isTypeChecked: true,
|
|
1234
|
+
tier: 3
|
|
1235
|
+
};
|
|
1236
|
+
var composedConfigModules = [
|
|
1237
|
+
"bestPracticesCoreConfig",
|
|
1238
|
+
"consistencyRulesConfig",
|
|
1239
|
+
"correctnessCoreConfig",
|
|
1240
|
+
"importConfig",
|
|
1241
|
+
"rulesConfig",
|
|
1242
|
+
"typescriptConfig",
|
|
1243
|
+
"typescriptConsistencyConfig",
|
|
1244
|
+
"typescriptCorrectnessConfig",
|
|
1245
|
+
"typescriptTypeCheckedConfig",
|
|
1246
|
+
"typescriptTypeCheckedConsistencyConfig",
|
|
1247
|
+
"typescriptTypeCheckedCorrectnessConfig",
|
|
1248
|
+
"unicornConfig",
|
|
1249
|
+
"workspacesConfig"
|
|
1250
|
+
];
|
|
907
1251
|
function resolveRecommendedConfigOptions(options) {
|
|
908
1252
|
return {
|
|
909
1253
|
isTypeChecked: options?.isTypeChecked ?? DEFAULT_RECOMMENDED_CONFIG_OPTIONS.isTypeChecked,
|
|
@@ -975,17 +1319,17 @@ import js2 from "@eslint/js";
|
|
|
975
1319
|
import json2 from "@eslint/json";
|
|
976
1320
|
import markdown2 from "@eslint/markdown";
|
|
977
1321
|
import esStylistic2 from "@stylistic/eslint-plugin";
|
|
978
|
-
import
|
|
1322
|
+
import tsPlugin3 from "@typescript-eslint/eslint-plugin";
|
|
979
1323
|
import importPlugin2 from "eslint-plugin-import-x";
|
|
980
1324
|
import simpleImportSort2 from "eslint-plugin-simple-import-sort";
|
|
981
1325
|
import unicornPlugin2 from "eslint-plugin-unicorn";
|
|
982
1326
|
import workspacesPlugin2 from "eslint-plugin-workspaces";
|
|
983
|
-
var
|
|
1327
|
+
var compareStrings2 = (left, right) => left.localeCompare(right);
|
|
984
1328
|
function sortedRuleNames(rules) {
|
|
985
1329
|
if (!rules) {
|
|
986
1330
|
return [];
|
|
987
1331
|
}
|
|
988
|
-
return Object.keys(rules).toSorted(
|
|
1332
|
+
return Object.keys(rules).toSorted(compareStrings2);
|
|
989
1333
|
}
|
|
990
1334
|
function sortedRuleNamesFromConfigs(configs) {
|
|
991
1335
|
if (!configs) {
|
|
@@ -1004,12 +1348,12 @@ function pluginRuleNames(plugin) {
|
|
|
1004
1348
|
return [];
|
|
1005
1349
|
}
|
|
1006
1350
|
const prefix = typeof plugin.meta?.name === "string" ? plugin.meta.name.replace(/^eslint-plugin-/, "").replace(/^@eslint\//, "") : "unknown";
|
|
1007
|
-
return Object.keys(plugin.rules).toSorted(
|
|
1351
|
+
return Object.keys(plugin.rules).toSorted(compareStrings2).map((ruleName) => `${prefix}/${ruleName}`);
|
|
1008
1352
|
}
|
|
1009
1353
|
function collectPluginRuleSnapshots() {
|
|
1010
1354
|
const unicornRecommended = unicornPlugin2.configs["flat/recommended"];
|
|
1011
1355
|
const importRecommended = importPlugin2.flatConfigs.recommended;
|
|
1012
|
-
const flatConfigs2 =
|
|
1356
|
+
const flatConfigs2 = tsPlugin3.configs;
|
|
1013
1357
|
const workspacesRecommended = workspacesPlugin2.configs.recommended;
|
|
1014
1358
|
return [
|
|
1015
1359
|
{
|
|
@@ -1034,6 +1378,16 @@ function collectPluginRuleSnapshots() {
|
|
|
1034
1378
|
rules: sortedRuleNames(esStylistic2.configs.recommended.rules),
|
|
1035
1379
|
source: "configs.recommended"
|
|
1036
1380
|
},
|
|
1381
|
+
{
|
|
1382
|
+
plugin: "@typescript-eslint/eslint-plugin",
|
|
1383
|
+
rules: sortedRuleNamesFromConfigs(flatConfigs2["flat/recommended"]),
|
|
1384
|
+
source: "configs.flat/recommended"
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
plugin: "@typescript-eslint/eslint-plugin",
|
|
1388
|
+
rules: sortedRuleNamesFromConfigs(flatConfigs2["flat/stylistic"]),
|
|
1389
|
+
source: "configs.flat/stylistic"
|
|
1390
|
+
},
|
|
1037
1391
|
{
|
|
1038
1392
|
plugin: "@typescript-eslint/eslint-plugin",
|
|
1039
1393
|
rules: sortedRuleNamesFromConfigs(flatConfigs2["flat/recommended-type-checked"]),
|
|
@@ -1085,11 +1439,17 @@ var docsConfig = [
|
|
|
1085
1439
|
];
|
|
1086
1440
|
export {
|
|
1087
1441
|
DEFAULT_RECOMMENDED_CONFIG_OPTIONS,
|
|
1442
|
+
MANAGED_RULES as RULE_CATALOG,
|
|
1088
1443
|
RULE_OWNERSHIP_GROUPS,
|
|
1089
1444
|
applyRecommendedConfigTypeChecked,
|
|
1090
1445
|
assertNoRuleOwnershipConflicts,
|
|
1091
1446
|
bestPracticesCoreConfig,
|
|
1447
|
+
buildManagedRulesLayer,
|
|
1448
|
+
buildTierConfig,
|
|
1449
|
+
buildTypeCheckGateLayer,
|
|
1450
|
+
categoryForTier,
|
|
1092
1451
|
collectPluginRuleSnapshots,
|
|
1452
|
+
collectTypeCheckedRuleNames,
|
|
1093
1453
|
config,
|
|
1094
1454
|
configTier0Correctness,
|
|
1095
1455
|
configTier0CorrectnessTypeChecked,
|
|
@@ -1109,18 +1469,24 @@ export {
|
|
|
1109
1469
|
experimentalLayerConfig,
|
|
1110
1470
|
experimentalPromotionRules,
|
|
1111
1471
|
experimentalUnicornLayerConfig,
|
|
1472
|
+
experimentalUnicornV69LayerConfig,
|
|
1473
|
+
findEnabledTypeCheckedRules,
|
|
1112
1474
|
findRuleOwnershipConflicts,
|
|
1113
1475
|
formatRecommendedConfigCall,
|
|
1476
|
+
getRuleSeverity,
|
|
1477
|
+
globalIgnoresConfig,
|
|
1114
1478
|
ignores,
|
|
1115
1479
|
importConfig,
|
|
1116
1480
|
json5Config,
|
|
1117
1481
|
jsonConfig,
|
|
1118
1482
|
jsoncConfig,
|
|
1483
|
+
managedRulesForTier,
|
|
1119
1484
|
markdownConfig,
|
|
1120
1485
|
mergeConfigRules,
|
|
1121
1486
|
opinionatedLayerConfig,
|
|
1122
1487
|
opinionatedPromotionLayerConfig,
|
|
1123
1488
|
opinionatedPromotionRules,
|
|
1489
|
+
opinionatedUnicornPresetLayerConfig,
|
|
1124
1490
|
opinionatedUnicornV66LayerConfig,
|
|
1125
1491
|
parseRecommendedConfigSource,
|
|
1126
1492
|
recommendedConfig,
|
|
@@ -1140,9 +1506,12 @@ export {
|
|
|
1140
1506
|
typescriptTypeCheckedCorrectnessConfig,
|
|
1141
1507
|
unicornConfig,
|
|
1142
1508
|
unicornExperimentalMigrationQueue,
|
|
1509
|
+
unicornOpinionatedRules,
|
|
1510
|
+
unicornOpinionatedRulesForTier,
|
|
1143
1511
|
unicornV66MigrationQueue,
|
|
1144
1512
|
unicornV66NewRules,
|
|
1145
1513
|
unicornV67MigrationQueue,
|
|
1514
|
+
unicornV69MigrationQueue,
|
|
1146
1515
|
workspacesConfig
|
|
1147
1516
|
};
|
|
1148
1517
|
//# sourceMappingURL=index.mjs.map
|