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