eslint-config-un 0.6.1 → 0.6.2
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/dist/index.cjs +209 -275
- package/dist/index.d.cts +75 -132
- package/dist/index.d.ts +75 -132
- package/dist/index.js +209 -275
- package/package.json +14 -14
package/dist/index.cjs
CHANGED
|
@@ -40,12 +40,12 @@ var init_cjs_shims = __esm({
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
// node_modules/.pnpm/@eslint+js@9.
|
|
43
|
+
// node_modules/.pnpm/@eslint+js@9.22.0/node_modules/@eslint/js/package.json
|
|
44
44
|
var require_package = __commonJS({
|
|
45
|
-
"node_modules/.pnpm/@eslint+js@9.
|
|
45
|
+
"node_modules/.pnpm/@eslint+js@9.22.0/node_modules/@eslint/js/package.json"(exports2, module2) {
|
|
46
46
|
module2.exports = {
|
|
47
47
|
name: "@eslint/js",
|
|
48
|
-
version: "9.
|
|
48
|
+
version: "9.22.0",
|
|
49
49
|
description: "ESLint JavaScript language implementation",
|
|
50
50
|
main: "./src/index.js",
|
|
51
51
|
types: "./types/index.d.ts",
|
|
@@ -81,9 +81,9 @@ var require_package = __commonJS({
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
// node_modules/.pnpm/@eslint+js@9.
|
|
84
|
+
// node_modules/.pnpm/@eslint+js@9.22.0/node_modules/@eslint/js/src/configs/eslint-all.js
|
|
85
85
|
var require_eslint_all = __commonJS({
|
|
86
|
-
"node_modules/.pnpm/@eslint+js@9.
|
|
86
|
+
"node_modules/.pnpm/@eslint+js@9.22.0/node_modules/@eslint/js/src/configs/eslint-all.js"(exports2, module2) {
|
|
87
87
|
"use strict";
|
|
88
88
|
init_cjs_shims();
|
|
89
89
|
module2.exports = Object.freeze({
|
|
@@ -290,9 +290,9 @@ var require_eslint_all = __commonJS({
|
|
|
290
290
|
}
|
|
291
291
|
});
|
|
292
292
|
|
|
293
|
-
// node_modules/.pnpm/@eslint+js@9.
|
|
293
|
+
// node_modules/.pnpm/@eslint+js@9.22.0/node_modules/@eslint/js/src/configs/eslint-recommended.js
|
|
294
294
|
var require_eslint_recommended = __commonJS({
|
|
295
|
-
"node_modules/.pnpm/@eslint+js@9.
|
|
295
|
+
"node_modules/.pnpm/@eslint+js@9.22.0/node_modules/@eslint/js/src/configs/eslint-recommended.js"(exports2, module2) {
|
|
296
296
|
"use strict";
|
|
297
297
|
init_cjs_shims();
|
|
298
298
|
module2.exports = Object.freeze({
|
|
@@ -363,9 +363,9 @@ var require_eslint_recommended = __commonJS({
|
|
|
363
363
|
}
|
|
364
364
|
});
|
|
365
365
|
|
|
366
|
-
// node_modules/.pnpm/@eslint+js@9.
|
|
366
|
+
// node_modules/.pnpm/@eslint+js@9.22.0/node_modules/@eslint/js/src/index.js
|
|
367
367
|
var require_src = __commonJS({
|
|
368
|
-
"node_modules/.pnpm/@eslint+js@9.
|
|
368
|
+
"node_modules/.pnpm/@eslint+js@9.22.0/node_modules/@eslint/js/src/index.js"(exports2, module2) {
|
|
369
369
|
"use strict";
|
|
370
370
|
init_cjs_shims();
|
|
371
371
|
var { name, version } = require_package();
|
|
@@ -479,7 +479,8 @@ var disableAutofixForAllRulesInPlugin = (pluginNamespace, plugin) => Object.from
|
|
|
479
479
|
})
|
|
480
480
|
);
|
|
481
481
|
var ConfigEntryBuilder = class {
|
|
482
|
-
constructor(options, internalOptions) {
|
|
482
|
+
constructor(rulesPrefix, options, internalOptions) {
|
|
483
|
+
this.rulesPrefix = rulesPrefix;
|
|
483
484
|
this.options = options;
|
|
484
485
|
this.internalOptions = internalOptions;
|
|
485
486
|
}
|
|
@@ -505,31 +506,28 @@ var ConfigEntryBuilder = class {
|
|
|
505
506
|
};
|
|
506
507
|
this.configs.push(configFinal);
|
|
507
508
|
this.configsDict.set(configName, configFinal);
|
|
508
|
-
const generateAddRuleFn = (
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
(
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
configFinal.rules[
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
if (
|
|
521
|
-
|
|
522
|
-
if (baseRuleName) {
|
|
523
|
-
configFinal.rules[baseRuleName] = 0;
|
|
524
|
-
}
|
|
509
|
+
const generateAddRuleFn = (allowAnyRule) => (ruleName, severity, ruleOptions, options) => {
|
|
510
|
+
const ruleNameWithPrefix = allowAnyRule || !this.rulesPrefix ? ruleName : `${this.rulesPrefix}/${ruleName}`;
|
|
511
|
+
const errorsInsteadOfWarnings = this.internalOptions.globalOptions?.errorsInsteadOfWarnings;
|
|
512
|
+
const severityFinal = configOptions.forceSeverity ?? (severity === WARNING && (errorsInsteadOfWarnings === true || Array.isArray(errorsInsteadOfWarnings) && errorsInsteadOfWarnings.includes(ruleNameWithPrefix)) ? ERROR : severity);
|
|
513
|
+
const ruleNameFinal = `${options?.disableAutofix ? "disable-autofix/" : ""}${ruleNameWithPrefix}`;
|
|
514
|
+
configFinal.rules ||= {};
|
|
515
|
+
configFinal.rules[ruleNameFinal] = [severityFinal, ...ruleOptions || []];
|
|
516
|
+
if (options?.disableAutofix) {
|
|
517
|
+
configFinal.rules[ruleNameWithPrefix] = 0;
|
|
518
|
+
}
|
|
519
|
+
if (options?.overrideBaseRule) {
|
|
520
|
+
const baseRuleName = typeof options.overrideBaseRule === "string" ? options.overrideBaseRule : ruleNameWithPrefix.split("/").slice(1).join("/");
|
|
521
|
+
if (baseRuleName) {
|
|
522
|
+
configFinal.rules[baseRuleName] = 0;
|
|
525
523
|
}
|
|
526
|
-
return result;
|
|
527
524
|
}
|
|
528
|
-
|
|
525
|
+
return result;
|
|
526
|
+
};
|
|
529
527
|
const result = {
|
|
530
528
|
config: configFinal,
|
|
531
|
-
addRule: generateAddRuleFn(),
|
|
532
|
-
addAnyRule: generateAddRuleFn(),
|
|
529
|
+
addRule: generateAddRuleFn(false),
|
|
530
|
+
addAnyRule: generateAddRuleFn(true),
|
|
533
531
|
addOverrides: () => {
|
|
534
532
|
configFinal.rules ||= {};
|
|
535
533
|
Object.assign(configFinal.rules, this.options.overrides);
|
|
@@ -561,29 +559,29 @@ var cssInJsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
561
559
|
propertyCasing = "camelCase"
|
|
562
560
|
} = options;
|
|
563
561
|
const preferNamedColors = typeof preferNamedColorsRaw === "object" ? preferNamedColorsRaw : { flag: preferNamedColorsRaw ?? false };
|
|
564
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
562
|
+
const builder = new ConfigEntryBuilder("css-in-js", options, internalOptions);
|
|
565
563
|
builder.addConfig(["css-in-js", { includeDefaultFilesAndIgnores: true }], {
|
|
566
564
|
...pluginSettings && {
|
|
567
565
|
settings: {
|
|
568
566
|
css: pluginSettings
|
|
569
567
|
}
|
|
570
568
|
}
|
|
571
|
-
}).addRule("
|
|
569
|
+
}).addRule("color-hex-style", ERROR, [hexColorsStyle === "long" ? "RRGGBB" : "RGB"]).addRule("named-color", ERROR, [
|
|
572
570
|
preferNamedColors.flag ? "always" : "never",
|
|
573
571
|
{
|
|
574
572
|
...preferNamedColors.ignoreProperties?.length && {
|
|
575
573
|
ignoreProperties: preferNamedColors.ignoreProperties
|
|
576
574
|
}
|
|
577
575
|
}
|
|
578
|
-
]).addRule("
|
|
576
|
+
]).addRule("no-dupe-properties", ERROR).addRule("no-invalid-color-hex", ERROR).addRule("no-length-zero-unit", ERROR).addRule("no-number-trailing-zeros", ERROR).addRule("no-shorthand-property-overrides", ERROR).addRule("no-unknown-property", ERROR).addRule("no-unknown-unit", ERROR).addRule("no-useless-color-alpha", ERROR).addRule("number-leading-zero", ERROR, [avoidLeadingZero ? "never" : "always"]).addRule("prefer-reduce-shorthand-property-box-values", ERROR).addRule("property-casing", ERROR, [propertyCasing]).addOverrides();
|
|
579
577
|
return builder.getAllConfigs();
|
|
580
578
|
};
|
|
581
579
|
|
|
582
580
|
// src/configs/de-morgan.ts
|
|
583
581
|
init_cjs_shims();
|
|
584
582
|
var deMorganEslintConfig = (options = {}, internalOptions = {}) => {
|
|
585
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
586
|
-
builder.addConfig(["de-morgan", { includeDefaultFilesAndIgnores: true }]).addRule("
|
|
583
|
+
const builder = new ConfigEntryBuilder("de-morgan", options, internalOptions);
|
|
584
|
+
builder.addConfig(["de-morgan", { includeDefaultFilesAndIgnores: true }]).addRule("no-negated-conjunction", ERROR).addRule("no-negated-disjunction", ERROR).addOverrides();
|
|
587
585
|
return builder.getAllConfigs();
|
|
588
586
|
};
|
|
589
587
|
|
|
@@ -592,12 +590,11 @@ init_cjs_shims();
|
|
|
592
590
|
var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
|
|
593
591
|
var eslintCommentsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
594
592
|
const builder = new ConfigEntryBuilder(
|
|
593
|
+
"@eslint-community/eslint-comments",
|
|
595
594
|
options,
|
|
596
595
|
internalOptions
|
|
597
596
|
);
|
|
598
|
-
builder.addConfig(["eslint-comments", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_eslint_comments.default.configs.recommended.rules).addRule("
|
|
599
|
-
{ allowWholeFile: true }
|
|
600
|
-
]).addOverrides();
|
|
597
|
+
builder.addConfig(["eslint-comments", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_eslint_comments.default.configs.recommended.rules).addRule("disable-enable-pair", ERROR, [{ allowWholeFile: true }]).addOverrides();
|
|
601
598
|
return builder.getAllConfigs();
|
|
602
599
|
};
|
|
603
600
|
|
|
@@ -606,7 +603,7 @@ init_cjs_shims();
|
|
|
606
603
|
var DEFAULT_CLI_DIRS = ["bin", "scripts", "cli"];
|
|
607
604
|
var cliEslintConfig = (options = {}, internalOptions = {}) => {
|
|
608
605
|
const { onlyTopLevelDirs } = options;
|
|
609
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
606
|
+
const builder = new ConfigEntryBuilder("", options, internalOptions);
|
|
610
607
|
builder.addConfig([
|
|
611
608
|
"cli",
|
|
612
609
|
{
|
|
@@ -644,7 +641,7 @@ var pluginRenamer = createPluginObjectRenamer("import-x", "import");
|
|
|
644
641
|
var importEslintConfig = (options = {}, internalOptions = {}) => {
|
|
645
642
|
const { isTypescriptEnabled, tsResolverOptions, noDuplicatesOptions } = options;
|
|
646
643
|
const noUnresolvedIgnores = arraify(options.importPatternsToIgnoreWhenTryingToResolve);
|
|
647
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
644
|
+
const builder = new ConfigEntryBuilder("import", options, internalOptions);
|
|
648
645
|
builder.addConfig(["import", { includeDefaultFilesAndIgnores: true }], {
|
|
649
646
|
settings: {
|
|
650
647
|
...isTypescriptEnabled && import_eslint_plugin_import_x.default.configs.typescript.settings,
|
|
@@ -653,8 +650,6 @@ var importEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
653
650
|
// TODO should report?
|
|
654
651
|
isTypescriptEnabled && (0, import_eslint_import_resolver_typescript.createTypeScriptImportResolver)({
|
|
655
652
|
alwaysTryTypes: true,
|
|
656
|
-
// Does not resolve paths in sub-directories with their own tsconfigs after 3.8.0 w/o explicit `project`: https://github.com/import-js/eslint-import-resolver-typescript/issues/364
|
|
657
|
-
project: "*/tsconfig*.json",
|
|
658
653
|
...tsResolverOptions
|
|
659
654
|
}),
|
|
660
655
|
import_eslint_plugin_import_x.default.createNodeResolver()
|
|
@@ -667,7 +662,7 @@ var importEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
667
662
|
}
|
|
668
663
|
}).addBulkRules(pluginRenamer(import_eslint_plugin_import_x.default.configs.recommended.rules)).addBulkRules(
|
|
669
664
|
isTypescriptEnabled && pluginRenamer(import_eslint_plugin_import_x.default.configs.typescript.rules)
|
|
670
|
-
).addRule("
|
|
665
|
+
).addRule("extensions", options.requireModuleExtensions ? ERROR : OFF, [
|
|
671
666
|
typeof options.requireModuleExtensions === "object" && options.requireModuleExtensions["*"] || "ignorePackages",
|
|
672
667
|
{
|
|
673
668
|
checkTypeImports: true,
|
|
@@ -676,13 +671,13 @@ var importEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
676
671
|
),
|
|
677
672
|
...typeof options.requireModuleExtensions === "object" && options.requireModuleExtensions
|
|
678
673
|
}
|
|
679
|
-
]).addRule("
|
|
674
|
+
]).addRule("first", ERROR).addRule("newline-after-import", ERROR).addRule("no-absolute-path", ERROR).addRule("no-cycle", WARNING).addRule("no-default-export", ERROR).addRule("no-deprecated", WARNING).addRule("no-duplicates", ERROR, [{ "prefer-inline": true, ...noDuplicatesOptions }]).addRule("no-empty-named-blocks", ERROR).addRule("no-extraneous-dependencies", ERROR, [{ peerDependencies: false }]).addRule("no-mutable-exports", WARNING).addRule("no-named-as-default-member", OFF).addRule("no-named-as-default", OFF).addRule("no-self-import", ERROR).addRule("no-unresolved", ERROR, [
|
|
680
675
|
{
|
|
681
676
|
...isNonEmptyArray(noUnresolvedIgnores) && {
|
|
682
677
|
ignore: noUnresolvedIgnores
|
|
683
678
|
}
|
|
684
679
|
}
|
|
685
|
-
]).addRule("
|
|
680
|
+
]).addRule("no-useless-path-segments", WARNING).addRule("no-webpack-loader-syntax", ERROR).addRule("order", ERROR, [
|
|
686
681
|
{
|
|
687
682
|
groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
|
|
688
683
|
alphabetize: { order: "asc" }
|
|
@@ -751,7 +746,7 @@ var jestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
751
746
|
const hasRestrictedMethods = Object.keys(restrictedMethods || {}).length > 0;
|
|
752
747
|
const hasRestrictedMatchers = Object.keys(restrictedMatchers || {}).length > 0;
|
|
753
748
|
const getPaddingAroundSeverity = (key) => paddingAround === true || paddingAround && paddingAround[key] !== false ? ERROR : OFF;
|
|
754
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
749
|
+
const builder = new ConfigEntryBuilder("jest", options, internalOptions);
|
|
755
750
|
builder.addConfig(
|
|
756
751
|
[
|
|
757
752
|
"jest",
|
|
@@ -764,18 +759,16 @@ var jestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
764
759
|
...defaultJestEslintConfig
|
|
765
760
|
}
|
|
766
761
|
).addBulkRules(import_eslint_plugin_jest.default.configs["flat/recommended"].rules).addRule(
|
|
767
|
-
"
|
|
762
|
+
"consistent-test-it",
|
|
768
763
|
options.testDefinitionKeyword === false ? OFF : ERROR,
|
|
769
764
|
generateConsistentTestItOptions(options)
|
|
770
|
-
).addRule("
|
|
771
|
-
{ max: maxAssertionCalls }
|
|
772
|
-
]).addRule("jest/max-nested-describe", maxNestedDescribes == null ? OFF : ERROR, [
|
|
765
|
+
).addRule("expect-expect", ERROR).addRule("max-expects", maxAssertionCalls == null ? OFF : ERROR, [{ max: maxAssertionCalls }]).addRule("max-nested-describe", maxNestedDescribes == null ? OFF : ERROR, [
|
|
773
766
|
{ max: maxNestedDescribes }
|
|
774
|
-
]).addRule("
|
|
767
|
+
]).addRule("no-commented-out-tests", WARNING).addRule("no-confusing-set-timeout", ERROR).addRule("no-duplicate-hooks", ERROR).addRule("no-restricted-jest-methods", hasRestrictedMethods ? ERROR : OFF, [
|
|
775
768
|
restrictedMethods || {}
|
|
776
|
-
]).addRule("
|
|
769
|
+
]).addRule("no-restricted-matchers", hasRestrictedMatchers ? ERROR : OFF, [
|
|
777
770
|
restrictedMatchers || {}
|
|
778
|
-
]).addRule("
|
|
771
|
+
]).addRule("no-test-return-statement", ERROR).addRule("padding-around-after-all-blocks", getPaddingAroundSeverity("afterAll")).addRule("padding-around-after-each-blocks", getPaddingAroundSeverity("afterEach")).addRule("padding-around-before-all-blocks", getPaddingAroundSeverity("beforeAll")).addRule("padding-around-before-each-blocks", getPaddingAroundSeverity("beforeEach")).addRule("padding-around-describe-blocks", getPaddingAroundSeverity("describe")).addRule("padding-around-expect-groups", getPaddingAroundSeverity("expect")).addRule("padding-around-test-blocks", getPaddingAroundSeverity("test")).addRule("prefer-comparison-matcher", ERROR).addRule("prefer-each", WARNING).addRule("prefer-equality-matcher", ERROR).addRule("prefer-expect-assertions", OFF).addRule("prefer-expect-resolves", ERROR).addRule("prefer-hooks-in-order", ERROR).addRule("prefer-hooks-on-top", ERROR).addRule("prefer-jest-mocked", ERROR).addRule("prefer-lowercase-title", ERROR).addRule("prefer-mock-promise-shorthand", ERROR).addRule("prefer-spy-on", ERROR).addRule("prefer-strict-equal", WARNING).addRule("prefer-to-be", ERROR).addRule("prefer-to-contain", ERROR).addRule("prefer-to-have-length", ERROR).addRule("prefer-todo", WARNING).addRule("require-hook", WARNING).addRule("require-to-throw-message", OFF).addRule("require-top-level-describe", OFF).addRule("valid-expect", ERROR, [
|
|
779
772
|
{
|
|
780
773
|
alwaysAwait: true,
|
|
781
774
|
// Default: false
|
|
@@ -787,8 +780,9 @@ var jestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
787
780
|
maxArgs: minAndMaxExpectArgs[1]
|
|
788
781
|
}
|
|
789
782
|
}
|
|
790
|
-
]).addRule("
|
|
783
|
+
]).addRule("valid-expect-in-promise", ERROR).addRule("valid-title", ERROR).addOverrides();
|
|
791
784
|
const tsBuilder = new ConfigEntryBuilder(
|
|
785
|
+
"jest",
|
|
792
786
|
typeof typescriptOnlyRules === "object" ? typescriptOnlyRules : {},
|
|
793
787
|
internalOptions
|
|
794
788
|
);
|
|
@@ -804,50 +798,37 @@ var jestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
804
798
|
{
|
|
805
799
|
...defaultJestEslintConfig
|
|
806
800
|
}
|
|
807
|
-
).addRule("
|
|
801
|
+
).addRule("no-untyped-mock-factory", ERROR).addRule("unbound-method", internalOptions.isTypescriptEnabled ? ERROR : OFF, [], {
|
|
808
802
|
// https://github.com/jest-community/eslint-plugin-jest/blob/HEAD/docs/rules/unbound-method.md#how-to-use
|
|
809
803
|
overrideBaseRule: "@typescript-eslint/unbound-method"
|
|
810
804
|
}).addOverrides();
|
|
811
805
|
}
|
|
812
806
|
const jestExtendedBuilder = new ConfigEntryBuilder(
|
|
807
|
+
"jest-extended",
|
|
813
808
|
typeof jestExtended === "object" ? jestExtended : {},
|
|
814
809
|
internalOptions
|
|
815
810
|
);
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
"jest/extended",
|
|
822
|
-
{
|
|
823
|
-
includeDefaultFilesAndIgnores: true,
|
|
824
|
-
filesFallback: defaultJestFiles
|
|
825
|
-
}
|
|
826
|
-
],
|
|
811
|
+
const { suggestUsing } = typeof jestExtended === "object" ? jestExtended : {};
|
|
812
|
+
const getSuggestUsingJestExtendedMatcherSeverity = (key) => suggestUsing === true || suggestUsing && suggestUsing[key] !== false ? ERROR : OFF;
|
|
813
|
+
jestExtendedBuilder.addConfig(
|
|
814
|
+
[
|
|
815
|
+
"jest/extended",
|
|
827
816
|
{
|
|
828
|
-
|
|
817
|
+
includeDefaultFilesAndIgnores: true,
|
|
818
|
+
filesFallback: defaultJestFiles
|
|
829
819
|
}
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
)
|
|
837
|
-
|
|
838
|
-
getSuggestUsingJestExtendedMatcherSeverity("toBeObject")
|
|
839
|
-
).addRule(
|
|
840
|
-
"jest-extended/prefer-to-be-true",
|
|
841
|
-
getSuggestUsingJestExtendedMatcherSeverity("toBeTrue")
|
|
842
|
-
).addRule(
|
|
843
|
-
"jest-extended/prefer-to-have-been-called-once",
|
|
844
|
-
getSuggestUsingJestExtendedMatcherSeverity("toHaveBeenCalledOnce")
|
|
845
|
-
);
|
|
846
|
-
}
|
|
820
|
+
],
|
|
821
|
+
{
|
|
822
|
+
...defaultJestEslintConfig
|
|
823
|
+
}
|
|
824
|
+
).addBulkRules(import_eslint_plugin_jest_extended.default.configs["flat/recommended"].rules).addRule("prefer-to-be-array", getSuggestUsingJestExtendedMatcherSeverity("toBeArray")).addRule("prefer-to-be-false", getSuggestUsingJestExtendedMatcherSeverity("toBeFalse")).addRule("prefer-to-be-object", getSuggestUsingJestExtendedMatcherSeverity("toBeObject")).addRule("prefer-to-be-true", getSuggestUsingJestExtendedMatcherSeverity("toBeTrue")).addRule(
|
|
825
|
+
"prefer-to-have-been-called-once",
|
|
826
|
+
getSuggestUsingJestExtendedMatcherSeverity("toHaveBeenCalledOnce")
|
|
827
|
+
);
|
|
847
828
|
return [
|
|
848
829
|
...builder.getAllConfigs(),
|
|
849
|
-
...tsBuilder.getAllConfigs(),
|
|
850
|
-
...jestExtendedBuilder.getAllConfigs()
|
|
830
|
+
...typescriptOnlyRules ? tsBuilder.getAllConfigs() : [],
|
|
831
|
+
...jestExtended ? jestExtendedBuilder.getAllConfigs() : []
|
|
851
832
|
];
|
|
852
833
|
};
|
|
853
834
|
|
|
@@ -887,7 +868,7 @@ var RULE_PREFER_DESTRUCTURING_OPTIONS = [
|
|
|
887
868
|
}
|
|
888
869
|
];
|
|
889
870
|
var jsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
890
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
871
|
+
const builder = new ConfigEntryBuilder("", options, internalOptions);
|
|
891
872
|
builder.addConfig(["js", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_js.default.configs.recommended.rules).addRule("array-callback-return", ERROR, [{ checkForEach: true }]).addRule("no-await-in-loop", WARNING).addRule("no-constructor-return", WARNING).addRule("no-duplicate-imports", ERROR).addRule("no-inner-declarations", ERROR).addRule("no-promise-executor-return", ERROR).addRule("no-self-compare", ERROR).addRule("no-template-curly-in-string", ERROR).addRule("no-unmodified-loop-condition", ERROR).addRule("no-unreachable-loop", ERROR).addRule("no-use-before-define", ERROR, RULE_NO_USE_BEFORE_DEFINE_OPTIONS).addRule("no-useless-assignment", ERROR).addRule("require-atomic-updates", ERROR, [{ allowProperties: true }]).addRule("accessor-pairs", ERROR).addRule("block-scoped-var", ERROR).addRule("camelcase", ERROR, RULE_CAMELCASE_OPTIONS).addRule("class-methods-use-this", ERROR).addRule("consistent-return", ERROR).addRule("consistent-this", ERROR, ["that"]).addRule("curly", ERROR, [
|
|
892
873
|
"all"
|
|
893
874
|
/* default */
|
|
@@ -925,38 +906,37 @@ var jsdocEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
925
906
|
settings: pluginSettings,
|
|
926
907
|
typescript: typescriptOnlyRules = internalOptions.isTypescriptEnabled
|
|
927
908
|
} = options;
|
|
928
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
909
|
+
const builder = new ConfigEntryBuilder("jsdoc", options, internalOptions);
|
|
929
910
|
builder.addConfig(["jsdoc", { includeDefaultFilesAndIgnores: true }], {
|
|
930
911
|
...pluginSettings && {
|
|
931
912
|
settings: {
|
|
932
913
|
jsdoc: pluginSettings
|
|
933
914
|
}
|
|
934
915
|
}
|
|
935
|
-
}).addBulkRules(import_eslint_plugin_jsdoc.default.configs["flat/recommended-error"].rules).addRule("
|
|
916
|
+
}).addBulkRules(import_eslint_plugin_jsdoc.default.configs["flat/recommended-error"].rules).addRule("check-indentation", ERROR).addRule("check-line-alignment", ERROR).addRule("check-syntax", ERROR).addRule("check-template-names", ERROR).addRule("lines-before-block", ERROR).addRule("no-bad-blocks", ERROR).addRule("no-blank-block-descriptions", ERROR).addRule("no-blank-blocks", ERROR).addRule("no-defaults", ERROR).addRule("no-multi-asterisks", ERROR, [{ allowWhitespace: true }]).addRule("require-asterisk-prefix", ERROR).addRule("require-jsdoc", OFF).addRule("require-param", ERROR, [{ ignoreWhenAllParamsMissing: true }]).addRule("require-param-description", WARNING).addRule("require-property-description", WARNING).addRule("require-returns", OFF).addRule("require-returns-description", WARNING).addRule("sort-tags", ERROR).addOverrides();
|
|
936
917
|
const tsBuilder = new ConfigEntryBuilder(
|
|
918
|
+
"jsdoc",
|
|
937
919
|
typeof typescriptOnlyRules === "object" ? typescriptOnlyRules : {},
|
|
938
920
|
internalOptions
|
|
939
921
|
);
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
"jsdoc/ts",
|
|
945
|
-
{
|
|
946
|
-
includeDefaultFilesAndIgnores: true,
|
|
947
|
-
filesFallback: [GLOB_TS, GLOB_TSX]
|
|
948
|
-
}
|
|
949
|
-
],
|
|
922
|
+
const pluginSettingsForTs = (typeof typescriptOnlyRules === "object" ? typescriptOnlyRules.settings : void 0) || pluginSettings;
|
|
923
|
+
builder.addConfig(
|
|
924
|
+
[
|
|
925
|
+
"jsdoc/ts",
|
|
950
926
|
{
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
927
|
+
includeDefaultFilesAndIgnores: true,
|
|
928
|
+
filesFallback: [GLOB_TS, GLOB_TSX]
|
|
929
|
+
}
|
|
930
|
+
],
|
|
931
|
+
{
|
|
932
|
+
...pluginSettingsForTs && {
|
|
933
|
+
settings: {
|
|
934
|
+
jsdoc: pluginSettingsForTs
|
|
955
935
|
}
|
|
956
936
|
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
return [...builder.getAllConfigs(), ...tsBuilder.getAllConfigs()];
|
|
937
|
+
}
|
|
938
|
+
).addRule("no-types", ERROR).addRule("no-undefined-types", OFF).addRule("require-param-type", OFF).addRule("require-property-type", OFF).addRule("require-returns-type", OFF).addOverrides();
|
|
939
|
+
return [...builder.getAllConfigs(), ...typescriptOnlyRules ? tsBuilder.getAllConfigs() : []];
|
|
960
940
|
};
|
|
961
941
|
|
|
962
942
|
// src/configs/json-schema-validator.ts
|
|
@@ -971,7 +951,7 @@ var import_eslint_plugin_jsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
|
971
951
|
var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
|
|
972
952
|
var JSONC_DEFAULT_FILES = [GLOB_JSON, GLOB_JSONC, GLOB_JSON5];
|
|
973
953
|
var jsoncEslintConfig = (options = {}, internalOptions = {}) => {
|
|
974
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
954
|
+
const builder = new ConfigEntryBuilder("jsonc", options, internalOptions);
|
|
975
955
|
builder.addConfig(
|
|
976
956
|
[
|
|
977
957
|
"jsonc/all",
|
|
@@ -991,15 +971,15 @@ var jsoncEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
991
971
|
(result2, config) => Object.assign(result2, config.rules),
|
|
992
972
|
{}
|
|
993
973
|
)
|
|
994
|
-
).addRule("
|
|
974
|
+
).addRule("no-bigint-literals", ERROR).addRule("no-binary-expression", ERROR).addRule("no-binary-numeric-literals", ERROR).addRule("no-escape-sequence-in-identifier", ERROR).addRule("no-number-props", ERROR).addRule("no-numeric-separators", ERROR).addRule("no-octal-numeric-literals", ERROR).addRule("no-parenthesized", ERROR).addRule("no-regexp-literals", ERROR).addRule("no-template-literals", ERROR).addRule("no-undefined-value", ERROR).addRule("no-unicode-codepoint-escapes", ERROR).addRule("vue-custom-block/no-parsing-error", ERROR).addRule("no-dupe-keys", ERROR).addRule("no-irregular-whitespace", ERROR).addRule("no-octal", ERROR).addRule("no-sparse-arrays", ERROR).addRule("no-useless-escape", ERROR).addRule("space-unary-ops", ERROR).addOverrides();
|
|
995
975
|
const result = builder.getAllConfigs();
|
|
996
976
|
if (options.jsonConfig) {
|
|
997
|
-
const jsonBuilder = new ConfigEntryBuilder(options.jsonConfig, internalOptions);
|
|
977
|
+
const jsonBuilder = new ConfigEntryBuilder("jsonc", options.jsonConfig, internalOptions);
|
|
998
978
|
jsonBuilder.addConfig(["jsonc/json", { includeDefaultFilesAndIgnores: true, filesFallback: [GLOB_JSON] }]).addOverrides();
|
|
999
979
|
result.push(...jsonBuilder.getAllConfigs());
|
|
1000
980
|
}
|
|
1001
981
|
if (options.jsoncConfig) {
|
|
1002
|
-
const jsoncBuilder = new ConfigEntryBuilder(options.jsoncConfig, internalOptions);
|
|
982
|
+
const jsoncBuilder = new ConfigEntryBuilder("jsonc", options.jsoncConfig, internalOptions);
|
|
1003
983
|
jsoncBuilder.addConfig([
|
|
1004
984
|
"jsonc/jsonc",
|
|
1005
985
|
{ includeDefaultFilesAndIgnores: true, filesFallback: [GLOB_JSONC] }
|
|
@@ -1007,7 +987,7 @@ var jsoncEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1007
987
|
result.push(...jsoncBuilder.getAllConfigs());
|
|
1008
988
|
}
|
|
1009
989
|
if (options.json5Config) {
|
|
1010
|
-
const json5Builder = new ConfigEntryBuilder(options.json5Config, internalOptions);
|
|
990
|
+
const json5Builder = new ConfigEntryBuilder("jsonc", options.json5Config, internalOptions);
|
|
1011
991
|
json5Builder.addConfig([
|
|
1012
992
|
"jsonc/json5",
|
|
1013
993
|
{ includeDefaultFilesAndIgnores: true, filesFallback: [GLOB_JSON5] }
|
|
@@ -1024,7 +1004,7 @@ var import_toml_eslint_parser = __toESM(require("toml-eslint-parser"), 1);
|
|
|
1024
1004
|
var TOML_DEFAULT_FILES = [GLOB_TOML];
|
|
1025
1005
|
var DEFAULT_FILES_TO_IGNORE = ["Cargo.lock"];
|
|
1026
1006
|
var tomlEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1027
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1007
|
+
const builder = new ConfigEntryBuilder("toml", options, internalOptions);
|
|
1028
1008
|
builder.addConfig(
|
|
1029
1009
|
[
|
|
1030
1010
|
"toml",
|
|
@@ -1050,11 +1030,11 @@ var tomlEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1050
1030
|
(result, config) => Object.assign(result, config.rules),
|
|
1051
1031
|
{}
|
|
1052
1032
|
)
|
|
1053
|
-
).addRule("
|
|
1033
|
+
).addRule("no-mixed-type-in-array", options.noMixedTypeInArray ? ERROR : OFF).addRule("no-non-decimal-integer", ERROR, [
|
|
1054
1034
|
{ allowHexadecimal: true, ...options.noNonDecimalIntegerExceptions }
|
|
1055
|
-
]).addRule("
|
|
1035
|
+
]).addRule("precision-of-fractional-seconds", ERROR, [
|
|
1056
1036
|
{ max: options.maxPrecisionOfFractionalSeconds ?? 3 }
|
|
1057
|
-
]).addRule("
|
|
1037
|
+
]).addRule("precision-of-integer", ERROR, [{ maxBit: options.maxIntegerPrecisionBits ?? 64 }]).addOverrides();
|
|
1058
1038
|
return builder.getAllConfigs();
|
|
1059
1039
|
};
|
|
1060
1040
|
|
|
@@ -1065,7 +1045,7 @@ var import_yaml_eslint_parser = __toESM(require("yaml-eslint-parser"), 1);
|
|
|
1065
1045
|
var YAML_DEFAULT_FILES = [GLOB_YAML];
|
|
1066
1046
|
var DEFAULT_FILES_TO_IGNORE2 = ["yarn.lock", "pnpm-lock.yaml"];
|
|
1067
1047
|
var yamlEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1068
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1048
|
+
const builder = new ConfigEntryBuilder("yml", options, internalOptions);
|
|
1069
1049
|
builder.addConfig(
|
|
1070
1050
|
[
|
|
1071
1051
|
"yaml",
|
|
@@ -1091,18 +1071,18 @@ var yamlEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1091
1071
|
(result, config) => Object.assign(result, config.rules),
|
|
1092
1072
|
{}
|
|
1093
1073
|
)
|
|
1094
|
-
).addRule("
|
|
1074
|
+
).addRule("block-mapping-colon-indicator-newline", ERROR).addRule("file-extension", ERROR, [{ extension: options.enforceExtension ?? "yml" }]).addRule("indent", ERROR).addRule("key-name-casing", options.casing == null ? OFF : ERROR, [
|
|
1095
1075
|
{ ...options.casing, ignores: ["<<", ...options.casing?.ignores || []] }
|
|
1096
|
-
]).addRule("
|
|
1076
|
+
]).addRule("quotes", options.quotes === false ? OFF : ERROR, [
|
|
1097
1077
|
{ prefer: options.quotes || "single" }
|
|
1098
|
-
]).addRule("
|
|
1078
|
+
]).addRule("no-multiple-empty-lines", ERROR).addRule("spaced-comment", ERROR).addOverrides();
|
|
1099
1079
|
return builder.getAllConfigs();
|
|
1100
1080
|
};
|
|
1101
1081
|
|
|
1102
1082
|
// src/configs/json-schema-validator.ts
|
|
1103
1083
|
var jsonSchemaValidatorEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1104
1084
|
const { settings: pluginSettings, options: noInvalidOptions } = options;
|
|
1105
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1085
|
+
const builder = new ConfigEntryBuilder("json-schema-validator", options, internalOptions);
|
|
1106
1086
|
builder.addConfig(
|
|
1107
1087
|
[
|
|
1108
1088
|
"json-schema-validator/setup/jsonc",
|
|
@@ -1148,11 +1128,7 @@ var jsonSchemaValidatorEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1148
1128
|
"json-schema-validator": pluginSettings
|
|
1149
1129
|
}
|
|
1150
1130
|
}
|
|
1151
|
-
}).addRule(
|
|
1152
|
-
"json-schema-validator/no-invalid",
|
|
1153
|
-
ERROR,
|
|
1154
|
-
noInvalidOptions == null ? [] : [noInvalidOptions]
|
|
1155
|
-
).addOverrides();
|
|
1131
|
+
}).addRule("no-invalid", ERROR, noInvalidOptions == null ? [] : [noInvalidOptions]).addOverrides();
|
|
1156
1132
|
return builder.getAllConfigs();
|
|
1157
1133
|
};
|
|
1158
1134
|
|
|
@@ -1163,7 +1139,7 @@ var import_eslint_merge_processors = require("eslint-merge-processors");
|
|
|
1163
1139
|
var DEFAULT_FILES = [GLOB_MARKDOWN];
|
|
1164
1140
|
var DEFAULT_FILES_FOR_CODE_BLOCKS = [GLOB_MARKDOWN_SUPPORTED_CODE_BLOCKS];
|
|
1165
1141
|
var markdownEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1166
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1142
|
+
const builder = new ConfigEntryBuilder("markdown", options, internalOptions);
|
|
1167
1143
|
const {
|
|
1168
1144
|
lintMarkdown = true,
|
|
1169
1145
|
language = "commonmark",
|
|
@@ -1197,7 +1173,7 @@ var markdownEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1197
1173
|
{}
|
|
1198
1174
|
)
|
|
1199
1175
|
).addRule(
|
|
1200
|
-
"
|
|
1176
|
+
"fenced-code-language",
|
|
1201
1177
|
allowedFencedCodeBlocksLanguages || codeBlocksAllowedLanguages === "any-lang-required" ? ERROR : OFF,
|
|
1202
1178
|
[
|
|
1203
1179
|
{
|
|
@@ -1206,7 +1182,7 @@ var markdownEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1206
1182
|
}
|
|
1207
1183
|
}
|
|
1208
1184
|
]
|
|
1209
|
-
).addRule("
|
|
1185
|
+
).addRule("no-html", allowHtmlTags === true ? OFF : ERROR, [
|
|
1210
1186
|
{
|
|
1211
1187
|
...Array.isArray(allowHtmlTags) && allowHtmlTags.length > 0 && {
|
|
1212
1188
|
allowed: [...new Set(allowHtmlTags)]
|
|
@@ -1288,26 +1264,20 @@ var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
|
|
1288
1264
|
var pluginRenamer2 = createPluginObjectRenamer("n", "node");
|
|
1289
1265
|
var nodeEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1290
1266
|
const { preferGlobal = {}, settings: pluginSettings } = options;
|
|
1291
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1267
|
+
const builder = new ConfigEntryBuilder("node", options, internalOptions);
|
|
1292
1268
|
builder.addConfig(["node", { includeDefaultFilesAndIgnores: true }], {
|
|
1293
1269
|
...pluginSettings && {
|
|
1294
1270
|
settings: {
|
|
1295
1271
|
node: pluginSettings
|
|
1296
1272
|
}
|
|
1297
1273
|
}
|
|
1298
|
-
}).addBulkRules(pluginRenamer2(import_eslint_plugin_n.default.configs["flat/recommended"].rules)).addRule("
|
|
1299
|
-
preferGlobal.buffer === false ? "never" : "always"
|
|
1300
|
-
]).addRule("node/prefer-global/console", ERROR, [
|
|
1301
|
-
preferGlobal.console === false ? "never" : "always"
|
|
1302
|
-
]).addRule("node/prefer-global/process", ERROR, [
|
|
1303
|
-
preferGlobal.process === false ? "never" : "always"
|
|
1304
|
-
]).addRule("node/prefer-global/text-decoder", ERROR, [
|
|
1274
|
+
}).addBulkRules(pluginRenamer2(import_eslint_plugin_n.default.configs["flat/recommended"].rules)).addRule("exports-style", ERROR, ["module.exports", { allowBatchAssign: false }]).addRule("no-extraneous-import", OFF).addRule("no-missing-import", OFF).addRule("no-new-require", ERROR).addRule("no-path-concat", ERROR).addRule("no-process-exit", OFF).addAnyRule("unicorn/no-process-exit", ERROR).addRule("no-unpublished-import", OFF).addRule("prefer-global/buffer", ERROR, [preferGlobal.buffer === false ? "never" : "always"]).addRule("prefer-global/console", ERROR, [preferGlobal.console === false ? "never" : "always"]).addRule("prefer-global/process", ERROR, [preferGlobal.process === false ? "never" : "always"]).addRule("prefer-global/text-decoder", ERROR, [
|
|
1305
1275
|
preferGlobal.textDecoder === false ? "never" : "always"
|
|
1306
|
-
]).addRule("
|
|
1276
|
+
]).addRule("prefer-global/text-encoder", ERROR, [
|
|
1307
1277
|
preferGlobal.textEncoder === false ? "never" : "always"
|
|
1308
|
-
]).addRule("
|
|
1278
|
+
]).addRule("prefer-global/url", ERROR, [preferGlobal.url === false ? "never" : "always"]).addRule("prefer-global/url-search-params", ERROR, [
|
|
1309
1279
|
preferGlobal.urlSearchParams === false ? "never" : "always"
|
|
1310
|
-
]).addRule("
|
|
1280
|
+
]).addRule("prefer-node-protocol", ERROR).addRule("prefer-promises/dns", OFF).addRule("prefer-promises/fs", OFF).addRule("process-exit-as-throw", ERROR).addOverrides();
|
|
1311
1281
|
return builder.getAllConfigs();
|
|
1312
1282
|
};
|
|
1313
1283
|
|
|
@@ -1325,7 +1295,7 @@ var DEFAULT_COLLECTIONS_TO_SORT = {
|
|
|
1325
1295
|
overrides: true
|
|
1326
1296
|
};
|
|
1327
1297
|
var packageJsonEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1328
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1298
|
+
const builder = new ConfigEntryBuilder("package-json", options, internalOptions);
|
|
1329
1299
|
builder.addConfig(
|
|
1330
1300
|
["package-json", { includeDefaultFilesAndIgnores: true, filesFallback: DEFAULT_FILES2 }],
|
|
1331
1301
|
{
|
|
@@ -1333,11 +1303,7 @@ var packageJsonEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1333
1303
|
parser: import_jsonc_eslint_parser3.default
|
|
1334
1304
|
}
|
|
1335
1305
|
}
|
|
1336
|
-
).addBulkRules(import_recommended.default.rules).addRule("
|
|
1337
|
-
{ order: options.order ?? "sort-package-json" }
|
|
1338
|
-
]).addRule("package-json/repository-shorthand", ERROR, [
|
|
1339
|
-
{ form: options.repositoryShorthand ?? "object" }
|
|
1340
|
-
]).addRule("package-json/sort-collections", ERROR, [
|
|
1306
|
+
).addBulkRules(import_recommended.default.rules).addRule("no-redundant-files", ERROR).addRule("order-properties", ERROR, [{ order: options.order ?? "sort-package-json" }]).addRule("repository-shorthand", ERROR, [{ form: options.repositoryShorthand ?? "object" }]).addRule("sort-collections", ERROR, [
|
|
1341
1307
|
Object.entries({
|
|
1342
1308
|
...DEFAULT_COLLECTIONS_TO_SORT,
|
|
1343
1309
|
...options.collectionsToSort
|
|
@@ -1349,16 +1315,16 @@ var packageJsonEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1349
1315
|
// src/configs/perfectionist.ts
|
|
1350
1316
|
init_cjs_shims();
|
|
1351
1317
|
var perfectionistEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1352
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1353
|
-
builder.addConfig(["perfectionist", { includeDefaultFilesAndIgnores: true }]).addRule("
|
|
1318
|
+
const builder = new ConfigEntryBuilder("perfectionist", options, internalOptions);
|
|
1319
|
+
builder.addConfig(["perfectionist", { includeDefaultFilesAndIgnores: true }]).addRule("sort-array-includes", OFF).addRule("sort-classes", OFF).addRule("sort-decorators", OFF).addRule("sort-enums", OFF).addRule("sort-exports", OFF).addRule("sort-heritage-clauses", OFF).addRule("sort-imports", OFF).addRule("sort-interfaces", OFF).addRule("sort-intersection-types", OFF).addRule("sort-jsx-props", OFF).addRule("sort-maps", OFF).addRule("sort-modules", OFF).addRule("sort-named-exports", OFF).addRule("sort-named-imports", OFF).addRule("sort-object-types", OFF).addRule("sort-objects", OFF).addRule("sort-sets", OFF).addRule("sort-switch-case", OFF).addRule("sort-union-types", OFF).addRule("sort-variable-declarations", OFF).addOverrides();
|
|
1354
1320
|
return builder.getAllConfigs();
|
|
1355
1321
|
};
|
|
1356
1322
|
|
|
1357
1323
|
// src/configs/prefer-arrow-functions.ts
|
|
1358
1324
|
init_cjs_shims();
|
|
1359
1325
|
var preferArrowFunctionsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1360
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1361
|
-
builder.addConfig(["prefer-arrow-functions", { includeDefaultFilesAndIgnores: true }]).addRule("prefer-arrow-functions
|
|
1326
|
+
const builder = new ConfigEntryBuilder("prefer-arrow-functions", options, internalOptions);
|
|
1327
|
+
builder.addConfig(["prefer-arrow-functions", { includeDefaultFilesAndIgnores: true }]).addRule("prefer-arrow-functions", WARNING).addOverrides();
|
|
1362
1328
|
return builder.getAllConfigs();
|
|
1363
1329
|
};
|
|
1364
1330
|
|
|
@@ -1366,13 +1332,13 @@ var preferArrowFunctionsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1366
1332
|
init_cjs_shims();
|
|
1367
1333
|
var import_eslint_plugin_promise = __toESM(require("eslint-plugin-promise"), 1);
|
|
1368
1334
|
var promiseEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1369
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1370
|
-
builder.addConfig(["promise", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_promise.default.configs.recommended.rules).addRule("
|
|
1335
|
+
const builder = new ConfigEntryBuilder("promise", options, internalOptions);
|
|
1336
|
+
builder.addConfig(["promise", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_promise.default.configs.recommended.rules).addRule("always-return", ERROR, [{ ignoreLastCallback: true }]).addRule("catch-or-return", ERROR, [
|
|
1371
1337
|
{
|
|
1372
1338
|
allowThenStrict: true,
|
|
1373
1339
|
allowFinally: true
|
|
1374
1340
|
}
|
|
1375
|
-
]).addRule("
|
|
1341
|
+
]).addRule("no-callback-in-promise", ERROR).addRule("no-multiple-resolved", WARNING).addRule("no-nesting", WARNING).addRule("no-promise-in-callback", WARNING).addRule("no-return-in-finally", ERROR).addRule("no-return-wrap", ERROR, [{ allowReject: true }]).addRule("prefer-catch", ERROR).addRule("spec-only", ERROR).addRule("valid-params", ERROR).addOverrides();
|
|
1376
1342
|
return builder.getAllConfigs();
|
|
1377
1343
|
};
|
|
1378
1344
|
|
|
@@ -1381,14 +1347,14 @@ init_cjs_shims();
|
|
|
1381
1347
|
var eslintPluginQwik = __toESM(require("eslint-plugin-qwik"), 1);
|
|
1382
1348
|
var qwikEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1383
1349
|
const { routesDir } = options;
|
|
1384
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1350
|
+
const builder = new ConfigEntryBuilder("qwik", options, internalOptions);
|
|
1385
1351
|
builder.addConfig([
|
|
1386
1352
|
"qwik",
|
|
1387
1353
|
{
|
|
1388
1354
|
includeDefaultFilesAndIgnores: true,
|
|
1389
1355
|
filesFallback: [GLOB_JS_TS_X]
|
|
1390
1356
|
}
|
|
1391
|
-
]).addBulkRules(eslintPluginQwik.configs.strict.rules).addRule("
|
|
1357
|
+
]).addBulkRules(eslintPluginQwik.configs.strict.rules).addRule("loader-location", ERROR, [{ routesDir }]).addRule("jsx-key", ERROR, [
|
|
1392
1358
|
{
|
|
1393
1359
|
checkFragmentShorthand: true,
|
|
1394
1360
|
// Default: false
|
|
@@ -1396,7 +1362,7 @@ var qwikEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1396
1362
|
warnOnDuplicates: true
|
|
1397
1363
|
// Default: false
|
|
1398
1364
|
}
|
|
1399
|
-
]).addRule("
|
|
1365
|
+
]).addRule("jsx-img", OFF).addOverrides();
|
|
1400
1366
|
return builder.getAllConfigs();
|
|
1401
1367
|
};
|
|
1402
1368
|
|
|
@@ -1404,8 +1370,8 @@ var qwikEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1404
1370
|
init_cjs_shims();
|
|
1405
1371
|
var eslintPluginRegexp = __toESM(require("eslint-plugin-regexp"), 1);
|
|
1406
1372
|
var regexpEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1407
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1408
|
-
builder.addConfig(["regexp", { includeDefaultFilesAndIgnores: true }]).addBulkRules(eslintPluginRegexp.configs["flat/recommended"].rules).addAnyRule("no-control-regex", OFF).addRule("
|
|
1373
|
+
const builder = new ConfigEntryBuilder("regexp", options, internalOptions);
|
|
1374
|
+
builder.addConfig(["regexp", { includeDefaultFilesAndIgnores: true }]).addBulkRules(eslintPluginRegexp.configs["flat/recommended"].rules).addAnyRule("no-control-regex", OFF).addRule("no-control-character", ERROR).addRule("no-empty-alternative", ERROR).addRule("no-empty-character-class", ERROR, [], { overrideBaseRule: true }).addRule("no-lazy-ends", ERROR).addRule("no-potentially-useless-backreference", WARNING).addRule("no-useless-backreference", ERROR, [], { overrideBaseRule: true }).addRule("confusing-quantifier", ERROR).addRule("no-obscure-range", WARNING).addRule("no-octal", ERROR).addRule("no-standalone-backslash", ERROR).addRule("no-useless-flag", ERROR).addRule("optimal-lookaround-quantifier", ERROR).addRule("prefer-quantifier", ERROR).addAnyRule("unicorn/prefer-regexp-test", OFF).addRule("prefer-regexp-test", ERROR).addRule("require-unicode-regexp", OFF, [], { overrideBaseRule: true }).addRule("hexadecimal-escape", ERROR, ["never"]).addRule("prefer-lookaround", ERROR, [{ lookbehind: false }]).addRule("prefer-named-capture-group", OFF, [], { overrideBaseRule: true }).addRule("sort-character-class-elements", ERROR).addRule("unicode-property", ERROR).addOverrides();
|
|
1409
1375
|
return builder.getAllConfigs();
|
|
1410
1376
|
};
|
|
1411
1377
|
|
|
@@ -1413,8 +1379,8 @@ var regexpEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1413
1379
|
init_cjs_shims();
|
|
1414
1380
|
var import_eslint_plugin_security = __toESM(require("eslint-plugin-security"), 1);
|
|
1415
1381
|
var securityEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1416
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1417
|
-
builder.addConfig(["security", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_security.default.configs.recommended.rules).addRule("
|
|
1382
|
+
const builder = new ConfigEntryBuilder("security", options, internalOptions);
|
|
1383
|
+
builder.addConfig(["security", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_security.default.configs.recommended.rules).addRule("detect-bidi-characters", ERROR).addRule("detect-buffer-noassert", ERROR).addRule("detect-child-process", WARNING).addRule("detect-disable-mustache-escape", ERROR).addRule("detect-eval-with-expression", ERROR).addRule("detect-new-buffer", ERROR).addRule("detect-no-csrf-before-method-override", WARNING).addRule("detect-non-literal-fs-filename", OFF).addRule("detect-non-literal-regexp", OFF).addRule("detect-non-literal-require", OFF).addRule("detect-object-injection", OFF).addRule("detect-possible-timing-attacks", OFF).addRule("detect-pseudoRandomBytes", WARNING).addRule("detect-unsafe-regex", WARNING).addOverrides();
|
|
1418
1384
|
return builder.getAllConfigs();
|
|
1419
1385
|
};
|
|
1420
1386
|
|
|
@@ -1425,8 +1391,8 @@ var sonarEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1425
1391
|
const { enableAwsRules = true, testsRules = true } = options;
|
|
1426
1392
|
const awsRulesSeverity = enableAwsRules ? ERROR : OFF;
|
|
1427
1393
|
const testsRulesSeverity = testsRules ? ERROR : OFF;
|
|
1428
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1429
|
-
builder.addConfig(["sonar", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_sonarjs.default.configs.recommended.rules).addRule("
|
|
1394
|
+
const builder = new ConfigEntryBuilder("sonarjs", options, internalOptions);
|
|
1395
|
+
builder.addConfig(["sonar", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_sonarjs.default.configs.recommended.rules).addRule("argument-type", OFF).addRule("array-callback-without-return", OFF).addRule("assertions-in-tests", testsRulesSeverity).addRule("aws-apigateway-public-api", awsRulesSeverity).addRule("aws-ec2-rds-dms-public", awsRulesSeverity).addRule("aws-ec2-unencrypted-ebs-volume", awsRulesSeverity).addRule("aws-efs-unencrypted", awsRulesSeverity).addRule("aws-iam-all-privileges", awsRulesSeverity).addRule("aws-iam-all-resources-accessible", OFF).addRule("aws-iam-privilege-escalation", awsRulesSeverity).addRule("aws-iam-public-access", awsRulesSeverity).addRule("aws-opensearchservice-domain", awsRulesSeverity).addRule("aws-rds-unencrypted-databases", awsRulesSeverity).addRule("aws-restricted-ip-admin-access", awsRulesSeverity).addRule("aws-s3-bucket-granted-access", awsRulesSeverity).addRule("aws-s3-bucket-insecure-http", awsRulesSeverity).addRule("aws-s3-bucket-public-access", awsRulesSeverity).addRule("aws-s3-bucket-server-encryption", OFF).addRule("aws-s3-bucket-versioning", awsRulesSeverity).addRule("aws-sagemaker-unencrypted-notebook", awsRulesSeverity).addRule("aws-sns-unencrypted-topics", awsRulesSeverity).addRule("aws-sqs-unencrypted-queue", awsRulesSeverity).addRule("block-scoped-var", OFF).addRule("call-argument-line", OFF).addRule("chai-determinate-assertion", testsRulesSeverity).addRule("class-name", OFF).addRule("code-eval", OFF).addRule("cognitive-complexity", OFF).addRule("concise-regex", OFF).addRule("conditional-indentation", OFF).addRule("constructor-for-side-effects", OFF).addRule("deprecation", OFF).addRule("different-types-comparison", OFF).addRule("disabled-timeout", testsRulesSeverity).addRule("duplicates-in-character-class", OFF).addRule("empty-string-repetition", OFF).addRule("fixme-tag", OFF).addRule("function-inside-loop", OFF).addRule("function-return-type", OFF).addRule("generator-without-yield", OFF).addRule("in-operator-type-error", OFF).addRule("inverted-assertion-arguments", testsRulesSeverity).addRule("label-position", OFF).addRule("max-switch-cases", OFF).addRule("misplaced-loop-counter", WARNING).addRule("new-operator-misuse", OFF).addRule("no-alphabetical-sort", OFF).addRule("no-array-delete", OFF).addRule("no-associative-arrays", OFF).addRule("no-async-constructor", OFF).addRule("no-code-after-done", testsRulesSeverity).addRule("no-commented-code", OFF).addRule("no-control-regex", OFF).addRule("no-dead-store", OFF).addRule("no-duplicate-in-composite", OFF).addRule("no-empty-alternatives", OFF).addRule("no-empty-character-class", OFF).addRule("no-empty-group", OFF).addRule("no-empty-test-file", OFF).addRule("no-exclusive-tests", OFF).addRule("no-fallthrough", OFF).addRule("no-for-in-iterable", ERROR).addRule("no-hardcoded-ip", WARNING).addRule("no-identical-conditions", OFF).addRule("no-implicit-dependencies", OFF).addRule("no-incomplete-assertions", testsRulesSeverity).addRule("no-invalid-await", OFF).addRule("no-invalid-regexp", OFF).addRule("no-labels", OFF).addRule("no-misleading-character-class", OFF).addRule("no-nested-assignment", OFF).addRule("no-nested-conditional", OFF).addRule("no-nested-functions", OFF).addRule("no-nested-template-literals", OFF).addRule("no-one-iteration-loop", OFF).addRule("no-primitive-wrappers", OFF).addRule("no-regex-spaces", OFF).addRule("no-same-argument-assert", testsRulesSeverity).addRule("no-same-line-conditional", OFF).addRule("no-selector-parameter", OFF).addRule("no-skipped-tests", OFF).addRule("no-try-promise", OFF).addRule("no-unenclosed-multiline-block", OFF).addRule("no-unthrown-error", OFF).addRule("no-unused-vars", OFF).addRule("no-useless-catch", OFF).addRule("no-useless-intersection", OFF).addRule("no-vue-bypass-sanitization", OFF).addRule("null-dereference", OFF).addRule("prefer-default-last", OFF).addRule("prefer-object-literal", ERROR).addRule("prefer-read-only-props", OFF).addRule("prefer-regexp-exec", OFF).addRule("prefer-single-boolean-return", WARNING).addRule("production-debug", ERROR).addRule("pseudo-random", OFF).addRule("redundant-type-aliases", OFF).addRule("regex-complexity", WARNING, [{ threshold: 40 }]).addRule("single-char-in-character-classes", OFF).addRule("single-character-alternation", OFF).addRule("slow-regex", OFF).addRule("stable-tests", testsRulesSeverity).addRule("strings-comparison", WARNING).addRule("super-invocation", OFF).addRule("table-header", WARNING).addRule("table-header-reference", WARNING).addRule("todo-tag", OFF).addRule("unused-import", OFF).addRule("unverified-hostname", ERROR).addRule("updated-const-var", OFF).addRule("updated-loop-counter", WARNING).addRule("use-type-alias", WARNING).addRule("void-use", OFF).addOverrides();
|
|
1430
1396
|
return builder.getAllConfigs();
|
|
1431
1397
|
};
|
|
1432
1398
|
|
|
@@ -1441,7 +1407,7 @@ var DEFAULT_PLUGIN_SETTINGS = {
|
|
|
1441
1407
|
};
|
|
1442
1408
|
var tailwindEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1443
1409
|
const { settings } = options;
|
|
1444
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1410
|
+
const builder = new ConfigEntryBuilder("tailwindcss", options, internalOptions);
|
|
1445
1411
|
builder.addConfig(["tailwind", { includeDefaultFilesAndIgnores: true }], {
|
|
1446
1412
|
...settings && {
|
|
1447
1413
|
settings: {
|
|
@@ -1462,7 +1428,7 @@ var tailwindEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1462
1428
|
}
|
|
1463
1429
|
}
|
|
1464
1430
|
}
|
|
1465
|
-
}).addBulkRules(import_eslint_plugin_tailwindcss.default.configs.recommended.rules).addRule("
|
|
1431
|
+
}).addBulkRules(import_eslint_plugin_tailwindcss.default.configs.recommended.rules).addRule("classnames-order", WARNING).addRule("enforces-negative-arbitrary-values", WARNING).addRule("enforces-shorthand", WARNING).addRule("migration-from-tailwind-2", WARNING).addRule("no-custom-classname", OFF).addRule("no-unnecessary-arbitrary-value", WARNING).addOverrides();
|
|
1466
1432
|
return builder.getAllConfigs();
|
|
1467
1433
|
};
|
|
1468
1434
|
|
|
@@ -1519,7 +1485,7 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1519
1485
|
}
|
|
1520
1486
|
}
|
|
1521
1487
|
});
|
|
1522
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1488
|
+
const builder = new ConfigEntryBuilder("@typescript-eslint", options, internalOptions);
|
|
1523
1489
|
const noUnsafeRulesSeverity = options.disableNoUnsafeRules ? OFF : WARNING;
|
|
1524
1490
|
builder.addConfig("ts/rules-regular", {
|
|
1525
1491
|
...generateBaseOptions(false),
|
|
@@ -1535,32 +1501,23 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1535
1501
|
(result, config) => Object.assign(result, config.rules),
|
|
1536
1502
|
{}
|
|
1537
1503
|
)
|
|
1538
|
-
).addRule("
|
|
1539
|
-
{ allowInterfaces: "with-single-extends" }
|
|
1540
|
-
]).addRule("@typescript-eslint/no-explicit-any", WARNING, [{ ignoreRestArgs: true }]).addRule("@typescript-eslint/no-non-null-assertion", WARNING).addRule("@typescript-eslint/no-unused-vars", ERROR, [{ ignoreRestSiblings: true }], {
|
|
1504
|
+
).addRule("no-array-constructor", ERROR, [], { overrideBaseRule: true }).addRule("no-dynamic-delete", WARNING).addRule("no-empty-object-type", ERROR, [{ allowInterfaces: "with-single-extends" }]).addRule("no-explicit-any", WARNING, [{ ignoreRestArgs: true }]).addRule("no-non-null-assertion", WARNING).addRule("no-unused-vars", ERROR, [{ ignoreRestSiblings: true }], {
|
|
1541
1505
|
overrideBaseRule: true
|
|
1542
|
-
}).addRule("
|
|
1543
|
-
|
|
1544
|
-
]).addRule("@typescript-eslint/no-empty-function", ERROR, [], { overrideBaseRule: true }).addRule(
|
|
1545
|
-
"@typescript-eslint/class-methods-use-this",
|
|
1506
|
+
}).addRule("no-useless-constructor", ERROR, [], { overrideBaseRule: true }).addRule("prefer-literal-enum-member", ERROR, [{ allowBitwiseExpressions: true }]).addRule("unified-signatures", ERROR, [{ ignoreOverloadsWithDifferentJSDoc: true }]).addRule("no-empty-function", ERROR, [], { overrideBaseRule: true }).addRule(
|
|
1507
|
+
"class-methods-use-this",
|
|
1546
1508
|
ERROR,
|
|
1547
1509
|
[{ ignoreOverrideMethods: true, ignoreClassesThatImplementAnInterface: true }],
|
|
1548
1510
|
{ overrideBaseRule: true }
|
|
1549
|
-
).addRule("
|
|
1511
|
+
).addRule("consistent-type-imports", ERROR, [
|
|
1550
1512
|
{
|
|
1551
1513
|
...tsVersion && tsVersion >= 4.5 && { fixStyle: "inline-type-imports" },
|
|
1552
1514
|
disallowTypeAnnotations: false
|
|
1553
1515
|
}
|
|
1554
|
-
]).addRule("
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
RULE_NO_UNUSED_EXPRESSIONS_OPTIONS,
|
|
1558
|
-
{
|
|
1559
|
-
overrideBaseRule: true
|
|
1560
|
-
}
|
|
1561
|
-
).addRule("@typescript-eslint/no-use-before-define", ERROR, RULE_NO_USE_BEFORE_DEFINE_OPTIONS, {
|
|
1516
|
+
]).addRule("default-param-last", ERROR, [], { overrideBaseRule: true }).addRule("explicit-module-boundary-types", OFF).addRule("method-signature-style", ERROR).addRule("no-import-type-side-effects", ERROR).addRule("no-loop-func", ERROR, [], { overrideBaseRule: true }).addAnyRule("no-redeclare", OFF).addRule("no-require-imports", OFF).addRule("no-shadow", ERROR, [], { overrideBaseRule: true }).addRule("no-unnecessary-parameter-property-assignment", ERROR).addRule("no-unused-expressions", ERROR, RULE_NO_UNUSED_EXPRESSIONS_OPTIONS, {
|
|
1517
|
+
overrideBaseRule: true
|
|
1518
|
+
}).addRule("no-use-before-define", ERROR, RULE_NO_USE_BEFORE_DEFINE_OPTIONS, {
|
|
1562
1519
|
overrideBaseRule: true
|
|
1563
|
-
}).addRule("
|
|
1520
|
+
}).addRule("no-useless-empty-export", ERROR).addAnyRule("no-useless-constructor", OFF).addAnyRule("dot-notation", OFF).addOverrides();
|
|
1564
1521
|
if (filesTypeAware.length > 0) {
|
|
1565
1522
|
builder.addConfig("ts/rules-type-aware", {
|
|
1566
1523
|
...generateBaseOptions(true),
|
|
@@ -1576,18 +1533,18 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1576
1533
|
(result, config) => Object.assign(result, config.rules),
|
|
1577
1534
|
{}
|
|
1578
1535
|
)
|
|
1579
|
-
).addRule("
|
|
1536
|
+
).addRule("no-confusing-void-expression", ERROR, [
|
|
1580
1537
|
{
|
|
1581
1538
|
ignoreArrowShorthand: true
|
|
1582
1539
|
}
|
|
1583
|
-
]).addRule("
|
|
1540
|
+
]).addRule("no-deprecated", WARNING).addRule("no-floating-promises", ERROR, [
|
|
1584
1541
|
{
|
|
1585
1542
|
checkThenables: true,
|
|
1586
1543
|
ignoreVoid: true
|
|
1587
1544
|
// Default
|
|
1588
1545
|
}
|
|
1589
|
-
]).addRule("
|
|
1590
|
-
"
|
|
1546
|
+
]).addRule("no-implied-eval", ERROR, [], { overrideBaseRule: true }).addRule("no-misused-spread", ERROR).addRule(
|
|
1547
|
+
"no-unnecessary-condition",
|
|
1591
1548
|
ERROR,
|
|
1592
1549
|
[
|
|
1593
1550
|
{
|
|
@@ -1597,39 +1554,25 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1597
1554
|
}
|
|
1598
1555
|
],
|
|
1599
1556
|
{ disableAutofix: true }
|
|
1600
|
-
).addRule("
|
|
1557
|
+
).addRule("no-unnecessary-type-arguments", ERROR, [], {
|
|
1601
1558
|
disableAutofix: true
|
|
1602
|
-
}).addRule("
|
|
1559
|
+
}).addRule("no-unnecessary-type-assertion", ERROR, [], {
|
|
1603
1560
|
disableAutofix: true
|
|
1604
1561
|
// Reason: https://github.com/typescript-eslint/typescript-eslint/issues/8721
|
|
1605
|
-
}).addRule("
|
|
1562
|
+
}).addRule("no-unsafe-argument", noUnsafeRulesSeverity).addRule("no-unsafe-assignment", noUnsafeRulesSeverity).addRule("no-unsafe-call", noUnsafeRulesSeverity).addRule("no-unsafe-enum-comparison", noUnsafeRulesSeverity).addRule("no-unsafe-member-access", noUnsafeRulesSeverity).addRule("no-unsafe-return", noUnsafeRulesSeverity).addAnyRule("no-throw-literal", OFF).addRule("prefer-promise-reject-errors", ERROR, [], {
|
|
1606
1563
|
overrideBaseRule: true
|
|
1607
|
-
}).addRule("
|
|
1608
|
-
|
|
1609
|
-
]).addRule(
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
[{ allowIndexSignaturePropertyAccess: true }],
|
|
1613
|
-
{ overrideBaseRule: true }
|
|
1614
|
-
).addAnyRule("unicorn/prefer-includes", OFF).addRule("@typescript-eslint/prefer-nullish-coalescing", OFF).addRule("@typescript-eslint/prefer-regexp-exec", OFF).addRule("@typescript-eslint/prefer-string-starts-ends-with", ERROR, [
|
|
1615
|
-
{ allowSingleElementEquality: "always" }
|
|
1616
|
-
]).addRule("@typescript-eslint/consistent-type-exports", ERROR, [
|
|
1617
|
-
{ fixMixedExportsWithInlineTypeSpecifier: true }
|
|
1618
|
-
]).addRule(
|
|
1619
|
-
"@typescript-eslint/prefer-destructuring",
|
|
1620
|
-
ERROR,
|
|
1621
|
-
RULE_PREFER_DESTRUCTURING_OPTIONS,
|
|
1622
|
-
{
|
|
1623
|
-
overrideBaseRule: true
|
|
1624
|
-
}
|
|
1625
|
-
).addAnyRule("unicorn/prefer-array-find", OFF).addRule("@typescript-eslint/prefer-readonly", ERROR).addAnyRule("no-return-await", OFF).addRule("@typescript-eslint/return-await", ERROR, ["always"]).addRule("@typescript-eslint/switch-exhaustiveness-check", ERROR).addBulkRules(options.overridesTypeAware);
|
|
1564
|
+
}).addRule("require-await", ERROR, [], { overrideBaseRule: true }).addRule("restrict-template-expressions", ERROR, [{ allowAny: false, allowRegExp: false }]).addRule("dot-notation", ERROR, [{ allowIndexSignaturePropertyAccess: true }], {
|
|
1565
|
+
overrideBaseRule: true
|
|
1566
|
+
}).addAnyRule("unicorn/prefer-includes", OFF).addRule("prefer-nullish-coalescing", OFF).addRule("prefer-regexp-exec", OFF).addRule("prefer-string-starts-ends-with", ERROR, [{ allowSingleElementEquality: "always" }]).addRule("consistent-type-exports", ERROR, [{ fixMixedExportsWithInlineTypeSpecifier: true }]).addRule("prefer-destructuring", ERROR, RULE_PREFER_DESTRUCTURING_OPTIONS, {
|
|
1567
|
+
overrideBaseRule: true
|
|
1568
|
+
}).addAnyRule("unicorn/prefer-array-find", OFF).addRule("prefer-readonly", ERROR).addAnyRule("no-return-await", OFF).addRule("return-await", ERROR, ["always"]).addRule("switch-exhaustiveness-check", ERROR).addBulkRules(options.overridesTypeAware);
|
|
1626
1569
|
}
|
|
1627
1570
|
builder.addConfig("ts/disable-handled-by-ts-compiler-rules", {
|
|
1628
1571
|
files: [...TS_FILES_DEFAULT, ...filesNONTypeAware, ...filesTypeAware]
|
|
1629
1572
|
}).addAnyRule("constructor-super", OFF).addAnyRule("getter-return", OFF).addAnyRule("no-const-assign", OFF).addAnyRule("no-dupe-args", OFF).addAnyRule("no-dupe-class-members", OFF).addAnyRule("no-dupe-keys", OFF).addAnyRule("no-func-assign", OFF).addAnyRule("no-new-native-nonconstructor", OFF).addAnyRule("no-obj-calls", OFF).addAnyRule("no-setter-return", OFF).addAnyRule("no-this-before-super", OFF).addAnyRule("no-undef", OFF).addAnyRule("no-unsafe-negation", OFF).addAnyRule("no-duplicate-imports", OFF);
|
|
1630
1573
|
builder.addConfig("ts/dts", {
|
|
1631
1574
|
files: ["**/*.d.?([cm])ts"]
|
|
1632
|
-
}).addRule("
|
|
1575
|
+
}).addRule("consistent-indexed-object-style", OFF).addRule("method-signature-style", OFF).addRule("no-empty-object-type", OFF).addRule("no-explicit-any", OFF).addRule("no-shadow", OFF).addRule("no-unnecessary-type-parameters", OFF).addRule("no-unused-vars", OFF).addRule("no-use-before-define", OFF).addAnyRule("import/newline-after-import", OFF).addAnyRule("import/no-default-export", OFF).addAnyRule("vars-on-top", OFF).addAnyRule("no-var", OFF).addAnyRule("sonarjs/no-redundant-optional", OFF);
|
|
1633
1576
|
if (options.noTypeAssertion) {
|
|
1634
1577
|
builder.addConfig("ts/no-type-assertion").addAnyRule(
|
|
1635
1578
|
"no-type-assertion/no-type-assertion",
|
|
@@ -1643,12 +1586,10 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1643
1586
|
init_cjs_shims();
|
|
1644
1587
|
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
1645
1588
|
var unicornEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1646
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1647
|
-
builder.addConfig(["unicorn", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_unicorn.default.configs["flat/recommended"].rules).addRule("
|
|
1589
|
+
const builder = new ConfigEntryBuilder("unicorn", options, internalOptions);
|
|
1590
|
+
builder.addConfig(["unicorn", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_unicorn.default.configs["flat/recommended"].rules).addRule("catch-error-name", OFF).addRule("catch-error-name", WARNING, [], { disableAutofix: true }).addRule("consistent-assert", WARNING).addRule("consistent-existence-index-check", ERROR, [], { disableAutofix: true }).addRule("custom-error-definition", ERROR).addRule("explicit-length-check", ERROR, [], { disableAutofix: true }).addRule("filename-case", OFF).addRule("no-anonymous-default-export", OFF).addRule("no-array-callback-reference", OFF).addRule("no-array-for-each", OFF).addRule("no-array-reduce", OFF).addRule("no-await-expression-member", OFF).addRule("no-for-loop", OFF).addRule("no-magic-array-flat-depth", OFF).addRule("no-negated-condition", ERROR, [], { overrideBaseRule: true }).addRule("no-nested-ternary", OFF).addRule("no-null", OFF).addRule("no-process-exit", OFF).addRule("no-unreadable-array-destructuring", OFF).addRule("no-useless-undefined", ERROR, [{ checkArguments: false }], {
|
|
1648
1591
|
disableAutofix: true
|
|
1649
|
-
}).addRule("
|
|
1650
|
-
{ minimumCases: 4, emptyDefaultCase: "do-nothing-comment" }
|
|
1651
|
-
]).addRule("unicorn/prevent-abbreviations", OFF).addRule("unicorn/relative-url-style", ERROR, ["always"]).addOverrides();
|
|
1592
|
+
}).addRule("numeric-separators-style", ERROR, [{ onlyIfContainsSeparator: true }]).addRule("prefer-dom-node-text-content", OFF).addRule("prefer-export-from", ERROR, [{ ignoreUsedVariables: true }]).addRule("prefer-global-this", OFF).addRule("prefer-module", OFF).addRule("prefer-node-protocol", OFF).addRule("prefer-number-properties", ERROR, [{ checkInfinity: true }]).addRule("prefer-query-selector", OFF).addRule("prefer-spread", ERROR, [], { disableAutofix: true }).addRule("prefer-switch", ERROR, [{ minimumCases: 4, emptyDefaultCase: "do-nothing-comment" }]).addRule("prevent-abbreviations", OFF).addRule("relative-url-style", ERROR, ["always"]).addOverrides();
|
|
1652
1593
|
return builder.getAllConfigs();
|
|
1653
1594
|
};
|
|
1654
1595
|
|
|
@@ -1679,7 +1620,7 @@ var vitestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1679
1620
|
const defaultVitestFiles = generateDefaultTestFiles(GLOB_JS_TS_X_EXTENSION);
|
|
1680
1621
|
const hasRestrictedMethods = Object.keys(restrictedMethods || {}).length > 0;
|
|
1681
1622
|
const hasRestrictedMatchers = Object.keys(restrictedMatchers || {}).length > 0;
|
|
1682
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1623
|
+
const builder = new ConfigEntryBuilder("vitest", options, internalOptions);
|
|
1683
1624
|
builder.addConfig(
|
|
1684
1625
|
[
|
|
1685
1626
|
"vitest",
|
|
@@ -1692,18 +1633,16 @@ var vitestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1692
1633
|
...defaultVitestEslintConfig
|
|
1693
1634
|
}
|
|
1694
1635
|
).addBulkRules(import_eslint_plugin.default.configs.recommended.rules).addRule(
|
|
1695
|
-
"
|
|
1636
|
+
"consistent-test-it",
|
|
1696
1637
|
options.testDefinitionKeyword === false ? OFF : ERROR,
|
|
1697
1638
|
generateConsistentTestItOptions(options)
|
|
1698
|
-
).addRule("
|
|
1699
|
-
{ max: maxAssertionCalls }
|
|
1700
|
-
]).addRule("vitest/max-nested-describe", maxNestedDescribes == null ? OFF : ERROR, [
|
|
1639
|
+
).addRule("max-expects", maxAssertionCalls == null ? OFF : ERROR, [{ max: maxAssertionCalls }]).addRule("max-nested-describe", maxNestedDescribes == null ? OFF : ERROR, [
|
|
1701
1640
|
{ max: maxNestedDescribes }
|
|
1702
|
-
]).addRule("
|
|
1641
|
+
]).addRule("no-alias-methods", ERROR).addRule("no-commented-out-tests", WARNING).addRule("no-conditional-expect", ERROR).addRule("no-conditional-tests", ERROR).addRule("no-disabled-tests", WARNING).addRule("no-duplicate-hooks", ERROR).addRule("no-focused-tests", ERROR).addRule("no-interpolation-in-snapshots", ERROR).addRule("no-mocks-import", ERROR).addRule("no-restricted-matchers", hasRestrictedMatchers ? ERROR : OFF, [
|
|
1703
1642
|
restrictedMatchers || {}
|
|
1704
|
-
]).addRule("
|
|
1643
|
+
]).addRule("no-restricted-vi-methods", hasRestrictedMethods ? ERROR : OFF, [
|
|
1705
1644
|
restrictedMethods || {}
|
|
1706
|
-
]).addRule("
|
|
1645
|
+
]).addRule("no-standalone-expect", ERROR).addRule("no-test-prefixes", ERROR).addRule("no-test-return-statement", ERROR).addRule("prefer-comparison-matcher", ERROR).addRule("prefer-each", WARNING).addRule("prefer-equality-matcher", ERROR).addRule("prefer-expect-resolves", ERROR).addRule("prefer-hooks-in-order", ERROR).addRule("prefer-hooks-on-top", ERROR).addRule("prefer-lowercase-title", ERROR).addRule("prefer-mock-promise-shorthand", ERROR).addRule("prefer-spy-on", ERROR).addRule("prefer-strict-equal", WARNING).addRule("prefer-to-be", ERROR).addRule("prefer-to-be-object", ERROR).addRule("prefer-to-contain", ERROR).addRule("prefer-to-have-length", ERROR).addRule("prefer-todo", WARNING).addRule("require-hook", WARNING).addRule("require-mock-type-parameters", WARNING).addRule("require-to-throw-message", OFF).addRule("require-top-level-describe", OFF).addRule("valid-expect", ERROR, [
|
|
1707
1646
|
{
|
|
1708
1647
|
alwaysAwait: true,
|
|
1709
1648
|
// Default: false
|
|
@@ -1715,7 +1654,7 @@ var vitestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1715
1654
|
maxArgs: minAndMaxExpectArgs[1]
|
|
1716
1655
|
}
|
|
1717
1656
|
}
|
|
1718
|
-
]).addRule("
|
|
1657
|
+
]).addRule("valid-expect-in-promise", ERROR);
|
|
1719
1658
|
return builder.getAllConfigs();
|
|
1720
1659
|
};
|
|
1721
1660
|
|
|
@@ -1794,7 +1733,7 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1794
1733
|
const recommendedRules = bulkChangeRuleSeverity(recommendedRulesRaw, ERROR);
|
|
1795
1734
|
const inNuxtAppDir = joinPaths.bind(null, options.nuxtOrVueProjectDir);
|
|
1796
1735
|
const nuxtLayoutsFilesGlob = inNuxtAppDir("layouts/**/*.vue");
|
|
1797
|
-
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1736
|
+
const builder = new ConfigEntryBuilder("vue", options, internalOptions);
|
|
1798
1737
|
builder.addConfig(["vue/setup", { doNotIgnoreMarkdown: true }], {
|
|
1799
1738
|
files: [GLOB_VUE, ...files],
|
|
1800
1739
|
processor: (0, import_eslint_merge_processors2.mergeProcessors)(
|
|
@@ -1830,10 +1769,10 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1830
1769
|
});
|
|
1831
1770
|
builder.addConfig(["vue", { includeDefaultFilesAndIgnores: true }], {
|
|
1832
1771
|
files
|
|
1833
|
-
}).addBulkRules(recommendedRules).addRule("
|
|
1772
|
+
}).addBulkRules(recommendedRules).addRule("comment-directive", ERROR, [
|
|
1834
1773
|
// false by default
|
|
1835
1774
|
{ reportUnusedDisableDirectives: options.reportUnusedDisableDirectives ?? true }
|
|
1836
|
-
]).addRule("
|
|
1775
|
+
]).addRule("no-deprecated-scope-attribute", isLess2_5 ? OFF : ERROR).addRule("no-deprecated-slot-attribute", isLess2_6 ? OFF : ERROR).addRule("no-deprecated-slot-scope-attribute", isLess2_6 ? OFF : ERROR).addRule("no-deprecated-v-is", isLess3_1 ? OFF : ERROR).addRule("html-self-closing", ERROR, [
|
|
1837
1776
|
{
|
|
1838
1777
|
html: {
|
|
1839
1778
|
void: "any",
|
|
@@ -1842,19 +1781,19 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1842
1781
|
component: "never"
|
|
1843
1782
|
}
|
|
1844
1783
|
}
|
|
1845
|
-
]).addRule("
|
|
1784
|
+
]).addRule("require-default-prop", OFF).addRule("v-bind-style", ERROR, [
|
|
1846
1785
|
"shorthand",
|
|
1847
1786
|
{
|
|
1848
1787
|
...isMin3_4 && { sameNameShorthand: "always" }
|
|
1849
1788
|
}
|
|
1850
|
-
]).addRule("
|
|
1789
|
+
]).addRule("block-lang", ERROR, [
|
|
1851
1790
|
{
|
|
1852
1791
|
script: {
|
|
1853
1792
|
lang: "ts",
|
|
1854
1793
|
...enforceTypescriptInScriptSection !== true && { allowNoLang: true }
|
|
1855
1794
|
}
|
|
1856
1795
|
}
|
|
1857
|
-
]).addRule("
|
|
1796
|
+
]).addRule("block-order", ERROR, [
|
|
1858
1797
|
{
|
|
1859
1798
|
order: [
|
|
1860
1799
|
...Array.isArray(options.sfcBlockOrder) ? options.sfcBlockOrder : options.sfcBlockOrder === "script-first" ? ["script:not([setup])", "script[setup]", "template"] : ["template", "script:not([setup])", "script[setup]"],
|
|
@@ -1863,13 +1802,13 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1863
1802
|
"style[scoped]"
|
|
1864
1803
|
]
|
|
1865
1804
|
}
|
|
1866
|
-
]).addRule("
|
|
1805
|
+
]).addRule("component-api-style", options.enforceApiStyle == null ? OFF : ERROR, [
|
|
1867
1806
|
[
|
|
1868
1807
|
options.enforceApiStyle === "setup" ? "script-setup" : "options",
|
|
1869
1808
|
// allows Composition API (not <script setup>)
|
|
1870
1809
|
isVue2 ? "composition-vue2" : "composition"
|
|
1871
1810
|
]
|
|
1872
|
-
]).addRule("
|
|
1811
|
+
]).addRule("component-name-in-template-casing", ERROR, [
|
|
1873
1812
|
"kebab-case",
|
|
1874
1813
|
{
|
|
1875
1814
|
registeredComponentsOnly: false,
|
|
@@ -1878,15 +1817,15 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1878
1817
|
/* Single word components must start with a capital letter */
|
|
1879
1818
|
]
|
|
1880
1819
|
}
|
|
1881
|
-
]).addRule("
|
|
1820
|
+
]).addRule("component-options-name-casing", ERROR, [
|
|
1882
1821
|
"PascalCase"
|
|
1883
1822
|
/* default */
|
|
1884
|
-
]).addRule("
|
|
1823
|
+
]).addRule("custom-event-name-casing", ERROR, [
|
|
1885
1824
|
"kebab-case"
|
|
1886
1825
|
/* default is `camelCase` */
|
|
1887
|
-
]).addRule("
|
|
1826
|
+
]).addRule("define-emits-declaration", ERROR, [
|
|
1888
1827
|
isMin3_3 ? "type-literal" : "type-based"
|
|
1889
|
-
]).addRule("
|
|
1828
|
+
]).addRule("define-macros-order", ERROR, [
|
|
1890
1829
|
{
|
|
1891
1830
|
order: [
|
|
1892
1831
|
"definePage",
|
|
@@ -1903,16 +1842,14 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1903
1842
|
],
|
|
1904
1843
|
...isMin3_4 && { defineExposeLast: true }
|
|
1905
1844
|
}
|
|
1906
|
-
]).addRule("
|
|
1907
|
-
|
|
1908
|
-
]).addRule("vue/html-button-has-type", ERROR).addRule("vue/no-deprecated-delete-set", isVue3 ? ERROR : OFF).addRule("vue/no-deprecated-model-definition", isVue3 ? ERROR : OFF).addRule("vue/no-duplicate-attr-inheritance", ERROR).addRule("vue/no-empty-component-block", ERROR).addRule("vue/no-multiple-objects-in-class", ERROR).addRule("vue/no-potential-component-option-typo", ERROR).addRule("vue/no-ref-object-reactivity-loss", ERROR).addRule("vue/no-required-prop-with-default", ERROR).addRule(
|
|
1909
|
-
"vue/no-restricted-html-elements",
|
|
1845
|
+
]).addRule("define-props-declaration", ERROR, [options.enforcePropsDeclarationStyle ?? "runtime"]).addRule("html-button-has-type", ERROR).addRule("no-deprecated-delete-set", isVue3 ? ERROR : OFF).addRule("no-deprecated-model-definition", isVue3 ? ERROR : OFF).addRule("no-duplicate-attr-inheritance", ERROR).addRule("no-empty-component-block", ERROR).addRule("no-import-compiler-macros", ERROR).addRule("no-multiple-objects-in-class", ERROR).addRule("no-potential-component-option-typo", ERROR).addRule("no-ref-object-reactivity-loss", ERROR).addRule(
|
|
1846
|
+
"no-restricted-html-elements",
|
|
1910
1847
|
ERROR,
|
|
1911
1848
|
Object.entries({
|
|
1912
1849
|
...noRestrictedHtmlElementsDefault,
|
|
1913
1850
|
...options.disallowedHtmlTags
|
|
1914
1851
|
}).filter(([, isDisallowed]) => isDisallowed).map(([tag]) => tag)
|
|
1915
|
-
).addRule("
|
|
1852
|
+
).addRule("no-setup-props-reactivity-loss", ERROR).addRule("no-this-in-before-route-enter", ERROR).addRule("no-undef-components", ERROR, [
|
|
1916
1853
|
{
|
|
1917
1854
|
ignorePatterns: [
|
|
1918
1855
|
"router-link",
|
|
@@ -1921,29 +1858,26 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1921
1858
|
...options.knownComponentNames || []
|
|
1922
1859
|
].flat().filter((v) => v !== false)
|
|
1923
1860
|
}
|
|
1924
|
-
]).addRule("
|
|
1861
|
+
]).addRule("no-unsupported-features", ERROR, [
|
|
1925
1862
|
{ version: `^${options.fullVersion || majorVersion}` }
|
|
1926
|
-
]).addRule("
|
|
1863
|
+
]).addRule("no-unused-emit-declarations", ERROR).addRule("no-unused-refs", ERROR).addRule("no-use-v-else-with-v-for", ERROR).addRule("no-useless-mustaches", ERROR).addRule("no-useless-v-bind", ERROR).addRule("padding-line-between-blocks", ERROR).addRule("padding-lines-in-component-definition", ERROR, [
|
|
1927
1864
|
{
|
|
1928
1865
|
withinOption: {
|
|
1929
1866
|
// TODO understand the difference between `betweenItems` and `withinEach`: https://eslint.vuejs.org/rules/padding-lines-in-component-definition.html
|
|
1930
1867
|
props: "ignore"
|
|
1931
1868
|
}
|
|
1932
1869
|
}
|
|
1933
|
-
]).addRule("
|
|
1934
|
-
"
|
|
1935
|
-
options.preferUseTemplateRef ?? isMin3_5 ? ERROR : OFF
|
|
1936
|
-
).addRule("vue/require-default-export", ERROR).addRule("vue/require-direct-export", ERROR).addRule("vue/require-explicit-slots", isMin3_3 ? ERROR : OFF).addRule("vue/require-macro-variable-name", ERROR).addRule("vue/require-typed-object-prop", ERROR).addRule("vue/require-typed-ref", ERROR).addRule(
|
|
1937
|
-
"vue/slot-name-casing",
|
|
1870
|
+
]).addRule("prefer-define-options", isMin3_3 ? ERROR : OFF).addRule("prefer-prop-type-boolean-first", ERROR).addRule("prefer-separate-static-class", ERROR).addRule("prefer-true-attribute-shorthand", ERROR).addRule("prefer-use-template-ref", options.preferUseTemplateRef ?? isMin3_5 ? ERROR : OFF).addRule("require-default-export", ERROR).addRule("require-direct-export", ERROR).addRule("require-explicit-slots", isMin3_3 ? ERROR : OFF).addRule("require-macro-variable-name", ERROR).addRule("require-typed-object-prop", ERROR).addRule("require-typed-ref", ERROR).addRule(
|
|
1871
|
+
"slot-name-casing",
|
|
1938
1872
|
ERROR
|
|
1939
1873
|
/* `camelCase` is default */
|
|
1940
|
-
).addRule("
|
|
1874
|
+
).addRule("v-for-delimiter-style", ERROR, [
|
|
1941
1875
|
"in"
|
|
1942
1876
|
/* default */
|
|
1943
|
-
]).addRule("
|
|
1944
|
-
"
|
|
1877
|
+
]).addRule("v-for-delimiter-style", isVue2 ? ERROR : OFF).addRule("v-on-handler-style", ERROR, ["inline"]).addRule("valid-define-options", isMin3_3 ? ERROR : OFF).addRule("camelcase", ERROR, RULE_CAMELCASE_OPTIONS).addRule(
|
|
1878
|
+
"dot-notation",
|
|
1945
1879
|
options.noPropertyAccessFromIndexSignatureSetInTsconfigForVueFiles ? OFF : ERROR
|
|
1946
|
-
).addRule("
|
|
1880
|
+
).addRule("eqeqeq", ERROR, RULE_EQEQEQ_OPTIONS).addRule("no-console", ERROR).addRule("no-constant-condition", WARNING).addRule("no-empty-pattern", ERROR).addRule("no-irregular-whitespace", ERROR).addRule("no-loss-of-precision", ERROR).addRule("no-sparse-arrays", ERROR).addRule("no-useless-concat", ERROR).addRule("object-shorthand", ERROR).addRule("prefer-template", ERROR).addAnyRule("@typescript-eslint/prefer-function-type", OFF).addAnyRule("@typescript-eslint/unified-signatures", OFF).addAnyRule("import/first", OFF).addAnyRule("import/no-default-export", OFF).addAnyRule("no-useless-assignment", OFF).addOverrides();
|
|
1947
1881
|
builder.addConfig("vue/allow-single-word-component-names", {
|
|
1948
1882
|
files: [
|
|
1949
1883
|
inNuxtAppDir("pages/**/*.vue"),
|
|
@@ -1954,12 +1888,12 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1954
1888
|
],
|
|
1955
1889
|
options.doNotRequireComponentNamesToBeMultiWordForPatterns
|
|
1956
1890
|
].flat().filter((v) => typeof v === "string")
|
|
1957
|
-
}).addRule("
|
|
1891
|
+
}).addRule("multi-word-component-names", OFF);
|
|
1958
1892
|
const vueAllowImplicitSlotsConfig = builder.addConfig("vue/allow-implicit-slots", {
|
|
1959
1893
|
files: [nuxtLayoutsFilesGlob]
|
|
1960
1894
|
});
|
|
1961
1895
|
if (isNuxtEnabled) {
|
|
1962
|
-
vueAllowImplicitSlotsConfig.addRule("
|
|
1896
|
+
vueAllowImplicitSlotsConfig.addRule("require-explicit-slots", OFF);
|
|
1963
1897
|
}
|
|
1964
1898
|
builder.addConfig("vue/allow-default-export", {
|
|
1965
1899
|
files: [
|
|
@@ -1971,7 +1905,8 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1971
1905
|
]
|
|
1972
1906
|
].flat().filter((v) => typeof v === "string")
|
|
1973
1907
|
}).addAnyRule("import/no-default-export", OFF);
|
|
1974
|
-
const
|
|
1908
|
+
const builderA11y = new ConfigEntryBuilder("vuejs-accessibility", {}, internalOptions);
|
|
1909
|
+
const a11yConfig = builderA11y.addConfig(
|
|
1975
1910
|
[
|
|
1976
1911
|
"vue/a11y",
|
|
1977
1912
|
{
|
|
@@ -1982,31 +1917,30 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1982
1917
|
files
|
|
1983
1918
|
}
|
|
1984
1919
|
);
|
|
1985
|
-
|
|
1986
|
-
a11yConfig.addBulkRules(
|
|
1987
|
-
import_eslint_plugin_vuejs_accessibility.default.configs["flat/recommended"].find((v) => "rules" in v)?.rules
|
|
1988
|
-
).addRule("vuejs-accessibility/label-has-for", ERROR, [{ allowChildren: true }]).addBulkRules(options.overridesA11y);
|
|
1989
|
-
}
|
|
1920
|
+
a11yConfig.addBulkRules(import_eslint_plugin_vuejs_accessibility.default.configs["flat/recommended"].find((v) => "rules" in v)?.rules).addRule("label-has-for", ERROR, [{ allowChildren: true }]).addBulkRules(options.overridesA11y);
|
|
1990
1921
|
const piniaBuilder = new ConfigEntryBuilder(
|
|
1922
|
+
"pinia",
|
|
1991
1923
|
typeof pinia === "object" ? pinia : {},
|
|
1992
1924
|
internalOptions
|
|
1993
1925
|
);
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
1926
|
+
const piniaConfig = piniaBuilder.addConfig([
|
|
1927
|
+
"pinia",
|
|
1928
|
+
{
|
|
1929
|
+
includeDefaultFilesAndIgnores: true,
|
|
1930
|
+
ignoreMarkdownCodeBlocks: true
|
|
1931
|
+
}
|
|
1932
|
+
]);
|
|
1933
|
+
piniaConfig.addBulkRules(import_eslint_plugin_pinia.default.configs["recommended-flat"].rules).addRule("prefer-single-store-per-file", ERROR).addRule("prefer-use-store-naming-convention", ERROR, [
|
|
1934
|
+
{
|
|
1935
|
+
checkStoreNameMismatch: true,
|
|
1936
|
+
storeSuffix: typeof pinia === "object" && pinia.storesNameSuffix != null ? pinia.storesNameSuffix : DEFAULT_PINIA_STORE_NAME_SUFFIX
|
|
1937
|
+
}
|
|
1938
|
+
]);
|
|
1939
|
+
return [
|
|
1940
|
+
...builder.getAllConfigs(),
|
|
1941
|
+
...a11y ? builderA11y.getAllConfigs() : [],
|
|
1942
|
+
...pinia ? piniaBuilder.getAllConfigs() : []
|
|
1943
|
+
];
|
|
2010
1944
|
};
|
|
2011
1945
|
|
|
2012
1946
|
// src/plugins.ts
|