eslint-config-un 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -6
- package/dist/index.cjs +154 -182
- package/dist/index.d.cts +3022 -3421
- package/dist/index.d.ts +3022 -3421
- package/dist/index.js +155 -187
- package/package.json +22 -25
package/README.md
CHANGED
|
@@ -85,12 +85,6 @@ But applying certain rules for code blocks might not be desirable because some o
|
|
|
85
85
|
|
|
86
86
|
## Troubleshooting
|
|
87
87
|
|
|
88
|
-
### TypeError: Key `rules`: Key `disable-autofix/<rule name>`: Could not find `<rule name>` in plugin `disable-autofix`
|
|
89
|
-
|
|
90
|
-
We disable autofix for some rules in this package via `eslint-plugin-disable-autofix`. However, it requires all the configs/plugins packages to be hoisted (installed to the top level of `node_modules`). You might need to reinstall this package, re-create `node_modules` directory (do not delete your lock file!) or set `shamefully-hoist=true` in your `.npmrc` if you're using pnpm. Sometimes you'll need to manually install some packages refused to be hoisted (happens with `@typescript-eslint/eslint-plugin`: `npm i @typescript-eslint/eslint-plugin -D --legacy-peer-deps`).
|
|
91
|
-
|
|
92
|
-
This error could also happen if a dependency of this package is installed in your project separately.
|
|
93
|
-
|
|
94
88
|
### TypeError: Key `languageOptions`: Key `globals`: Global `AudioWorkletGlobalScope ` has leading or trailing whitespace.
|
|
95
89
|
|
|
96
90
|
Install `globals` package as a dev dependency.
|
package/dist/index.cjs
CHANGED
|
@@ -392,17 +392,13 @@ __export(index_exports, {
|
|
|
392
392
|
module.exports = __toCommonJS(index_exports);
|
|
393
393
|
init_cjs_shims();
|
|
394
394
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
395
|
-
var import_eslint_plugin2 = __toESM(require("@stylistic/eslint-plugin"), 1);
|
|
396
395
|
var import_eslint_config_flat_gitignore = __toESM(require("eslint-config-flat-gitignore"), 1);
|
|
397
396
|
var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
|
|
398
|
-
var import_eslint_plugin_disable_autofix = __toESM(require("eslint-plugin-disable-autofix"), 1);
|
|
399
|
-
var import_eslint_plugin_unicorn2 = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
400
397
|
var import_globals2 = __toESM(require("globals"), 1);
|
|
401
398
|
var import_local_pkg2 = require("local-pkg");
|
|
402
399
|
|
|
403
400
|
// src/configs/css-in-js.ts
|
|
404
401
|
init_cjs_shims();
|
|
405
|
-
var import_eslint_plugin_css = __toESM(require("eslint-plugin-css"), 1);
|
|
406
402
|
|
|
407
403
|
// src/constants.ts
|
|
408
404
|
init_cjs_shims();
|
|
@@ -444,6 +440,8 @@ var DEFAULT_GLOBAL_IGNORES = ["**/dist"];
|
|
|
444
440
|
|
|
445
441
|
// src/eslint.ts
|
|
446
442
|
init_cjs_shims();
|
|
443
|
+
var import_eslint_rule_composer = __toESM(require("eslint-rule-composer"), 1);
|
|
444
|
+
var import_klona = require("klona");
|
|
447
445
|
var genFlatConfigEntryName = (name) => `eslint-config-un/${name}`;
|
|
448
446
|
var createPluginObjectRenamer = (from, to) => {
|
|
449
447
|
const fromRegex = new RegExp(`^${from}/`);
|
|
@@ -463,6 +461,22 @@ var bulkChangeRuleSeverity = (rules, severity) => Object.fromEntries(
|
|
|
463
461
|
]
|
|
464
462
|
)
|
|
465
463
|
);
|
|
464
|
+
var disableAutofixForAllRulesInPlugin = (pluginNamespace, plugin) => Object.fromEntries(
|
|
465
|
+
Object.entries((0, import_klona.klona)(plugin.rules || {})).map(([ruleId, ruleImplementation]) => {
|
|
466
|
+
const ruleWithAutofixDisabled = import_eslint_rule_composer.default.mapReports(
|
|
467
|
+
ruleImplementation,
|
|
468
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
469
|
+
(problem) => {
|
|
470
|
+
delete problem.fix;
|
|
471
|
+
return problem;
|
|
472
|
+
}
|
|
473
|
+
);
|
|
474
|
+
if (ruleWithAutofixDisabled.meta?.fixable) {
|
|
475
|
+
delete ruleWithAutofixDisabled.meta.fixable;
|
|
476
|
+
}
|
|
477
|
+
return [`${pluginNamespace}/${ruleId}`, ruleWithAutofixDisabled];
|
|
478
|
+
})
|
|
479
|
+
);
|
|
466
480
|
var ConfigEntryBuilder = class {
|
|
467
481
|
constructor(options, internalOptions) {
|
|
468
482
|
this.options = options;
|
|
@@ -547,12 +561,6 @@ var cssInJsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
547
561
|
} = options;
|
|
548
562
|
const preferNamedColors = typeof preferNamedColorsRaw === "object" ? preferNamedColorsRaw : { flag: preferNamedColorsRaw ?? false };
|
|
549
563
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
550
|
-
builder.addConfig("css-in-js/setup", {
|
|
551
|
-
plugins: {
|
|
552
|
-
// @ts-expect-error types mismatch
|
|
553
|
-
"css-in-js": import_eslint_plugin_css.default
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
564
|
builder.addConfig(["css-in-js", { includeDefaultFilesAndIgnores: true }], {
|
|
557
565
|
...pluginSettings && {
|
|
558
566
|
settings: {
|
|
@@ -570,6 +578,14 @@ var cssInJsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
570
578
|
return builder.getAllConfigs();
|
|
571
579
|
};
|
|
572
580
|
|
|
581
|
+
// src/configs/de-morgan.ts
|
|
582
|
+
init_cjs_shims();
|
|
583
|
+
var deMorganEslintConfig = (options = {}, internalOptions = {}) => {
|
|
584
|
+
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
585
|
+
builder.addConfig(["de-morgan", { includeDefaultFilesAndIgnores: true }]).addRule("de-morgan/no-negated-conjunction", ERROR).addRule("de-morgan/no-negated-disjunction", ERROR).addOverrides();
|
|
586
|
+
return builder.getAllConfigs();
|
|
587
|
+
};
|
|
588
|
+
|
|
573
589
|
// src/configs/eslint-comments.ts
|
|
574
590
|
init_cjs_shims();
|
|
575
591
|
var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
|
|
@@ -578,12 +594,7 @@ var eslintCommentsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
578
594
|
options,
|
|
579
595
|
internalOptions
|
|
580
596
|
);
|
|
581
|
-
builder.addConfig(["eslint-comments", { includeDefaultFilesAndIgnores: true }],
|
|
582
|
-
plugins: {
|
|
583
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
584
|
-
"@eslint-community/eslint-comments": import_eslint_plugin_eslint_comments.default
|
|
585
|
-
}
|
|
586
|
-
}).addBulkRules(import_eslint_plugin_eslint_comments.default.configs.recommended.rules).addRule("@eslint-community/eslint-comments/disable-enable-pair", ERROR, [
|
|
597
|
+
builder.addConfig(["eslint-comments", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_eslint_comments.default.configs.recommended.rules).addRule("@eslint-community/eslint-comments/disable-enable-pair", ERROR, [
|
|
587
598
|
{ allowWholeFile: true }
|
|
588
599
|
]).addOverrides();
|
|
589
600
|
return builder.getAllConfigs();
|
|
@@ -634,10 +645,6 @@ var importEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
634
645
|
const noUnresolvedIgnores = arraify(options.importPatternsToIgnoreWhenTryingToResolve);
|
|
635
646
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
636
647
|
builder.addConfig(["import", { includeDefaultFilesAndIgnores: true }], {
|
|
637
|
-
plugins: {
|
|
638
|
-
// @ts-expect-error small types mismatch
|
|
639
|
-
import: import_eslint_plugin_import_x.default
|
|
640
|
-
},
|
|
641
648
|
settings: {
|
|
642
649
|
...isTypescriptEnabled && import_eslint_plugin_import_x.default.configs.typescript.settings,
|
|
643
650
|
"import-x/resolver-next": [
|
|
@@ -730,17 +737,6 @@ var jestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
730
737
|
const hasRestrictedMatchers = Object.keys(restrictedMatchers || {}).length > 0;
|
|
731
738
|
const getPaddingAroundSeverity = (key) => paddingAround === true || paddingAround && paddingAround[key] !== false ? ERROR : OFF;
|
|
732
739
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
733
|
-
builder.addConfig("jest/setup", {
|
|
734
|
-
plugins: {
|
|
735
|
-
jest: import_eslint_plugin_jest.default
|
|
736
|
-
}
|
|
737
|
-
});
|
|
738
|
-
builder.addConfig("jest/extended/setup", {
|
|
739
|
-
plugins: {
|
|
740
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
741
|
-
"jest-extended": import_eslint_plugin_jest_extended.default
|
|
742
|
-
}
|
|
743
|
-
});
|
|
744
740
|
builder.addConfig(
|
|
745
741
|
[
|
|
746
742
|
"jest",
|
|
@@ -845,7 +841,6 @@ var jestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
845
841
|
// src/configs/js.ts
|
|
846
842
|
init_cjs_shims();
|
|
847
843
|
var import_js = __toESM(require_src(), 1);
|
|
848
|
-
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
849
844
|
var RULE_CAMELCASE_OPTIONS = [
|
|
850
845
|
{
|
|
851
846
|
properties: "never",
|
|
@@ -904,11 +899,7 @@ var jsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
904
899
|
{ blankLine: "never", prev: "import", next: "import" }
|
|
905
900
|
]).addOverrides();
|
|
906
901
|
if (options.autofixToRemoveUnusedImports ?? true) {
|
|
907
|
-
builder.addConfig("js/disable-unused-imports",
|
|
908
|
-
plugins: {
|
|
909
|
-
"unused-imports": import_eslint_plugin_unused_imports.default
|
|
910
|
-
}
|
|
911
|
-
}).addRule("unused-imports/no-unused-imports", ERROR);
|
|
902
|
+
builder.addConfig("js/disable-unused-imports").addRule("unused-imports/no-unused-imports", ERROR);
|
|
912
903
|
}
|
|
913
904
|
return builder.getAllConfigs();
|
|
914
905
|
};
|
|
@@ -922,11 +913,6 @@ var jsdocEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
922
913
|
typescript: typescriptOnlyRules = internalOptions.isTypescriptEnabled
|
|
923
914
|
} = options;
|
|
924
915
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
925
|
-
builder.addConfig("jsdoc/setup", {
|
|
926
|
-
plugins: {
|
|
927
|
-
jsdoc: import_eslint_plugin_jsdoc.default
|
|
928
|
-
}
|
|
929
|
-
});
|
|
930
916
|
builder.addConfig(["jsdoc", { includeDefaultFilesAndIgnores: true }], {
|
|
931
917
|
...pluginSettings && {
|
|
932
918
|
settings: {
|
|
@@ -977,10 +963,6 @@ var jsoncEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
977
963
|
}
|
|
978
964
|
],
|
|
979
965
|
{
|
|
980
|
-
plugins: {
|
|
981
|
-
// @ts-expect-error types mismatch
|
|
982
|
-
jsonc: import_eslint_plugin_jsonc.default
|
|
983
|
-
},
|
|
984
966
|
languageOptions: {
|
|
985
967
|
parser: import_jsonc_eslint_parser.default
|
|
986
968
|
}
|
|
@@ -994,41 +976,23 @@ var jsoncEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
994
976
|
const result = builder.getAllConfigs();
|
|
995
977
|
if (options.jsonConfig) {
|
|
996
978
|
const jsonBuilder = new ConfigEntryBuilder(options.jsonConfig, internalOptions);
|
|
997
|
-
jsonBuilder.addConfig(
|
|
998
|
-
["jsonc/json", { includeDefaultFilesAndIgnores: true, filesFallback: [GLOB_JSON] }],
|
|
999
|
-
{
|
|
1000
|
-
plugins: {
|
|
1001
|
-
// @ts-expect-error types mismatch
|
|
1002
|
-
jsonc: import_eslint_plugin_jsonc.default
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
).addOverrides();
|
|
979
|
+
jsonBuilder.addConfig(["jsonc/json", { includeDefaultFilesAndIgnores: true, filesFallback: [GLOB_JSON] }]).addOverrides();
|
|
1006
980
|
result.push(...jsonBuilder.getAllConfigs());
|
|
1007
981
|
}
|
|
1008
982
|
if (options.jsoncConfig) {
|
|
1009
983
|
const jsoncBuilder = new ConfigEntryBuilder(options.jsoncConfig, internalOptions);
|
|
1010
|
-
jsoncBuilder.addConfig(
|
|
1011
|
-
|
|
1012
|
-
{
|
|
1013
|
-
|
|
1014
|
-
// @ts-expect-error types mismatch
|
|
1015
|
-
jsonc: import_eslint_plugin_jsonc.default
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
).addOverrides();
|
|
984
|
+
jsoncBuilder.addConfig([
|
|
985
|
+
"jsonc/jsonc",
|
|
986
|
+
{ includeDefaultFilesAndIgnores: true, filesFallback: [GLOB_JSONC] }
|
|
987
|
+
]).addOverrides();
|
|
1019
988
|
result.push(...jsoncBuilder.getAllConfigs());
|
|
1020
989
|
}
|
|
1021
990
|
if (options.json5Config) {
|
|
1022
991
|
const json5Builder = new ConfigEntryBuilder(options.json5Config, internalOptions);
|
|
1023
|
-
json5Builder.addConfig(
|
|
1024
|
-
|
|
1025
|
-
{
|
|
1026
|
-
|
|
1027
|
-
// @ts-expect-error types mismatch
|
|
1028
|
-
jsonc: import_eslint_plugin_jsonc.default
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
).addOverrides();
|
|
992
|
+
json5Builder.addConfig([
|
|
993
|
+
"jsonc/json5",
|
|
994
|
+
{ includeDefaultFilesAndIgnores: true, filesFallback: [GLOB_JSON5] }
|
|
995
|
+
]).addOverrides();
|
|
1032
996
|
result.push(...json5Builder.getAllConfigs());
|
|
1033
997
|
}
|
|
1034
998
|
return result;
|
|
@@ -1055,11 +1019,7 @@ var markdownEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1055
1019
|
const recommendedConfigs = arraify(import_markdown.default.configs.recommended);
|
|
1056
1020
|
const processorConfigs = arraify(import_markdown.default.configs.processor);
|
|
1057
1021
|
const allowedFencedCodeBlocksLanguages = Array.isArray(codeBlocksAllowedLanguages) && codeBlocksAllowedLanguages.length > 0 && codeBlocksAllowedLanguages;
|
|
1058
|
-
builder.addConfig(["markdown/setup", { doNotIgnoreMarkdown: true }]
|
|
1059
|
-
plugins: {
|
|
1060
|
-
markdown: import_markdown.default
|
|
1061
|
-
}
|
|
1062
|
-
});
|
|
1022
|
+
builder.addConfig(["markdown/setup", { doNotIgnoreMarkdown: true }]);
|
|
1063
1023
|
if (lintMarkdown) {
|
|
1064
1024
|
builder.addConfig(
|
|
1065
1025
|
[
|
|
@@ -1171,11 +1131,7 @@ var pluginRenamer2 = createPluginObjectRenamer("n", "node");
|
|
|
1171
1131
|
var nodeEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1172
1132
|
const { preferGlobal = {} } = options;
|
|
1173
1133
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1174
|
-
builder.addConfig(["node", { includeDefaultFilesAndIgnores: true }], {
|
|
1175
|
-
plugins: {
|
|
1176
|
-
node: import_eslint_plugin_n.default
|
|
1177
|
-
}
|
|
1178
|
-
}).addBulkRules(pluginRenamer2(import_eslint_plugin_n.default.configs["flat/recommended"].rules)).addRule("node/exports-style", ERROR, ["module.exports", { allowBatchAssign: false }]).addRule("node/no-extraneous-import", OFF).addRule("node/no-missing-import", OFF).addRule("node/no-new-require", ERROR).addRule("node/no-path-concat", ERROR).addRule("node/no-process-exit", OFF).addAnyRule("unicorn/no-process-exit", ERROR).addRule("node/no-unpublished-import", OFF).addRule("node/prefer-global/buffer", ERROR, [
|
|
1134
|
+
builder.addConfig(["node", { includeDefaultFilesAndIgnores: true }]).addBulkRules(pluginRenamer2(import_eslint_plugin_n.default.configs["flat/recommended"].rules)).addRule("node/exports-style", ERROR, ["module.exports", { allowBatchAssign: false }]).addRule("node/no-extraneous-import", OFF).addRule("node/no-missing-import", OFF).addRule("node/no-new-require", ERROR).addRule("node/no-path-concat", ERROR).addRule("node/no-process-exit", OFF).addAnyRule("unicorn/no-process-exit", ERROR).addRule("node/no-unpublished-import", OFF).addRule("node/prefer-global/buffer", ERROR, [
|
|
1179
1135
|
preferGlobal.buffer === false ? "never" : "always"
|
|
1180
1136
|
]).addRule("node/prefer-global/console", ERROR, [
|
|
1181
1137
|
preferGlobal.console === false ? "never" : "always"
|
|
@@ -1209,10 +1165,6 @@ var packageJsonEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1209
1165
|
builder.addConfig(
|
|
1210
1166
|
["package-json", { includeDefaultFilesAndIgnores: true, filesFallback: DEFAULT_FILES3 }],
|
|
1211
1167
|
{
|
|
1212
|
-
plugins: {
|
|
1213
|
-
// @ts-expect-error types mismatch
|
|
1214
|
-
"package-json": import_recommended.default.plugins["package-json"]
|
|
1215
|
-
},
|
|
1216
1168
|
languageOptions: {
|
|
1217
1169
|
parser: import_jsonc_eslint_parser2.default
|
|
1218
1170
|
}
|
|
@@ -1232,28 +1184,17 @@ var packageJsonEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1232
1184
|
|
|
1233
1185
|
// src/configs/perfectionist.ts
|
|
1234
1186
|
init_cjs_shims();
|
|
1235
|
-
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
1236
1187
|
var perfectionistEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1237
1188
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1238
|
-
builder.addConfig(["perfectionist", { includeDefaultFilesAndIgnores: true }],
|
|
1239
|
-
plugins: {
|
|
1240
|
-
perfectionist: import_eslint_plugin_perfectionist.default
|
|
1241
|
-
}
|
|
1242
|
-
}).addRule("perfectionist/sort-array-includes", OFF).addRule("perfectionist/sort-classes", OFF).addRule("perfectionist/sort-decorators", OFF).addRule("perfectionist/sort-enums", OFF).addRule("perfectionist/sort-exports", OFF).addRule("perfectionist/sort-heritage-clauses", OFF).addRule("perfectionist/sort-imports", OFF).addRule("perfectionist/sort-interfaces", OFF).addRule("perfectionist/sort-intersection-types", OFF).addRule("perfectionist/sort-jsx-props", OFF).addRule("perfectionist/sort-maps", OFF).addRule("perfectionist/sort-modules", OFF).addRule("perfectionist/sort-named-exports", OFF).addRule("perfectionist/sort-named-imports", OFF).addRule("perfectionist/sort-object-types", OFF).addRule("perfectionist/sort-objects", OFF).addRule("perfectionist/sort-sets", OFF).addRule("perfectionist/sort-switch-case", OFF).addRule("perfectionist/sort-union-types", OFF).addRule("perfectionist/sort-variable-declarations", OFF).addOverrides();
|
|
1189
|
+
builder.addConfig(["perfectionist", { includeDefaultFilesAndIgnores: true }]).addRule("perfectionist/sort-array-includes", OFF).addRule("perfectionist/sort-classes", OFF).addRule("perfectionist/sort-decorators", OFF).addRule("perfectionist/sort-enums", OFF).addRule("perfectionist/sort-exports", OFF).addRule("perfectionist/sort-heritage-clauses", OFF).addRule("perfectionist/sort-imports", OFF).addRule("perfectionist/sort-interfaces", OFF).addRule("perfectionist/sort-intersection-types", OFF).addRule("perfectionist/sort-jsx-props", OFF).addRule("perfectionist/sort-maps", OFF).addRule("perfectionist/sort-modules", OFF).addRule("perfectionist/sort-named-exports", OFF).addRule("perfectionist/sort-named-imports", OFF).addRule("perfectionist/sort-object-types", OFF).addRule("perfectionist/sort-objects", OFF).addRule("perfectionist/sort-sets", OFF).addRule("perfectionist/sort-switch-case", OFF).addRule("perfectionist/sort-union-types", OFF).addRule("perfectionist/sort-variable-declarations", OFF).addOverrides();
|
|
1243
1190
|
return builder.getAllConfigs();
|
|
1244
1191
|
};
|
|
1245
1192
|
|
|
1246
1193
|
// src/configs/prefer-arrow-functions.ts
|
|
1247
1194
|
init_cjs_shims();
|
|
1248
|
-
var import_eslint_plugin_prefer_arrow_functions = __toESM(require("eslint-plugin-prefer-arrow-functions"), 1);
|
|
1249
1195
|
var preferArrowFunctionsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1250
1196
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1251
|
-
builder.addConfig(["prefer-arrow-functions", { includeDefaultFilesAndIgnores: true }],
|
|
1252
|
-
plugins: {
|
|
1253
|
-
// @ts-expect-error types mismatch
|
|
1254
|
-
"prefer-arrow-functions": import_eslint_plugin_prefer_arrow_functions.default
|
|
1255
|
-
}
|
|
1256
|
-
}).addRule("prefer-arrow-functions/prefer-arrow-functions", WARNING).addOverrides();
|
|
1197
|
+
builder.addConfig(["prefer-arrow-functions", { includeDefaultFilesAndIgnores: true }]).addRule("prefer-arrow-functions/prefer-arrow-functions", WARNING).addOverrides();
|
|
1257
1198
|
return builder.getAllConfigs();
|
|
1258
1199
|
};
|
|
1259
1200
|
|
|
@@ -1262,12 +1203,7 @@ init_cjs_shims();
|
|
|
1262
1203
|
var import_eslint_plugin_promise = __toESM(require("eslint-plugin-promise"), 1);
|
|
1263
1204
|
var promiseEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1264
1205
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1265
|
-
builder.addConfig(["promise", { includeDefaultFilesAndIgnores: true }], {
|
|
1266
|
-
plugins: {
|
|
1267
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1268
|
-
promise: import_eslint_plugin_promise.default
|
|
1269
|
-
}
|
|
1270
|
-
}).addBulkRules(import_eslint_plugin_promise.default.configs.recommended.rules).addRule("promise/always-return", ERROR, [{ ignoreLastCallback: true }]).addRule("promise/catch-or-return", ERROR, [
|
|
1206
|
+
builder.addConfig(["promise", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_promise.default.configs.recommended.rules).addRule("promise/always-return", ERROR, [{ ignoreLastCallback: true }]).addRule("promise/catch-or-return", ERROR, [
|
|
1271
1207
|
{
|
|
1272
1208
|
allowThenStrict: true,
|
|
1273
1209
|
allowFinally: true
|
|
@@ -1281,11 +1217,7 @@ init_cjs_shims();
|
|
|
1281
1217
|
var eslintPluginRegexp = __toESM(require("eslint-plugin-regexp"), 1);
|
|
1282
1218
|
var regexpEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1283
1219
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1284
|
-
builder.addConfig(["regexp", { includeDefaultFilesAndIgnores: true }], {
|
|
1285
|
-
plugins: {
|
|
1286
|
-
regexp: eslintPluginRegexp
|
|
1287
|
-
}
|
|
1288
|
-
}).addBulkRules(eslintPluginRegexp.configs["flat/recommended"].rules).addAnyRule("no-control-regex", OFF).addRule("regexp/no-control-character", ERROR).addRule("regexp/no-empty-alternative", ERROR).addRule("regexp/no-empty-character-class", ERROR, [], { overrideBaseRule: true }).addRule("regexp/no-lazy-ends", ERROR).addRule("regexp/no-potentially-useless-backreference", WARNING).addRule("regexp/no-useless-backreference", ERROR, [], { overrideBaseRule: true }).addRule("regexp/confusing-quantifier", ERROR).addRule("regexp/no-obscure-range", WARNING).addRule("regexp/no-octal", ERROR).addRule("regexp/no-standalone-backslash", ERROR).addRule("regexp/no-useless-flag", ERROR).addRule("regexp/optimal-lookaround-quantifier", ERROR).addRule("regexp/prefer-quantifier", ERROR).addAnyRule("unicorn/prefer-regexp-test", OFF).addRule("regexp/prefer-regexp-test", ERROR).addRule("regexp/require-unicode-regexp", OFF, [], { overrideBaseRule: true }).addRule("regexp/hexadecimal-escape", ERROR, ["never"]).addRule("regexp/prefer-lookaround", ERROR, [{ lookbehind: false }]).addRule("regexp/prefer-named-capture-group", OFF, [], { overrideBaseRule: true }).addRule("regexp/sort-character-class-elements", ERROR).addRule("regexp/unicode-property", ERROR).addOverrides();
|
|
1220
|
+
builder.addConfig(["regexp", { includeDefaultFilesAndIgnores: true }]).addBulkRules(eslintPluginRegexp.configs["flat/recommended"].rules).addAnyRule("no-control-regex", OFF).addRule("regexp/no-control-character", ERROR).addRule("regexp/no-empty-alternative", ERROR).addRule("regexp/no-empty-character-class", ERROR, [], { overrideBaseRule: true }).addRule("regexp/no-lazy-ends", ERROR).addRule("regexp/no-potentially-useless-backreference", WARNING).addRule("regexp/no-useless-backreference", ERROR, [], { overrideBaseRule: true }).addRule("regexp/confusing-quantifier", ERROR).addRule("regexp/no-obscure-range", WARNING).addRule("regexp/no-octal", ERROR).addRule("regexp/no-standalone-backslash", ERROR).addRule("regexp/no-useless-flag", ERROR).addRule("regexp/optimal-lookaround-quantifier", ERROR).addRule("regexp/prefer-quantifier", ERROR).addAnyRule("unicorn/prefer-regexp-test", OFF).addRule("regexp/prefer-regexp-test", ERROR).addRule("regexp/require-unicode-regexp", OFF, [], { overrideBaseRule: true }).addRule("regexp/hexadecimal-escape", ERROR, ["never"]).addRule("regexp/prefer-lookaround", ERROR, [{ lookbehind: false }]).addRule("regexp/prefer-named-capture-group", OFF, [], { overrideBaseRule: true }).addRule("regexp/sort-character-class-elements", ERROR).addRule("regexp/unicode-property", ERROR).addOverrides();
|
|
1289
1221
|
return builder.getAllConfigs();
|
|
1290
1222
|
};
|
|
1291
1223
|
|
|
@@ -1294,12 +1226,7 @@ init_cjs_shims();
|
|
|
1294
1226
|
var import_eslint_plugin_security = __toESM(require("eslint-plugin-security"), 1);
|
|
1295
1227
|
var securityEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1296
1228
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1297
|
-
builder.addConfig(["security", { includeDefaultFilesAndIgnores: true }],
|
|
1298
|
-
plugins: {
|
|
1299
|
-
// @ts-expect-error types mismatch
|
|
1300
|
-
security: import_eslint_plugin_security.default
|
|
1301
|
-
}
|
|
1302
|
-
}).addBulkRules(import_eslint_plugin_security.default.configs.recommended.rules).addRule("security/detect-bidi-characters", ERROR).addRule("security/detect-buffer-noassert", ERROR).addRule("security/detect-child-process", WARNING).addRule("security/detect-disable-mustache-escape", ERROR).addRule("security/detect-eval-with-expression", ERROR).addRule("security/detect-new-buffer", ERROR).addRule("security/detect-no-csrf-before-method-override", WARNING).addRule("security/detect-non-literal-fs-filename", OFF).addRule("security/detect-non-literal-regexp", OFF).addRule("security/detect-non-literal-require", OFF).addRule("security/detect-object-injection", OFF).addRule("security/detect-possible-timing-attacks", OFF).addRule("security/detect-pseudoRandomBytes", WARNING).addRule("security/detect-unsafe-regex", WARNING).addOverrides();
|
|
1229
|
+
builder.addConfig(["security", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_security.default.configs.recommended.rules).addRule("security/detect-bidi-characters", ERROR).addRule("security/detect-buffer-noassert", ERROR).addRule("security/detect-child-process", WARNING).addRule("security/detect-disable-mustache-escape", ERROR).addRule("security/detect-eval-with-expression", ERROR).addRule("security/detect-new-buffer", ERROR).addRule("security/detect-no-csrf-before-method-override", WARNING).addRule("security/detect-non-literal-fs-filename", OFF).addRule("security/detect-non-literal-regexp", OFF).addRule("security/detect-non-literal-require", OFF).addRule("security/detect-object-injection", OFF).addRule("security/detect-possible-timing-attacks", OFF).addRule("security/detect-pseudoRandomBytes", WARNING).addRule("security/detect-unsafe-regex", WARNING).addOverrides();
|
|
1303
1230
|
return builder.getAllConfigs();
|
|
1304
1231
|
};
|
|
1305
1232
|
|
|
@@ -1311,11 +1238,6 @@ var sonarEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1311
1238
|
const awsRulesSeverity = enableAwsRules ? ERROR : OFF;
|
|
1312
1239
|
const testsRulesSeverity = testsRules ? ERROR : OFF;
|
|
1313
1240
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1314
|
-
builder.addConfig("sonar/setup", {
|
|
1315
|
-
plugins: {
|
|
1316
|
-
sonarjs: import_eslint_plugin_sonarjs.default
|
|
1317
|
-
}
|
|
1318
|
-
});
|
|
1319
1241
|
builder.addConfig(["sonar", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_sonarjs.default.configs.recommended.rules).addRule("sonarjs/argument-type", OFF).addRule("sonarjs/array-callback-without-return", OFF).addRule("sonarjs/assertions-in-tests", testsRulesSeverity).addRule("sonarjs/aws-apigateway-public-api", awsRulesSeverity).addRule("sonarjs/aws-ec2-rds-dms-public", awsRulesSeverity).addRule("sonarjs/aws-ec2-unencrypted-ebs-volume", awsRulesSeverity).addRule("sonarjs/aws-efs-unencrypted", awsRulesSeverity).addRule("sonarjs/aws-iam-all-privileges", awsRulesSeverity).addRule("sonarjs/aws-iam-all-resources-accessible", OFF).addRule("sonarjs/aws-iam-privilege-escalation", awsRulesSeverity).addRule("sonarjs/aws-iam-public-access", awsRulesSeverity).addRule("sonarjs/aws-opensearchservice-domain", awsRulesSeverity).addRule("sonarjs/aws-rds-unencrypted-databases", awsRulesSeverity).addRule("sonarjs/aws-restricted-ip-admin-access", awsRulesSeverity).addRule("sonarjs/aws-s3-bucket-granted-access", awsRulesSeverity).addRule("sonarjs/aws-s3-bucket-insecure-http", awsRulesSeverity).addRule("sonarjs/aws-s3-bucket-public-access", awsRulesSeverity).addRule("sonarjs/aws-s3-bucket-server-encryption", OFF).addRule("sonarjs/aws-s3-bucket-versioning", awsRulesSeverity).addRule("sonarjs/aws-sagemaker-unencrypted-notebook", awsRulesSeverity).addRule("sonarjs/aws-sns-unencrypted-topics", awsRulesSeverity).addRule("sonarjs/aws-sqs-unencrypted-queue", awsRulesSeverity).addRule("sonarjs/block-scoped-var", OFF).addRule("sonarjs/call-argument-line", OFF).addRule("sonarjs/chai-determinate-assertion", testsRulesSeverity).addRule("sonarjs/class-name", OFF).addRule("sonarjs/code-eval", OFF).addRule("sonarjs/cognitive-complexity", OFF).addRule("sonarjs/concise-regex", OFF).addRule("sonarjs/conditional-indentation", OFF).addRule("sonarjs/constructor-for-side-effects", OFF).addRule("sonarjs/deprecation", OFF).addRule("sonarjs/different-types-comparison", OFF).addRule("sonarjs/disabled-timeout", testsRulesSeverity).addRule("sonarjs/duplicates-in-character-class", OFF).addRule("sonarjs/empty-string-repetition", OFF).addRule("sonarjs/fixme-tag", OFF).addRule("sonarjs/function-inside-loop", OFF).addRule("sonarjs/function-return-type", OFF).addRule("sonarjs/generator-without-yield", OFF).addRule("sonarjs/in-operator-type-error", OFF).addRule("sonarjs/inverted-assertion-arguments", testsRulesSeverity).addRule("sonarjs/label-position", OFF).addRule("sonarjs/max-switch-cases", OFF).addRule("sonarjs/misplaced-loop-counter", WARNING).addRule("sonarjs/new-operator-misuse", OFF).addRule("sonarjs/no-alphabetical-sort", OFF).addRule("sonarjs/no-array-delete", OFF).addRule("sonarjs/no-associative-arrays", OFF).addRule("sonarjs/no-async-constructor", OFF).addRule("sonarjs/no-code-after-done", testsRulesSeverity).addRule("sonarjs/no-commented-code", OFF).addRule("sonarjs/no-control-regex", OFF).addRule("sonarjs/no-dead-store", OFF).addRule("sonarjs/no-duplicate-in-composite", OFF).addRule("sonarjs/no-empty-alternatives", OFF).addRule("sonarjs/no-empty-character-class", OFF).addRule("sonarjs/no-empty-group", OFF).addRule("sonarjs/no-empty-test-file", OFF).addRule("sonarjs/no-exclusive-tests", OFF).addRule("sonarjs/no-fallthrough", OFF).addRule("sonarjs/no-for-in-iterable", ERROR).addRule("sonarjs/no-hardcoded-ip", WARNING).addRule("sonarjs/no-identical-conditions", OFF).addRule("sonarjs/no-implicit-dependencies", OFF).addRule("sonarjs/no-incomplete-assertions", testsRulesSeverity).addRule("sonarjs/no-invalid-await", OFF).addRule("sonarjs/no-invalid-regexp", OFF).addRule("sonarjs/no-labels", OFF).addRule("sonarjs/no-misleading-character-class", OFF).addRule("sonarjs/no-nested-assignment", OFF).addRule("sonarjs/no-nested-conditional", OFF).addRule("sonarjs/no-nested-functions", OFF).addRule("sonarjs/no-nested-template-literals", OFF).addRule("sonarjs/no-one-iteration-loop", OFF).addRule("sonarjs/no-primitive-wrappers", OFF).addRule("sonarjs/no-regex-spaces", OFF).addRule("sonarjs/no-same-argument-assert", testsRulesSeverity).addRule("sonarjs/no-same-line-conditional", OFF).addRule("sonarjs/no-selector-parameter", OFF).addRule("sonarjs/no-skipped-tests", OFF).addRule("sonarjs/no-try-promise", OFF).addRule("sonarjs/no-unenclosed-multiline-block", OFF).addRule("sonarjs/no-unthrown-error", OFF).addRule("sonarjs/no-unused-vars", OFF).addRule("sonarjs/no-useless-catch", OFF).addRule("sonarjs/no-useless-intersection", OFF).addRule("sonarjs/no-vue-bypass-sanitization", OFF).addRule("sonarjs/null-dereference", OFF).addRule("sonarjs/prefer-default-last", OFF).addRule("sonarjs/prefer-object-literal", ERROR).addRule("sonarjs/prefer-read-only-props", OFF).addRule("sonarjs/prefer-regexp-exec", OFF).addRule("sonarjs/prefer-single-boolean-return", WARNING).addRule("sonarjs/production-debug", ERROR).addRule("sonarjs/pseudo-random", OFF).addRule("sonarjs/redundant-type-aliases", OFF).addRule("sonarjs/regex-complexity", WARNING, [{ threshold: 40 }]).addRule("sonarjs/single-char-in-character-classes", OFF).addRule("sonarjs/single-character-alternation", OFF).addRule("sonarjs/slow-regex", OFF).addRule("sonarjs/stable-tests", testsRulesSeverity).addRule("sonarjs/strings-comparison", WARNING).addRule("sonarjs/super-invocation", OFF).addRule("sonarjs/table-header", WARNING).addRule("sonarjs/table-header-reference", WARNING).addRule("sonarjs/todo-tag", OFF).addRule("sonarjs/unused-import", OFF).addRule("sonarjs/unverified-hostname", ERROR).addRule("sonarjs/updated-const-var", OFF).addRule("sonarjs/updated-loop-counter", WARNING).addRule("sonarjs/use-type-alias", WARNING).addRule("sonarjs/void-use", OFF).addOverrides();
|
|
1320
1242
|
return builder.getAllConfigs();
|
|
1321
1243
|
};
|
|
@@ -1333,10 +1255,6 @@ var tailwindEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1333
1255
|
const { settings } = options;
|
|
1334
1256
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1335
1257
|
builder.addConfig(["tailwind", { includeDefaultFilesAndIgnores: true }], {
|
|
1336
|
-
plugins: {
|
|
1337
|
-
// @ts-expect-error types mismatch
|
|
1338
|
-
tailwindcss: import_eslint_plugin_tailwindcss.default
|
|
1339
|
-
},
|
|
1340
1258
|
...settings && {
|
|
1341
1259
|
settings: {
|
|
1342
1260
|
tailwindcss: {
|
|
@@ -1378,10 +1296,6 @@ var tomlEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1378
1296
|
}
|
|
1379
1297
|
],
|
|
1380
1298
|
{
|
|
1381
|
-
plugins: {
|
|
1382
|
-
// @ts-expect-error types mismatch
|
|
1383
|
-
toml: import_eslint_plugin_toml.default
|
|
1384
|
-
},
|
|
1385
1299
|
ignores: [
|
|
1386
1300
|
...DEFAULT_FILES_TO_IGNORE.map(
|
|
1387
1301
|
(fileToIgnore) => options.doNotIgnoreFilesByDefault?.[fileToIgnore] ? void 0 : `**/${fileToIgnore}`
|
|
@@ -1407,7 +1321,6 @@ var tomlEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1407
1321
|
|
|
1408
1322
|
// src/configs/ts.ts
|
|
1409
1323
|
init_cjs_shims();
|
|
1410
|
-
var import_eslint_plugin_no_type_assertion = __toESM(require("eslint-plugin-no-type-assertion"), 1);
|
|
1411
1324
|
var import_typescript_eslint = require("typescript-eslint");
|
|
1412
1325
|
var TS_FILES_DEFAULT = [GLOB_TS, GLOB_TSX];
|
|
1413
1326
|
var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
@@ -1460,12 +1373,6 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1460
1373
|
}
|
|
1461
1374
|
});
|
|
1462
1375
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1463
|
-
builder.addConfig("ts/setup", {
|
|
1464
|
-
plugins: {
|
|
1465
|
-
// @ts-expect-error small types mismatch
|
|
1466
|
-
"@typescript-eslint": import_typescript_eslint.plugin
|
|
1467
|
-
}
|
|
1468
|
-
});
|
|
1469
1376
|
const noUnsafeRulesSeverity = options.disableNoUnsafeRules ? OFF : WARNING;
|
|
1470
1377
|
builder.addConfig("ts/rules-regular", {
|
|
1471
1378
|
...generateBaseOptions(false),
|
|
@@ -1545,6 +1452,9 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1545
1452
|
{ disableAutofix: true }
|
|
1546
1453
|
).addRule("@typescript-eslint/no-unnecessary-type-arguments", ERROR, [], {
|
|
1547
1454
|
disableAutofix: true
|
|
1455
|
+
}).addRule("@typescript-eslint/no-unnecessary-type-assertion", ERROR, [], {
|
|
1456
|
+
disableAutofix: true
|
|
1457
|
+
// Reason: https://github.com/typescript-eslint/typescript-eslint/issues/8721
|
|
1548
1458
|
}).addRule("@typescript-eslint/no-unsafe-argument", noUnsafeRulesSeverity).addRule("@typescript-eslint/no-unsafe-assignment", noUnsafeRulesSeverity).addRule("@typescript-eslint/no-unsafe-call", noUnsafeRulesSeverity).addRule("@typescript-eslint/no-unsafe-enum-comparison", noUnsafeRulesSeverity).addRule("@typescript-eslint/no-unsafe-member-access", noUnsafeRulesSeverity).addRule("@typescript-eslint/no-unsafe-return", noUnsafeRulesSeverity).addAnyRule("no-throw-literal", OFF).addRule("@typescript-eslint/prefer-promise-reject-errors", ERROR, [], {
|
|
1549
1459
|
overrideBaseRule: true
|
|
1550
1460
|
}).addRule("@typescript-eslint/require-await", ERROR, [], { overrideBaseRule: true }).addRule("@typescript-eslint/restrict-template-expressions", ERROR, [
|
|
@@ -1574,12 +1484,7 @@ var tsEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1574
1484
|
files: ["**/*.d.?([cm])ts"]
|
|
1575
1485
|
}).addRule("@typescript-eslint/consistent-indexed-object-style", OFF).addRule("@typescript-eslint/method-signature-style", OFF).addRule("@typescript-eslint/no-empty-object-type", OFF).addRule("@typescript-eslint/no-explicit-any", OFF).addRule("@typescript-eslint/no-shadow", OFF).addRule("@typescript-eslint/no-unnecessary-type-parameters", OFF).addRule("@typescript-eslint/no-unused-vars", OFF).addRule("@typescript-eslint/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);
|
|
1576
1486
|
if (options.noTypeAssertion) {
|
|
1577
|
-
builder.addConfig("ts/no-type-assertion"
|
|
1578
|
-
plugins: {
|
|
1579
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1580
|
-
"no-type-assertion": import_eslint_plugin_no_type_assertion.default
|
|
1581
|
-
}
|
|
1582
|
-
}).addAnyRule(
|
|
1487
|
+
builder.addConfig("ts/no-type-assertion").addAnyRule(
|
|
1583
1488
|
"no-type-assertion/no-type-assertion",
|
|
1584
1489
|
options.noTypeAssertion === "warning" ? WARNING : ERROR
|
|
1585
1490
|
);
|
|
@@ -1592,7 +1497,7 @@ init_cjs_shims();
|
|
|
1592
1497
|
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
1593
1498
|
var unicornEslintConfig = (options = {}, internalOptions = {}) => {
|
|
1594
1499
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1595
|
-
builder.addConfig(["unicorn", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_unicorn.default.configs["flat/recommended"].rules).addRule("unicorn/catch-error-name", OFF).addRule("unicorn/catch-error-name", WARNING, [], { disableAutofix: true }).addRule("unicorn/consistent-existence-index-check", ERROR, [], { disableAutofix: true }).addRule("unicorn/custom-error-definition", ERROR).addRule("unicorn/explicit-length-check", ERROR, [], { disableAutofix: true }).addRule("unicorn/filename-case", OFF).addRule("unicorn/no-anonymous-default-export", OFF).addRule("unicorn/no-array-callback-reference", OFF).addRule("unicorn/no-array-for-each", OFF).addRule("unicorn/no-array-reduce", OFF).addRule("unicorn/no-await-expression-member", OFF).addRule("unicorn/no-for-loop", OFF).addRule("unicorn/no-magic-array-flat-depth", OFF).addRule("unicorn/no-negated-condition", ERROR, [], { overrideBaseRule: true }).addRule("unicorn/no-nested-ternary", OFF).addRule("unicorn/no-null", OFF).addRule("unicorn/no-process-exit", OFF).addRule("unicorn/no-unreadable-array-destructuring", OFF).addRule("unicorn/no-useless-undefined", ERROR, [{ checkArguments: false }], {
|
|
1500
|
+
builder.addConfig(["unicorn", { includeDefaultFilesAndIgnores: true }]).addBulkRules(import_eslint_plugin_unicorn.default.configs["flat/recommended"].rules).addRule("unicorn/catch-error-name", OFF).addRule("unicorn/catch-error-name", WARNING, [], { disableAutofix: true }).addRule("unicorn/consistent-assert", WARNING).addRule("unicorn/consistent-existence-index-check", ERROR, [], { disableAutofix: true }).addRule("unicorn/custom-error-definition", ERROR).addRule("unicorn/explicit-length-check", ERROR, [], { disableAutofix: true }).addRule("unicorn/filename-case", OFF).addRule("unicorn/no-anonymous-default-export", OFF).addRule("unicorn/no-array-callback-reference", OFF).addRule("unicorn/no-array-for-each", OFF).addRule("unicorn/no-array-reduce", OFF).addRule("unicorn/no-await-expression-member", OFF).addRule("unicorn/no-for-loop", OFF).addRule("unicorn/no-magic-array-flat-depth", OFF).addRule("unicorn/no-negated-condition", ERROR, [], { overrideBaseRule: true }).addRule("unicorn/no-nested-ternary", OFF).addRule("unicorn/no-null", OFF).addRule("unicorn/no-process-exit", OFF).addRule("unicorn/no-unreadable-array-destructuring", OFF).addRule("unicorn/no-useless-undefined", ERROR, [{ checkArguments: false }], {
|
|
1596
1501
|
disableAutofix: true
|
|
1597
1502
|
}).addRule("unicorn/numeric-separators-style", ERROR, [{ onlyIfContainsSeparator: true }]).addRule("unicorn/prefer-dom-node-text-content", OFF).addRule("unicorn/prefer-export-from", ERROR, [{ ignoreUsedVariables: true }]).addRule("unicorn/prefer-global-this", OFF).addRule("unicorn/prefer-module", OFF).addRule("unicorn/prefer-node-protocol", OFF).addRule("unicorn/prefer-number-properties", ERROR, [{ checkInfinity: true }]).addRule("unicorn/prefer-query-selector", OFF).addRule("unicorn/prefer-spread", ERROR, [], { disableAutofix: true }).addRule("unicorn/prefer-switch", ERROR, [
|
|
1598
1503
|
{ minimumCases: 4, emptyDefaultCase: "do-nothing-comment" }
|
|
@@ -1629,11 +1534,6 @@ var vitestEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1629
1534
|
const hasRestrictedMethods = Object.keys(restrictedMethods || {}).length > 0;
|
|
1630
1535
|
const hasRestrictedMatchers = Object.keys(restrictedMatchers || {}).length > 0;
|
|
1631
1536
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1632
|
-
builder.addConfig("vitest/setup", {
|
|
1633
|
-
plugins: {
|
|
1634
|
-
vitest: import_eslint_plugin.default
|
|
1635
|
-
}
|
|
1636
|
-
});
|
|
1637
1537
|
builder.addConfig(
|
|
1638
1538
|
[
|
|
1639
1539
|
"vitest",
|
|
@@ -1743,11 +1643,7 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1743
1643
|
const inNuxtAppDir = joinPaths.bind(null, options.nuxtOrVueProjectDir);
|
|
1744
1644
|
const nuxtLayoutsFilesGlob = inNuxtAppDir("layouts/**/*.vue");
|
|
1745
1645
|
const builder = new ConfigEntryBuilder(options, internalOptions);
|
|
1746
|
-
builder.addConfig(["vue/plugin", { doNotIgnoreMarkdown: true }]
|
|
1747
|
-
plugins: {
|
|
1748
|
-
vue: import_eslint_plugin_vue.default
|
|
1749
|
-
}
|
|
1750
|
-
});
|
|
1646
|
+
builder.addConfig(["vue/plugin", { doNotIgnoreMarkdown: true }]);
|
|
1751
1647
|
builder.addConfig(["vue/setup", { doNotIgnoreMarkdown: true }], {
|
|
1752
1648
|
files: [GLOB_VUE, ...files],
|
|
1753
1649
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
@@ -1916,10 +1812,7 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1916
1812
|
}
|
|
1917
1813
|
],
|
|
1918
1814
|
{
|
|
1919
|
-
files
|
|
1920
|
-
plugins: {
|
|
1921
|
-
"vuejs-accessibility": import_eslint_plugin_vuejs_accessibility.default
|
|
1922
|
-
}
|
|
1815
|
+
files
|
|
1923
1816
|
}
|
|
1924
1817
|
);
|
|
1925
1818
|
if (a11y) {
|
|
@@ -1932,21 +1825,13 @@ var vueEslintConfig = (options, internalOptions = {}) => {
|
|
|
1932
1825
|
internalOptions
|
|
1933
1826
|
);
|
|
1934
1827
|
if (pinia) {
|
|
1935
|
-
const piniaConfig = piniaBuilder.addConfig(
|
|
1936
|
-
|
|
1937
|
-
"pinia",
|
|
1938
|
-
{
|
|
1939
|
-
includeDefaultFilesAndIgnores: true,
|
|
1940
|
-
ignoreMarkdownCodeBlocks: true
|
|
1941
|
-
}
|
|
1942
|
-
],
|
|
1828
|
+
const piniaConfig = piniaBuilder.addConfig([
|
|
1829
|
+
"pinia",
|
|
1943
1830
|
{
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
pinia: import_eslint_plugin_pinia.default
|
|
1947
|
-
}
|
|
1831
|
+
includeDefaultFilesAndIgnores: true,
|
|
1832
|
+
ignoreMarkdownCodeBlocks: true
|
|
1948
1833
|
}
|
|
1949
|
-
);
|
|
1834
|
+
]);
|
|
1950
1835
|
piniaConfig.addBulkRules(import_eslint_plugin_pinia.default.configs["recommended-flat"].rules).addRule("pinia/prefer-single-store-per-file", ERROR).addRule("pinia/prefer-use-store-naming-convention", ERROR, [
|
|
1951
1836
|
{
|
|
1952
1837
|
checkStoreNameMismatch: true,
|
|
@@ -1975,10 +1860,6 @@ var yamlEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
1975
1860
|
}
|
|
1976
1861
|
],
|
|
1977
1862
|
{
|
|
1978
|
-
plugins: {
|
|
1979
|
-
// @ts-expect-error types mismatch
|
|
1980
|
-
yml: import_eslint_plugin_yml.default
|
|
1981
|
-
},
|
|
1982
1863
|
ignores: [
|
|
1983
1864
|
...DEFAULT_FILES_TO_IGNORE2.map(
|
|
1984
1865
|
(fileToIgnore) => options.doNotIgnoreFilesByDefault?.[fileToIgnore] ? void 0 : `**/${fileToIgnore}`
|
|
@@ -2002,6 +1883,84 @@ var yamlEslintConfig = (options = {}, internalOptions = {}) => {
|
|
|
2002
1883
|
return builder.getAllConfigs();
|
|
2003
1884
|
};
|
|
2004
1885
|
|
|
1886
|
+
// src/plugins.ts
|
|
1887
|
+
init_cjs_shims();
|
|
1888
|
+
var import_markdown2 = __toESM(require("@eslint/markdown"), 1);
|
|
1889
|
+
var import_eslint_plugin_eslint_comments2 = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
|
|
1890
|
+
var import_eslint_plugin2 = __toESM(require("@stylistic/eslint-plugin"), 1);
|
|
1891
|
+
var import_eslint_plugin3 = __toESM(require("@vitest/eslint-plugin"), 1);
|
|
1892
|
+
var import_eslint_plugin_css = __toESM(require("eslint-plugin-css"), 1);
|
|
1893
|
+
var import_eslint_plugin_de_morgan = __toESM(require("eslint-plugin-de-morgan"), 1);
|
|
1894
|
+
var import_eslint_plugin_import_x2 = __toESM(require("eslint-plugin-import-x"), 1);
|
|
1895
|
+
var import_eslint_plugin_jest2 = __toESM(require("eslint-plugin-jest"), 1);
|
|
1896
|
+
var import_eslint_plugin_jest_extended2 = __toESM(require("eslint-plugin-jest-extended"), 1);
|
|
1897
|
+
var import_eslint_plugin_jsdoc2 = __toESM(require("eslint-plugin-jsdoc"), 1);
|
|
1898
|
+
var import_eslint_plugin_jsonc2 = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
1899
|
+
var import_eslint_plugin_n2 = __toESM(require("eslint-plugin-n"), 1);
|
|
1900
|
+
var import_eslint_plugin_no_type_assertion = __toESM(require("eslint-plugin-no-type-assertion"), 1);
|
|
1901
|
+
var import_eslint_plugin_package_json = __toESM(require("eslint-plugin-package-json"), 1);
|
|
1902
|
+
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
1903
|
+
var import_eslint_plugin_pinia2 = __toESM(require("eslint-plugin-pinia"), 1);
|
|
1904
|
+
var import_eslint_plugin_prefer_arrow_functions = __toESM(require("eslint-plugin-prefer-arrow-functions"), 1);
|
|
1905
|
+
var import_eslint_plugin_promise2 = __toESM(require("eslint-plugin-promise"), 1);
|
|
1906
|
+
var eslintPluginRegexp2 = __toESM(require("eslint-plugin-regexp"), 1);
|
|
1907
|
+
var import_eslint_plugin_security2 = __toESM(require("eslint-plugin-security"), 1);
|
|
1908
|
+
var import_eslint_plugin_sonarjs2 = __toESM(require("eslint-plugin-sonarjs"), 1);
|
|
1909
|
+
var import_eslint_plugin_tailwindcss2 = __toESM(require("eslint-plugin-tailwindcss"), 1);
|
|
1910
|
+
var import_eslint_plugin_toml2 = __toESM(require("eslint-plugin-toml"), 1);
|
|
1911
|
+
var import_eslint_plugin_unicorn2 = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
1912
|
+
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
1913
|
+
var import_eslint_plugin_vue2 = __toESM(require("eslint-plugin-vue"), 1);
|
|
1914
|
+
var import_eslint_plugin_vuejs_accessibility2 = __toESM(require("eslint-plugin-vuejs-accessibility"), 1);
|
|
1915
|
+
var import_eslint_plugin_yml2 = __toESM(require("eslint-plugin-yml"), 1);
|
|
1916
|
+
var import_typescript_eslint2 = require("typescript-eslint");
|
|
1917
|
+
var ALL_ESLINT_PLUGINS = {
|
|
1918
|
+
unicorn: import_eslint_plugin_unicorn2.default,
|
|
1919
|
+
"@stylistic": import_eslint_plugin2.default,
|
|
1920
|
+
// @ts-expect-error types mismatch
|
|
1921
|
+
"@typescript-eslint": import_typescript_eslint2.plugin,
|
|
1922
|
+
// @ts-expect-error types mismatch
|
|
1923
|
+
"css-in-js": import_eslint_plugin_css.default,
|
|
1924
|
+
"@eslint-community/eslint-comments": import_eslint_plugin_eslint_comments2.default,
|
|
1925
|
+
// No typings
|
|
1926
|
+
// @ts-expect-error types mismatch
|
|
1927
|
+
import: import_eslint_plugin_import_x2.default,
|
|
1928
|
+
jest: import_eslint_plugin_jest2.default,
|
|
1929
|
+
"jest-extended": import_eslint_plugin_jest_extended2.default,
|
|
1930
|
+
// No typings
|
|
1931
|
+
"unused-imports": import_eslint_plugin_unused_imports.default,
|
|
1932
|
+
jsdoc: import_eslint_plugin_jsdoc2.default,
|
|
1933
|
+
// @ts-expect-error types mismatch
|
|
1934
|
+
jsonc: import_eslint_plugin_jsonc2.default,
|
|
1935
|
+
markdown: import_markdown2.default,
|
|
1936
|
+
node: import_eslint_plugin_n2.default,
|
|
1937
|
+
// @ts-expect-error types mismatch
|
|
1938
|
+
"package-json": import_eslint_plugin_package_json.default,
|
|
1939
|
+
perfectionist: import_eslint_plugin_perfectionist.default,
|
|
1940
|
+
// @ts-expect-error types mismatch
|
|
1941
|
+
"prefer-arrow-functions": import_eslint_plugin_prefer_arrow_functions.default,
|
|
1942
|
+
promise: import_eslint_plugin_promise2.default,
|
|
1943
|
+
// No typings
|
|
1944
|
+
regexp: eslintPluginRegexp2,
|
|
1945
|
+
// @ts-expect-error types mismatch
|
|
1946
|
+
security: import_eslint_plugin_security2.default,
|
|
1947
|
+
sonarjs: import_eslint_plugin_sonarjs2.default,
|
|
1948
|
+
// @ts-expect-error types mismatch
|
|
1949
|
+
tailwindcss: import_eslint_plugin_tailwindcss2.default,
|
|
1950
|
+
// @ts-expect-error types mismatch
|
|
1951
|
+
toml: import_eslint_plugin_toml2.default,
|
|
1952
|
+
"no-type-assertion": import_eslint_plugin_no_type_assertion.default,
|
|
1953
|
+
// No typings
|
|
1954
|
+
vitest: import_eslint_plugin3.default,
|
|
1955
|
+
vue: import_eslint_plugin_vue2.default,
|
|
1956
|
+
"vuejs-accessibility": import_eslint_plugin_vuejs_accessibility2.default,
|
|
1957
|
+
// @ts-expect-error types mismatch
|
|
1958
|
+
pinia: import_eslint_plugin_pinia2.default,
|
|
1959
|
+
// @ts-expect-error types mismatch
|
|
1960
|
+
yml: import_eslint_plugin_yml2.default,
|
|
1961
|
+
"de-morgan": import_eslint_plugin_de_morgan.default
|
|
1962
|
+
};
|
|
1963
|
+
|
|
2005
1964
|
// src/index.ts
|
|
2006
1965
|
var import_is_in_editor = require("is-in-editor");
|
|
2007
1966
|
var RULES_NOT_TO_DISABLE_IN_CONFIG_PRETTIER = /* @__PURE__ */ new Set([
|
|
@@ -2123,6 +2082,10 @@ var eslintConfig = (options = {}) => {
|
|
|
2123
2082
|
const perfectionistOptions = {
|
|
2124
2083
|
...assignOptions(configsOptions, "perfectionist")
|
|
2125
2084
|
};
|
|
2085
|
+
const isDeMorganEnabled = Boolean(configsOptions.deMorgan ?? false);
|
|
2086
|
+
const deMorganOptions = {
|
|
2087
|
+
...assignOptions(configsOptions, "deMorgan")
|
|
2088
|
+
};
|
|
2126
2089
|
const isCliEnabled = Boolean(configsOptions.cli ?? true);
|
|
2127
2090
|
const cliOptions = {
|
|
2128
2091
|
...assignOptions(configsOptions, "cli")
|
|
@@ -2142,14 +2105,22 @@ var eslintConfig = (options = {}) => {
|
|
|
2142
2105
|
name: genFlatConfigEntryName("ignores-gitignore")
|
|
2143
2106
|
},
|
|
2144
2107
|
{
|
|
2145
|
-
name: genFlatConfigEntryName("global-setup"),
|
|
2108
|
+
name: genFlatConfigEntryName("global-setup/plugins"),
|
|
2146
2109
|
plugins: {
|
|
2147
|
-
|
|
2148
|
-
"disable-autofix":
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2110
|
+
...ALL_ESLINT_PLUGINS,
|
|
2111
|
+
"disable-autofix": {
|
|
2112
|
+
meta: {
|
|
2113
|
+
name: "eslint-plugin-disable-autofix"
|
|
2114
|
+
},
|
|
2115
|
+
rules: Object.entries(ALL_ESLINT_PLUGINS).reduce(
|
|
2116
|
+
(res, [pluginNamespace, plugin]) => Object.assign(res, disableAutofixForAllRulesInPlugin(pluginNamespace, plugin)),
|
|
2117
|
+
{}
|
|
2118
|
+
)
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
},
|
|
2122
|
+
{
|
|
2123
|
+
name: genFlatConfigEntryName("global-setup/language-options"),
|
|
2153
2124
|
languageOptions: {
|
|
2154
2125
|
ecmaVersion: "latest",
|
|
2155
2126
|
sourceType: "module",
|
|
@@ -2185,6 +2156,7 @@ var eslintConfig = (options = {}) => {
|
|
|
2185
2156
|
isJsoncEnabled && jsoncEslintConfig(jsoncOptions, internalOptions),
|
|
2186
2157
|
isPackageJsonEnabled && packageJsonEslintConfig(packageJsonOptions, internalOptions),
|
|
2187
2158
|
isPerfectionistEnabled && perfectionistEslintConfig(perfectionistOptions, internalOptions),
|
|
2159
|
+
isDeMorganEnabled && deMorganEslintConfig(deMorganOptions, internalOptions),
|
|
2188
2160
|
isTypescriptEnabled && tsEslintConfig(tsOptions, internalOptions),
|
|
2189
2161
|
// Must come after all rulesets for vanilla JS
|
|
2190
2162
|
isVueEnabled && vueEslintConfig(vueOptions, internalOptions),
|