@w5s/eslint-config 3.36.0 → 4.0.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/dist/index.js CHANGED
@@ -6,28 +6,34 @@ import { eslintIgnores } from "@w5s/eslint-config-ignore";
6
6
  import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
7
7
  import tsPlugin from "@typescript-eslint/eslint-plugin";
8
8
  //#region src/glob.ts
9
- const sourceGlob = `**/${Project.extensionsToGlob(Project.sourceExtensions())}`;
10
- const esSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(["javascript", "javascriptreact"]))}`;
11
- const jsxSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(["javascriptreact", "typescriptreact"]))}`;
12
- const jsonSourceGlob = `**/${Project.extensionsToGlob([
13
- ".json",
14
- ".json5",
15
- ".jsonc"
16
- ])}`;
17
- const tsSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(["typescript", "typescriptreact"]))}`;
18
- const ymlSourceGlob = `**/${Project.extensionsToGlob(Project.queryExtensions(["yaml"]))}`;
19
- //#endregion
20
- //#region src/internal/withDefaultFiles.ts
21
- /**
22
- * withDefaultFiles
23
- *
24
- * @param options The options to process.
25
- * @param defaultFiles The default files to apply.
26
- * @returns An array of strings representing the combined files.
27
- */
28
- function withDefaultFiles(options, defaultFiles) {
29
- return typeof options === "function" ? options(defaultFiles) : [...options == null ? [] : options.flat(), ...defaultFiles];
30
- }
9
+ const sourceGlob = Project.glob({
10
+ fileExtensions: [Project.sourceExtensions()],
11
+ nested: true
12
+ });
13
+ const esSourceGlob = Project.glob({
14
+ fileExtensions: [Project.queryExtensions(["javascript", "javascriptreact"])],
15
+ nested: true
16
+ });
17
+ const jsxSourceGlob = Project.glob({
18
+ fileExtensions: [Project.queryExtensions(["javascriptreact", "typescriptreact"])],
19
+ nested: true
20
+ });
21
+ const jsonSourceGlob = Project.glob({
22
+ fileExtensions: [[
23
+ ".json",
24
+ ".json5",
25
+ ".jsonc"
26
+ ]],
27
+ nested: true
28
+ });
29
+ const tsSourceGlob = Project.glob({
30
+ fileExtensions: [Project.queryExtensions(["typescript", "typescriptreact"])],
31
+ nested: true
32
+ });
33
+ const ymlSourceGlob = Project.glob({
34
+ fileExtensions: [Project.queryExtensions(["yaml"])],
35
+ nested: true
36
+ });
31
37
  //#endregion
32
38
  //#region src/type/StylisticConfig.ts
33
39
  const defaultConfig = {
@@ -61,6 +67,33 @@ const StylisticConfig = {
61
67
  }
62
68
  };
63
69
  //#endregion
70
+ //#region src/internal/defaultOptions.ts
71
+ /**
72
+ * Return a new plugin option object with default values
73
+ *
74
+ * @param options
75
+ */
76
+ function defaultPluginOptions(options) {
77
+ return {
78
+ ...options,
79
+ namespace: options.namespace ?? "w5s",
80
+ recommended: options.recommended ?? true,
81
+ stylistic: StylisticConfig.from(options.stylistic ?? true)
82
+ };
83
+ }
84
+ //#endregion
85
+ //#region src/internal/withDefaultFiles.ts
86
+ /**
87
+ * withDefaultFiles
88
+ *
89
+ * @param options The options to process.
90
+ * @param defaultFiles The default files to apply.
91
+ * @returns An array of strings representing the combined files.
92
+ */
93
+ function withDefaultFiles(options, defaultFiles) {
94
+ return typeof options === "function" ? options(defaultFiles) : [...options == null ? [] : options.flat(), ...defaultFiles];
95
+ }
96
+ //#endregion
64
97
  //#region src/config/e18e.ts
65
98
  const defaultFiles$11 = [sourceGlob];
66
99
  /**
@@ -69,14 +102,13 @@ const defaultFiles$11 = [sourceGlob];
69
102
  */
70
103
  async function e18e(options = {}) {
71
104
  const [e18ePlugin] = await Promise.all([interopDefault(import("@e18e/eslint-plugin"))]);
72
- const { files, modernization = true, moduleReplacements = false, performanceImprovements = true, rules = {}, stylistic = true } = options;
73
- const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
105
+ const { files, modernization = true, moduleReplacements = false, namespace, performanceImprovements = true, rules = {}, stylistic } = defaultPluginOptions(options);
74
106
  return [{
75
- name: "w5s/e18e/setup",
107
+ name: `${namespace}/e18e/setup`,
76
108
  plugins: { e18e: e18ePlugin }
77
109
  }, {
78
110
  files: withDefaultFiles(files, defaultFiles$11),
79
- name: "w5s/e18e/rules",
111
+ name: `${namespace}/e18e/rules`,
80
112
  rules: {
81
113
  ...modernization ? e18ePlugin.configs.modernization.rules : {},
82
114
  ...moduleReplacements ? e18ePlugin.configs.moduleReplacements.rules : {},
@@ -87,7 +119,7 @@ async function e18e(options = {}) {
87
119
  "e18e/prefer-array-to-sorted": "off",
88
120
  "e18e/prefer-array-to-spliced": "off",
89
121
  "e18e/prefer-spread-syntax": "off",
90
- ...stylisticEnabled ? {} : {},
122
+ ...stylistic.enabled ? {} : {},
91
123
  ...rules
92
124
  }
93
125
  }];
@@ -515,7 +547,7 @@ const esRules = lazy(() => ({
515
547
  //#region src/config/es.ts
516
548
  const defaultFiles$10 = [esSourceGlob];
517
549
  async function es(options) {
518
- const { defaultRestrictedGlobals = restrictedGlobals, defaultRestrictedImportPaths = restrictedImportPaths, defaultRestrictedSyntax = restrictedSyntax, recommended = true, restrictedImportPaths: paths, rules = {} } = options;
550
+ const { defaultRestrictedGlobals = restrictedGlobals, defaultRestrictedImportPaths = restrictedImportPaths, defaultRestrictedSyntax = restrictedSyntax, namespace, recommended, restrictedImportPaths: paths, rules = {} } = defaultPluginOptions(options);
519
551
  const resolvedGlobals = typeof options.restrictedGlobals === "function" ? options.restrictedGlobals(defaultRestrictedGlobals) : options.restrictedGlobals ?? defaultRestrictedGlobals;
520
552
  const resolvedPaths = typeof paths === "function" ? paths(defaultRestrictedImportPaths) : paths ?? defaultRestrictedImportPaths;
521
553
  const resolvedSyntax = typeof options.restrictedSyntax === "function" ? options.restrictedSyntax(defaultRestrictedSyntax) : options.restrictedSyntax ?? defaultRestrictedSyntax;
@@ -542,11 +574,11 @@ async function es(options) {
542
574
  sourceType: "module"
543
575
  },
544
576
  linterOptions: { reportUnusedDisableDirectives: true },
545
- name: "w5s/es/setup"
577
+ name: `${namespace}/es/setup`
546
578
  },
547
579
  {
548
580
  files: [sourceGlob],
549
- name: "w5s/source/restricted-rules",
581
+ name: `${namespace}/source/restricted-rules`,
550
582
  rules: {
551
583
  "no-restricted-globals": ["error", ...resolvedGlobals],
552
584
  "no-restricted-imports": ["error", { paths: resolvedPaths }],
@@ -555,7 +587,7 @@ async function es(options) {
555
587
  },
556
588
  {
557
589
  files: defaultFiles$10,
558
- name: "w5s/es/rules",
590
+ name: `${namespace}/es/rules`,
559
591
  rules: {
560
592
  ...recommended ? es.recommended : {},
561
593
  ...rules
@@ -578,17 +610,16 @@ async function ignores(options = {}) {
578
610
  //#endregion
579
611
  //#region src/config/imports.ts
580
612
  async function imports(options = {}) {
581
- const { recommended = true, rules = {}, stylistic = true } = options;
582
- const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
613
+ const { namespace, recommended, rules = {}, stylistic } = defaultPluginOptions(options);
583
614
  const [importPlugin] = await Promise.all([interopDefault(import("eslint-plugin-import"))]);
584
615
  return [{
585
- name: "w5s/import/setup",
616
+ name: `${namespace}/import/setup`,
586
617
  plugins: { import: importPlugin }
587
618
  }, {
588
- name: "w5s/import/rules",
619
+ name: `${namespace}/import/rules`,
589
620
  rules: {
590
621
  ...recommended ? imports.recommended : {},
591
- ...stylisticEnabled ? imports.stylistic : {},
622
+ ...stylistic.enabled ? imports.stylistic : {},
592
623
  ...rules
593
624
  }
594
625
  }];
@@ -612,10 +643,9 @@ const defaultJsFiles = [esSourceGlob];
612
643
  const defaultTsFiles = [tsSourceGlob];
613
644
  async function jsdoc(options = {}) {
614
645
  const [jsdocPlugin] = await Promise.all([interopDefault(import("eslint-plugin-jsdoc"))]);
615
- const { files, recommended = true, rules = {}, stylistic = true } = options;
616
- const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
646
+ const { files, namespace, recommended, rules = {}, stylistic } = defaultPluginOptions(options);
617
647
  const recommendedRules = recommended ? jsdocPlugin.configs["flat/recommended-typescript-flavor"].rules : {};
618
- const stylisticRules = stylisticEnabled ? {
648
+ const stylisticRules = stylistic.enabled ? {
619
649
  ...jsdocPlugin.configs["flat/stylistic-typescript-flavor"].rules,
620
650
  "jsdoc/check-alignment": "warn",
621
651
  "jsdoc/multiline-blocks": "warn",
@@ -627,12 +657,12 @@ async function jsdoc(options = {}) {
627
657
  } : {};
628
658
  return [
629
659
  {
630
- name: "w5s/jsdoc/setup",
660
+ name: `${namespace}/jsdoc/setup`,
631
661
  plugins: { jsdoc: jsdocPlugin }
632
662
  },
633
663
  {
634
664
  files: withDefaultFiles(files, defaultJsFiles),
635
- name: "w5s/jsdoc/rules-js",
665
+ name: `${namespace}/jsdoc/rules-js`,
636
666
  rules: {
637
667
  ...recommendedRules,
638
668
  ...recommended ? {
@@ -652,7 +682,7 @@ async function jsdoc(options = {}) {
652
682
  },
653
683
  {
654
684
  files: withDefaultFiles(files, defaultTsFiles),
655
- name: "w5s/jsdoc/rules-ts",
685
+ name: `${namespace}/jsdoc/rules-ts`,
656
686
  rules: {
657
687
  ...recommendedRules,
658
688
  ...recommended ? {
@@ -678,24 +708,23 @@ async function jsdoc(options = {}) {
678
708
  const defaultFiles$9 = [jsonSourceGlob];
679
709
  async function jsonc(options = {}) {
680
710
  const [jsoncPlugin, jsoncParser] = await Promise.all([interopDefault(import("eslint-plugin-jsonc")), interopDefault(import("jsonc-eslint-parser"))]);
681
- const { files, recommended = true, rules = {}, stylistic = true } = options;
682
- const { enabled: stylisticEnabled, indent } = StylisticConfig.from(stylistic);
711
+ const { files, namespace, recommended, rules = {}, stylistic } = defaultPluginOptions(options);
683
712
  return [
684
713
  {
685
- name: "w5s/jsonc/setup",
714
+ name: `${namespace}/jsonc/setup`,
686
715
  plugins: { jsonc: jsoncPlugin }
687
716
  },
688
717
  {
689
718
  files: withDefaultFiles(files, defaultFiles$9),
690
719
  languageOptions: { parser: jsoncParser },
691
- name: "w5s/jsonc/rules",
720
+ name: `${namespace}/jsonc/rules`,
692
721
  rules: {
693
722
  ...recommended ? jsoncPlugin.configs["flat/recommended-with-json"][0]?.rules : {},
694
- ...stylisticEnabled ? {
723
+ ...stylistic.enabled ? {
695
724
  "jsonc/array-bracket-spacing": ["error", "never"],
696
725
  "jsonc/comma-dangle": ["error", "never"],
697
726
  "jsonc/comma-style": ["error", "last"],
698
- "jsonc/indent": ["error", indent],
727
+ "jsonc/indent": ["error", stylistic.indent],
699
728
  "jsonc/key-spacing": ["error", {
700
729
  afterColon: true,
701
730
  beforeColon: false
@@ -712,8 +741,8 @@ async function jsonc(options = {}) {
712
741
  ...rules
713
742
  }
714
743
  },
715
- stylisticEnabled ? sortPackageJson() : {},
716
- stylisticEnabled ? sortTsconfigJson() : {}
744
+ stylistic.enabled ? sortPackageJson() : {},
745
+ stylistic.enabled ? sortTsconfigJson() : {}
717
746
  ];
718
747
  }
719
748
  function sortPackageJson() {
@@ -776,7 +805,6 @@ function sortPackageJson() {
776
805
  "simple-git-hooks",
777
806
  "pre-commit",
778
807
  "commitlint",
779
- "lint-staged",
780
808
  "config",
781
809
  "nodemonConfig",
782
810
  "browserify",
@@ -916,18 +944,18 @@ function sortTsconfigJson() {
916
944
  //#region src/config/jsx.ts
917
945
  const defaultFiles$8 = [jsxSourceGlob];
918
946
  async function jsx(options = {}) {
919
- const { files, jsxA11y = false, recommended = true, rules = {} } = options;
947
+ const { files, jsxA11y = false, namespace, recommended, rules = {} } = defaultPluginOptions(options);
920
948
  const [jsxA11yPlugin] = await Promise.all([jsxA11y ? interopDefault(import("eslint-plugin-jsx-a11y")) : void 0]);
921
949
  return [{
922
950
  languageOptions: {
923
951
  parserOptions: { ecmaFeatures: { jsx: true } },
924
952
  sourceType: "module"
925
953
  },
926
- name: "w5s/jsx/setup",
954
+ name: `${namespace}/jsx/setup`,
927
955
  plugins: { ...jsxA11yPlugin ? { "jsx-a11y": jsxA11yPlugin } : {} }
928
956
  }, {
929
957
  files: withDefaultFiles(files, defaultFiles$8),
930
- name: "w5s/jsx/rules",
958
+ name: `${namespace}/jsx/rules`,
931
959
  rules: {
932
960
  ...recommended && jsxA11yPlugin != null ? jsxA11yPlugin.configs.recommended.rules : {},
933
961
  ...rules
@@ -957,15 +985,17 @@ const looseRules = lazy(() => {
957
985
  });
958
986
  //#endregion
959
987
  //#region src/config/markdown.ts
960
- const defaultFiles$7 = [`**/${Project.extensionsToGlob(Project.queryExtensions(["markdown"]))}`];
988
+ const defaultFiles$7 = [Project.glob({
989
+ fileExtensions: [Project.queryExtensions(["markdown"])],
990
+ nested: true
991
+ })];
961
992
  async function markdown(options = {}) {
962
993
  const [markdownPlugin] = await Promise.all([interopDefault(import("@eslint/markdown"))]);
963
- const { files, language = "markdown/gfm", languageOptions, recommended = true, rules = {}, stylistic = true } = options;
964
- const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
994
+ const { files, language = "markdown/gfm", languageOptions, namespace, recommended, rules = {}, stylistic } = defaultPluginOptions(options);
965
995
  const resolvedFiles = withDefaultFiles(files, defaultFiles$7);
966
996
  return [
967
997
  {
968
- name: "w5s/markdown/setup",
998
+ name: `${namespace}/markdown/setup`,
969
999
  plugins: { markdown: markdownPlugin }
970
1000
  },
971
1001
  {
@@ -975,11 +1005,11 @@ async function markdown(options = {}) {
975
1005
  frontmatter: "yaml",
976
1006
  ...languageOptions
977
1007
  },
978
- name: "w5s/markdown/rules",
1008
+ name: `${namespace}/markdown/rules`,
979
1009
  processor: mergeProcessors([markdownPlugin.processors.markdown, processorPassThrough]),
980
1010
  rules: {
981
1011
  ...recommended ? markdownPlugin.configs.recommended.at(0)?.rules : {},
982
- ...stylisticEnabled ? {} : {},
1012
+ ...stylistic.enabled ? {} : {},
983
1013
  ...rules
984
1014
  }
985
1015
  },
@@ -989,7 +1019,7 @@ async function markdown(options = {}) {
989
1019
  project: false,
990
1020
  projectService: false
991
1021
  } },
992
- name: "w5s/markdown/embed-code",
1022
+ name: `${namespace}/markdown/embed-code`,
993
1023
  rules: {
994
1024
  ...looseRules(),
995
1025
  "no-alert": "off",
@@ -1020,7 +1050,7 @@ async function markdown(options = {}) {
1020
1050
  const defaultFiles$6 = [sourceGlob];
1021
1051
  async function next(options = {}) {
1022
1052
  const [nextPlugin] = await Promise.all([interopDefault(import("@next/eslint-plugin-next"))]);
1023
- const { files, recommended = true, rules = {} } = options;
1053
+ const { files, recommended, rules = {} } = options;
1024
1054
  return [{
1025
1055
  name: "w5s/next/setup",
1026
1056
  plugins: { next: nextPlugin }
@@ -1070,17 +1100,16 @@ async function node(options = {}) {
1070
1100
  const defaultFiles$5 = [sourceGlob];
1071
1101
  async function perfectionist(options = {}) {
1072
1102
  const [perfectionistPlugin] = await Promise.all([interopDefault(import("eslint-plugin-perfectionist"))]);
1073
- const { files, recommended = true, rules = {}, stylistic = true } = options;
1074
- const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
1103
+ const { files, namespace, recommended, rules = {}, stylistic } = defaultPluginOptions(options);
1075
1104
  return [{
1076
- name: "w5s/perfectionist/setup",
1105
+ name: `${namespace}/perfectionist/setup`,
1077
1106
  plugins: { perfectionist: perfectionistPlugin }
1078
1107
  }, {
1079
1108
  files: withDefaultFiles(files, defaultFiles$5),
1080
- name: "w5s/perfectionist/rules",
1109
+ name: `${namespace}/perfectionist/rules`,
1081
1110
  rules: {
1082
1111
  ...recommended ? perfectionistPlugin.configs["recommended-natural"].rules : {},
1083
- ...stylisticEnabled ? {} : {},
1112
+ ...stylistic.enabled ? {} : {},
1084
1113
  ...rules
1085
1114
  }
1086
1115
  }];
@@ -1090,9 +1119,9 @@ async function perfectionist(options = {}) {
1090
1119
  const defaultFiles$4 = [sourceGlob];
1091
1120
  async function react(options = {}) {
1092
1121
  const [reactPlugin] = await Promise.all([interopDefault(import("@eslint-react/eslint-plugin"))]);
1093
- const { files, recommended = true, rules = {} } = options;
1122
+ const { files, namespace, recommended, rules = {} } = defaultPluginOptions(options);
1094
1123
  return [{
1095
- name: "w5s/react/setup",
1124
+ name: `${namespace}/react/setup`,
1096
1125
  plugins: { react: reactPlugin }
1097
1126
  }, {
1098
1127
  files: withDefaultFiles(files, defaultFiles$4),
@@ -1100,7 +1129,7 @@ async function react(options = {}) {
1100
1129
  parserOptions: { ecmaFeatures: { jsx: true } },
1101
1130
  sourceType: "module"
1102
1131
  },
1103
- name: "w5s/react/rules",
1132
+ name: `${namespace}/react/rules`,
1104
1133
  rules: {
1105
1134
  ...recommended ? ESLintConfig.renameRules(reactPlugin.configs.recommended.rules, { "@eslint-react": "react" }) : {},
1106
1135
  ...rules
@@ -1159,14 +1188,13 @@ async function stylistic(options = {}) {
1159
1188
  const defaultFiles$3 = Project.extensionsToTestGlob(Project.sourceExtensions());
1160
1189
  async function test(options = {}) {
1161
1190
  const [vitestPlugin] = await Promise.all([interopDefault(import("@vitest/eslint-plugin"))]);
1162
- const { files, recommended = true, rules = {}, stylistic = true } = options;
1163
- const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
1191
+ const { files, namespace, recommended, rules = {}, stylistic } = defaultPluginOptions(options);
1164
1192
  return [{
1165
- name: "w5s/test/setup",
1193
+ name: `${namespace}/test/setup`,
1166
1194
  plugins: { test: vitestPlugin }
1167
1195
  }, {
1168
1196
  files: withDefaultFiles(files, defaultFiles$3),
1169
- name: "w5s/test/rules",
1197
+ name: `${namespace}/test/rules`,
1170
1198
  rules: {
1171
1199
  ...recommended ? {
1172
1200
  ...ESLintConfig.renameRules(vitestPlugin.configs.recommended.rules, { vitest: "test" }),
@@ -1174,7 +1202,7 @@ async function test(options = {}) {
1174
1202
  "test/expect-expect": ["error", { assertFunctionNames: ["expect*", "assert*"] }],
1175
1203
  "test/valid-title": ESLintConfig.fixme(void 0)
1176
1204
  } : {},
1177
- ...stylisticEnabled ? {} : {},
1205
+ ...stylistic.enabled ? {} : {},
1178
1206
  ...rules
1179
1207
  }
1180
1208
  }];
@@ -1226,12 +1254,11 @@ const tsRenameMap = { "@typescript-eslint": "ts" };
1226
1254
  const defaultFiles$2 = [tsSourceGlob];
1227
1255
  async function ts(options = {}) {
1228
1256
  const [tsPlugin, tsParser] = await Promise.all([interopDefault(import("@typescript-eslint/eslint-plugin")), interopDefault(import("@typescript-eslint/parser"))]);
1229
- const { files, parserOptions = {}, recommended = true, rules = {}, stylistic = true, tsconfigPath = "./tsconfig.json", typeChecked = true } = options;
1230
- const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
1257
+ const { files, namespace, parserOptions = {}, recommended, rules = {}, stylistic, tsconfigPath = "./tsconfig.json", typeChecked = true } = defaultPluginOptions(options);
1231
1258
  const tsCustomRules = tsRules();
1232
1259
  const resolvedFiles = withDefaultFiles(files, defaultFiles$2);
1233
1260
  return [{
1234
- name: "w5s/ts/setup",
1261
+ name: `${namespace}/ts/setup`,
1235
1262
  plugins: { ts: tsPlugin }
1236
1263
  }, {
1237
1264
  files: resolvedFiles,
@@ -1249,13 +1276,13 @@ async function ts(options = {}) {
1249
1276
  ...parserOptions
1250
1277
  }
1251
1278
  },
1252
- name: "w5s/ts/rules",
1279
+ name: `${namespace}/ts/rules`,
1253
1280
  rules: {
1254
1281
  ...recommended ? ESLintConfig.renameRules(tsPlugin.configs["eslint-recommended"].overrides[0].rules, tsRenameMap) : {},
1255
1282
  ...recommended ? ESLintConfig.renameRules(tsPlugin.configs["strict"].rules, tsRenameMap) : {},
1256
1283
  ...recommended && typeChecked ? ESLintConfig.renameRules(tsPlugin.configs["recommended-type-checked-only"].rules, tsRenameMap) : {},
1257
1284
  ...recommended ? tsCustomRules : {},
1258
- ...stylisticEnabled ? {
1285
+ ...stylistic.enabled ? {
1259
1286
  ...ESLintConfig.renameRules(tsPlugin.configs["stylistic"]?.rules, tsRenameMap),
1260
1287
  ...typeChecked ? ESLintConfig.renameRules(tsPlugin.configs["stylistic-type-checked-only"].rules, tsRenameMap) : {},
1261
1288
  "ts/array-type": ["error", { default: "generic" }],
@@ -1291,16 +1318,15 @@ async function ts(options = {}) {
1291
1318
  const defaultFiles$1 = [sourceGlob];
1292
1319
  async function unicorn(options = {}) {
1293
1320
  const [unicornPlugin] = await Promise.all([interopDefault(import("eslint-plugin-unicorn"))]);
1294
- const { files, recommended = true, rules = {}, stylistic = true } = options;
1295
- const { enabled: stylisticEnabled } = StylisticConfig.from(stylistic);
1321
+ const { files, namespace, recommended, rules = {}, stylistic } = defaultPluginOptions(options);
1296
1322
  return [
1297
1323
  {
1298
- name: "w5s/unicorn/setup",
1324
+ name: `${namespace}/unicorn/setup`,
1299
1325
  plugins: { unicorn: unicornPlugin }
1300
1326
  },
1301
1327
  {
1302
1328
  files: withDefaultFiles(files, defaultFiles$1),
1303
- name: "w5s/unicorn/rules",
1329
+ name: `${namespace}/unicorn/rules`,
1304
1330
  rules: {
1305
1331
  ...recommended && unicornPlugin.configs.unopinionated.rules,
1306
1332
  "unicorn/new-for-builtins": "off",
@@ -1314,13 +1340,13 @@ async function unicorn(options = {}) {
1314
1340
  "unicorn/prefer-default-parameters": "off",
1315
1341
  "unicorn/prefer-set-has": "off",
1316
1342
  "unicorn/throw-new-error": "off",
1317
- ...stylisticEnabled ? {} : {},
1343
+ ...stylistic.enabled ? {} : {},
1318
1344
  ...rules
1319
1345
  }
1320
1346
  },
1321
1347
  {
1322
1348
  files: ["**/*.config.cjs", "**/*.config.js"],
1323
- name: "w5s/unicorn/overrides",
1349
+ name: `${namespace}/unicorn/overrides`,
1324
1350
  rules: { "unicorn/prefer-module": "off" }
1325
1351
  }
1326
1352
  ];
@@ -1329,7 +1355,7 @@ async function unicorn(options = {}) {
1329
1355
  //#region src/config/unused-imports.ts
1330
1356
  async function unusedImports(options = {}) {
1331
1357
  const [unusedImportPlugin] = await Promise.all([interopDefault(import("eslint-plugin-unused-imports"))]);
1332
- const { files = [sourceGlob], recommended = true, rules = {} } = options;
1358
+ const { files = [sourceGlob], recommended, rules = {} } = defaultPluginOptions(options);
1333
1359
  return [{
1334
1360
  name: "w5s/unused-imports/setup",
1335
1361
  plugins: { "unused-imports": unusedImportPlugin }
@@ -1357,15 +1383,15 @@ async function unusedImports(options = {}) {
1357
1383
  const defaultFiles = [ymlSourceGlob];
1358
1384
  async function yml(options = {}) {
1359
1385
  const [ymlPlugin] = await Promise.all([interopDefault(import("eslint-plugin-yml"))]);
1360
- const { files, recommended = true, rules = {}, stylistic = true } = options;
1361
- const { enabled: stylisticEnabled, indent, quotes } = StylisticConfig.from(stylistic);
1386
+ const { files, namespace, recommended, rules = {}, stylistic } = defaultPluginOptions(options);
1387
+ const { enabled: stylisticEnabled, indent, quotes } = stylistic;
1362
1388
  return [{
1363
- name: "w5s/yml/setup",
1389
+ name: `${namespace}/yml/setup`,
1364
1390
  plugins: { yml: ymlPlugin }
1365
1391
  }, {
1366
1392
  files: withDefaultFiles(files, defaultFiles),
1367
1393
  language: "yml/yaml",
1368
- name: "w5s/yml/rules",
1394
+ name: `${namespace}/yml/rules`,
1369
1395
  rules: {
1370
1396
  ...recommended ? ymlPlugin.configs.recommended.reduce((acc, config) => ({
1371
1397
  ...acc,
@@ -1398,7 +1424,7 @@ async function yml(options = {}) {
1398
1424
  //#endregion
1399
1425
  //#region src/defineConfig.ts
1400
1426
  async function defineConfig(options = {}) {
1401
- const { plugins = {}, rules } = options;
1427
+ const { overrides = [], plugins = {}, rules, todo = [] } = options;
1402
1428
  const stylisticOptions = typeof plugins.stylistic === "boolean" ? { enabled: plugins.stylistic } : {
1403
1429
  enabled: true,
1404
1430
  ...plugins.stylistic
@@ -1412,14 +1438,14 @@ async function defineConfig(options = {}) {
1412
1438
  ...optionsOrBoolean
1413
1439
  });
1414
1440
  const includeEnabled = (factory, input) => input.enabled ? [factory(input)] : [];
1415
- return ESLintConfig.concat(...includeEnabled(ignores, toOption(options)), ...includeEnabled(es, toOption(plugins.es)), ...includeEnabled(ts, toOption(plugins.ts)), ...includeEnabled(e18e, toOption(plugins.e18e)), ...includeEnabled(jsx, toOption(plugins.jsx)), ...includeEnabled(unusedImports, toOption(plugins["unused-imports"])), ...includeEnabled(imports, toOption(plugins.import)), ...includeEnabled(perfectionist, toOption(plugins.perfectionist)), ...includeEnabled(node, toOption(plugins.node)), ...includeEnabled(next, toOption(plugins.next, false)), ...includeEnabled(react, toOption(plugins.react)), ...includeEnabled(unicorn, toOption(plugins.unicorn)), ...includeEnabled(test, toOption(plugins.test)), ...includeEnabled(stylistic, stylisticOptions), ...includeEnabled(jsonc, toOption(plugins.jsonc)), ...includeEnabled(jsdoc, toOption(plugins.jsdoc)), ...includeEnabled(markdown, toOption(plugins.markdown)), ...includeEnabled(yml, toOption(plugins.yml)), ...rules ? [{ rules }] : []);
1441
+ return ESLintConfig.concat(...includeEnabled(ignores, toOption(options)), ...includeEnabled(es, toOption(plugins.es)), ...includeEnabled(ts, toOption(plugins.ts)), ...includeEnabled(e18e, toOption(plugins.e18e)), ...includeEnabled(jsx, toOption(plugins.jsx)), ...includeEnabled(unusedImports, toOption(plugins["unused-imports"])), ...includeEnabled(jsdoc, toOption(plugins.jsdoc)), ...includeEnabled(imports, toOption(plugins.import)), ...includeEnabled(perfectionist, toOption(plugins.perfectionist)), ...includeEnabled(node, toOption(plugins.node)), ...includeEnabled(next, toOption(plugins.next, false)), ...includeEnabled(react, toOption(plugins.react)), ...includeEnabled(unicorn, toOption(plugins.unicorn)), ...includeEnabled(test, toOption(plugins.test)), ...includeEnabled(stylistic, stylisticOptions), ...includeEnabled(jsonc, toOption(plugins.jsonc)), ...includeEnabled(markdown, toOption(plugins.markdown)), ...includeEnabled(yml, toOption(plugins.yml)), ...rules ? [{ rules }] : [], ...todo, ...overrides);
1416
1442
  }
1417
1443
  //#endregion
1418
1444
  //#region src/meta.ts
1419
1445
  const meta = Object.freeze({
1420
- buildNumber: 1788793943,
1446
+ buildNumber: 1790065426,
1421
1447
  name: "@w5s/eslint-config",
1422
- version: "3.36.0"
1448
+ version: "4.0.0"
1423
1449
  });
1424
1450
  //#endregion
1425
1451
  export { StylisticConfig, defineConfig, e18e, es, ignores, imports, jsdoc, jsonc, jsx, markdown, meta, next, node, perfectionist, react, restrictedGlobals, restrictedImportPaths, restrictedSyntax, stylistic, test, ts, unicorn, unusedImports, yml };