@jsse/eslint-config 0.9.1 → 0.9.3

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
@@ -1,9 +1,7 @@
1
1
  import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DJK8HYOj.js";
2
2
  import { t as FIXABLE_RULES_MAP } from "./fixable-rules-map-dNndx2ig.js";
3
3
  import { builtinModules, createRequire } from "node:module";
4
- import fs, { realpathSync, statSync } from "node:fs";
5
4
  import process$1 from "node:process";
6
- import Debug from "debug";
7
5
  import pluginE18e from "@e18e/eslint-plugin";
8
6
  import pluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments";
9
7
  import pluginTs from "@typescript-eslint/eslint-plugin";
@@ -11,6 +9,7 @@ import * as parserTs from "@typescript-eslint/parser";
11
9
  import pluginAntfu from "eslint-plugin-antfu";
12
10
  import pluginDeMorgan from "eslint-plugin-de-morgan";
13
11
  import pluginImportLite from "eslint-plugin-import-lite";
12
+ import pluginJsdoc from "eslint-plugin-jsdoc";
14
13
  import pluginN from "eslint-plugin-n";
15
14
  import pluginPerfectionist from "eslint-plugin-perfectionist";
16
15
  import pluginPnpm from "eslint-plugin-pnpm";
@@ -19,8 +18,20 @@ import pluginUnicorn from "eslint-plugin-unicorn";
19
18
  import pluginUnusedImports from "eslint-plugin-unused-imports";
20
19
  import createCommand from "eslint-plugin-command/config";
21
20
  import eslintjs from "@eslint/js";
21
+ import "@eslint-react/eslint-plugin";
22
+ import "@eslint/markdown";
23
+ import "@stylistic/eslint-plugin";
24
+ import "@vitest/eslint-plugin";
25
+ import "eslint-node-test";
26
+ import "eslint-plugin-jsonc";
27
+ import "eslint-plugin-no-only-tests";
28
+ import "eslint-plugin-react-hooks";
29
+ import "eslint-plugin-react-refresh";
30
+ import "jsonc-eslint-parser";
31
+ import Debug from "debug";
22
32
  import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
23
33
  import tseslint from "typescript-eslint";
34
+ import fs, { realpathSync, statSync } from "node:fs";
24
35
  import path, { dirname, join, win32 } from "node:path";
25
36
  import fsPromises from "node:fs/promises";
26
37
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -28,7 +39,7 @@ import assert from "node:assert";
28
39
  import v8 from "node:v8";
29
40
  import { format, inspect } from "node:util";
30
41
  //#region src/_generated/version.ts
31
- const VERSION = "0.9.1";
42
+ const VERSION = "0.9.3";
32
43
  //#endregion
33
44
  //#region src/globs.ts
34
45
  var globs_exports = /* @__PURE__ */ __exportAll({
@@ -118,6 +129,7 @@ const GLOB_EXCLUDE = [
118
129
  "**/.vitepress/cache",
119
130
  "**/*.bak",
120
131
  "**/*.min.*",
132
+ "**/.wireit",
121
133
  "**/.yarn",
122
134
  "**/.pnp.*",
123
135
  "**/auto-import?(s).d.ts",
@@ -138,221 +150,6 @@ const GLOB_EXCLUDE = [
138
150
  "**/yarn.lock"
139
151
  ];
140
152
  //#endregion
141
- //#region src/lager.ts
142
- var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
143
- let p = process || {}, argv = p.argv || [], env = p.env || {};
144
- let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
145
- let formatter = (open, close, replace = open) => (input) => {
146
- let string = "" + input, index = string.indexOf(close, open.length);
147
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
148
- };
149
- let replaceClose = (string, close, replace, index) => {
150
- let result = "", cursor = 0;
151
- do {
152
- result += string.substring(cursor, index) + replace;
153
- cursor = index + close.length;
154
- index = string.indexOf(close, cursor);
155
- } while (~index);
156
- return result + string.substring(cursor);
157
- };
158
- let createColors = (enabled = isColorSupported) => {
159
- let f = enabled ? formatter : () => String;
160
- return {
161
- isColorSupported: enabled,
162
- reset: f("\x1B[0m", "\x1B[0m"),
163
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
164
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
165
- italic: f("\x1B[3m", "\x1B[23m"),
166
- underline: f("\x1B[4m", "\x1B[24m"),
167
- inverse: f("\x1B[7m", "\x1B[27m"),
168
- hidden: f("\x1B[8m", "\x1B[28m"),
169
- strikethrough: f("\x1B[9m", "\x1B[29m"),
170
- black: f("\x1B[30m", "\x1B[39m"),
171
- red: f("\x1B[31m", "\x1B[39m"),
172
- green: f("\x1B[32m", "\x1B[39m"),
173
- yellow: f("\x1B[33m", "\x1B[39m"),
174
- blue: f("\x1B[34m", "\x1B[39m"),
175
- magenta: f("\x1B[35m", "\x1B[39m"),
176
- cyan: f("\x1B[36m", "\x1B[39m"),
177
- white: f("\x1B[37m", "\x1B[39m"),
178
- gray: f("\x1B[90m", "\x1B[39m"),
179
- bgBlack: f("\x1B[40m", "\x1B[49m"),
180
- bgRed: f("\x1B[41m", "\x1B[49m"),
181
- bgGreen: f("\x1B[42m", "\x1B[49m"),
182
- bgYellow: f("\x1B[43m", "\x1B[49m"),
183
- bgBlue: f("\x1B[44m", "\x1B[49m"),
184
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
185
- bgCyan: f("\x1B[46m", "\x1B[49m"),
186
- bgWhite: f("\x1B[47m", "\x1B[49m"),
187
- blackBright: f("\x1B[90m", "\x1B[39m"),
188
- redBright: f("\x1B[91m", "\x1B[39m"),
189
- greenBright: f("\x1B[92m", "\x1B[39m"),
190
- yellowBright: f("\x1B[93m", "\x1B[39m"),
191
- blueBright: f("\x1B[94m", "\x1B[39m"),
192
- magentaBright: f("\x1B[95m", "\x1B[39m"),
193
- cyanBright: f("\x1B[96m", "\x1B[39m"),
194
- whiteBright: f("\x1B[97m", "\x1B[39m"),
195
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
196
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
197
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
198
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
199
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
200
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
201
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
202
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
203
- };
204
- };
205
- module.exports = createColors();
206
- module.exports.createColors = createColors;
207
- })))(), 1);
208
- const dbg = Debug("jsse:eslint-config");
209
- const WARN_LABEL = import_picocolors.default.yellow("[[@jsse/eslint-config::WARN]]");
210
- function enableDbg() {
211
- const currentNamespaces = Debug.namespaces;
212
- const current = typeof currentNamespaces === "string" ? currentNamespaces : void 0;
213
- Debug.enable([current, "jsse:eslint-config"].filter((ns) => ns !== void 0).join(","));
214
- dbg("Debugging enabled for @jsse/eslint-config");
215
- }
216
- const warn = (...args) => {
217
- const msg = args.map((arg) => {
218
- if (typeof arg === "string") return arg;
219
- if (arg instanceof Error) return arg.message;
220
- try {
221
- return JSON.stringify(arg, void 0, 2);
222
- } catch (_e) {
223
- return String(arg);
224
- }
225
- }).join(" ");
226
- console.warn(`${WARN_LABEL} ${msg}`);
227
- };
228
- //#endregion
229
- //#region src/utils.ts
230
- /**
231
- * Combine array and non-array configs into a single array.
232
- * @param configs configs to combine and flatten
233
- * @returns combined configs as a flattened array
234
- */
235
- async function combineAsync(...configs) {
236
- return (await Promise.all(configs)).flatMap((config) => Array.isArray(config) ? config : [config]);
237
- }
238
- function renameRules(rules, from, to) {
239
- if (from === to) return rules;
240
- return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
241
- if (key.startsWith(from)) return [to + key.slice(from.length), value];
242
- return [key, value];
243
- }));
244
- }
245
- async function interopDefault(m) {
246
- const resolved = await m;
247
- return resolved.default || resolved;
248
- }
249
- function isCI() {
250
- return !!process$1.env.CI;
251
- }
252
- function isInEditor() {
253
- return !!((process$1.env.VSCODE_PID || process$1.env.JETBRAINS_IDE) && !isCI());
254
- }
255
- /**
256
- * Make an array of strings unique maintaining order.
257
- * @param strings strings to make unique
258
- * @returns unique strings
259
- */
260
- function uniqueStrings(...strings) {
261
- const set = /* @__PURE__ */ new Set();
262
- for (const item of strings) if (typeof item === "string") set.add(item);
263
- else for (const str of item) set.add(str);
264
- return [...set];
265
- }
266
- function matchesRulePrefix(ruleName, rulePrefixes) {
267
- return rulePrefixes.some((prefix) => ruleName.startsWith(`${prefix}/`));
268
- }
269
- function scopeTypeScriptRules(configs, options) {
270
- const { files, rulePrefixes } = options;
271
- const normalizedPrefixes = uniqueStrings(rulePrefixes).filter(Boolean);
272
- if (normalizedPrefixes.length === 0) return configs;
273
- const cfgs = configs.flatMap((config) => {
274
- if (config.files || config.rules === void 0) return [config];
275
- const entries = Object.entries(config.rules);
276
- const tsRuleEntries = entries.filter(([ruleName]) => matchesRulePrefix(ruleName, normalizedPrefixes));
277
- if (tsRuleEntries.length === 0) return [config];
278
- if (tsRuleEntries.length === entries.length) return [{
279
- ...config,
280
- files
281
- }];
282
- const nonTsRuleEntries = entries.filter(([ruleName]) => !matchesRulePrefix(ruleName, normalizedPrefixes));
283
- return [{
284
- ...config,
285
- rules: Object.fromEntries(nonTsRuleEntries)
286
- }, {
287
- ...config,
288
- files,
289
- name: config.name ? `${config.name}/typescript` : void 0,
290
- rules: Object.fromEntries(tsRuleEntries)
291
- }];
292
- });
293
- dbg("scoped rules with prefixes %O to files: %O", normalizedPrefixes, files);
294
- return cfgs;
295
- }
296
- const parserPlain = {
297
- meta: { name: "parser-plain" },
298
- parseForESLint: (code) => ({
299
- ast: {
300
- body: [],
301
- comments: [],
302
- loc: {
303
- end: code.length,
304
- start: 0
305
- },
306
- range: [0, code.length],
307
- tokens: [],
308
- type: "Program"
309
- },
310
- scopeManager: void 0,
311
- services: { isPlain: true },
312
- visitorKeys: { Program: [] }
313
- })
314
- };
315
- function turnOffRules(configs, off, debug) {
316
- if (off.length > 0) {
317
- dbg("turning off rules: %O", off);
318
- const currentlyActiveRules = /* @__PURE__ */ new Set();
319
- for (const config of configs) {
320
- const cfgRules = Object.keys(config.rules ?? {});
321
- for (const rule of cfgRules) currentlyActiveRules.add(rule);
322
- }
323
- for (const rule of off) {
324
- if (currentlyActiveRules.has(rule)) continue;
325
- const msg = `Rule \`${rule}\` is not active in the current config, you can remove it from the off list`;
326
- dbg(msg);
327
- if (debug) warn(msg);
328
- }
329
- for (const config of configs) {
330
- const cfgRules = config.rules;
331
- if (cfgRules) {
332
- for (const rule of off) if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) cfgRules[rule] = "off";
333
- }
334
- }
335
- dbg("finished turning off rules");
336
- }
337
- return configs;
338
- }
339
- const TYPESCRIPT_ESLINT_PREFIX = "@typescript-eslint/";
340
- function replaceTypescriptEslintPrefixInplace(items, tsPrefix) {
341
- for (const [key, value] of Object.entries(items)) {
342
- if (!key.startsWith(TYPESCRIPT_ESLINT_PREFIX)) continue;
343
- delete items[key];
344
- items[`${tsPrefix}/${key.slice(19)}`] = value;
345
- }
346
- }
347
- //#endregion
348
- //#region src/plugins.ts
349
- async function importPluginMarkdown() {
350
- return { pluginMarkdown: await interopDefault(import("@eslint/markdown")) };
351
- }
352
- async function importPluginStylistic() {
353
- return { pluginStylistic: await interopDefault(import("@stylistic/eslint-plugin")) };
354
- }
355
- //#endregion
356
153
  //#region src/configs/antfu.ts
357
154
  const antfu = (options) => {
358
155
  return [{
@@ -436,75 +233,6 @@ const eslintComments = () => [{
436
233
  }
437
234
  }];
438
235
  //#endregion
439
- //#region src/configs/react-hooks.ts
440
- const reactHooks = async () => {
441
- const pluginReactHooks = await interopDefault(import("eslint-plugin-react-hooks"));
442
- return [{
443
- files: [GLOB_SRC],
444
- name: "jsse/react-hooks/rules",
445
- plugins: { "react-hooks": pluginReactHooks },
446
- rules: {
447
- "react-hooks/exhaustive-deps": "error",
448
- "react-hooks/rules-of-hooks": "error",
449
- ...pluginReactHooks.configs.recommended.rules
450
- },
451
- settings: { react: { version: "detect" } }
452
- }];
453
- };
454
- //#endregion
455
- //#region src/configs/eslint-react.ts
456
- async function importReactPlugins() {
457
- const [pluginReact, pluginReactRefresh] = await Promise.all([interopDefault(import("@eslint-react/eslint-plugin")), interopDefault(import("eslint-plugin-react-refresh"))]);
458
- return {
459
- pluginReact,
460
- pluginReactRefresh
461
- };
462
- }
463
- const eslintReact = async (options) => {
464
- const { overrides = {}, reactRefresh } = options ?? {};
465
- const { pluginReact, pluginReactRefresh } = await importReactPlugins();
466
- const coreReactPlugins = pluginReact.configs.all.plugins?.["@eslint-react"];
467
- if (!coreReactPlugins) throw new Error("coreReactPlugins is undefined");
468
- const reactHooksConfig = await reactHooks();
469
- const config = [
470
- {
471
- files: [GLOB_SRC],
472
- name: "jsse/react/setup",
473
- plugins: {
474
- "@eslint-react": coreReactPlugins,
475
- "react-refresh": pluginReactRefresh
476
- }
477
- },
478
- {
479
- files: [GLOB_SRC],
480
- name: "jsse/react/rules",
481
- rules: {
482
- ...pluginReact.configs.recommended.rules,
483
- "react/dom-no-string-style-prop": "off",
484
- "react/dom-no-unknown-property": "off",
485
- ...overrides
486
- },
487
- settings: { react: { version: "detect" } }
488
- },
489
- ...reactHooksConfig,
490
- {
491
- files: [GLOB_JSX, GLOB_TSX],
492
- name: "jsse/react/disables",
493
- rules: { "unicorn/no-null": "off" }
494
- }
495
- ];
496
- if (reactRefresh) config.push({
497
- files: [GLOB_SRC],
498
- name: "jsse/react/refresh",
499
- rules: { "react-refresh/only-export-components": "error" }
500
- }, {
501
- files: ["**/*.stories.tsx"],
502
- name: "jsse/react-refresh/stories",
503
- rules: { "react-refresh/only-export-components": "off" }
504
- });
505
- return config;
506
- };
507
- //#endregion
508
236
  //#region src/configs/ignores.ts
509
237
  const ignores = () => {
510
238
  return [{
@@ -4664,7 +4392,7 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4664
4392
  var import_globals = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
4665
4393
  module.exports = require_globals$1();
4666
4394
  })))(), 1);
4667
- function javascriptRules() {
4395
+ function javascriptSelectedRules() {
4668
4396
  return {
4669
4397
  "accessor-pairs": ["error", {
4670
4398
  enforceForClassMembers: true,
@@ -4821,7 +4549,7 @@ function javascriptRules() {
4821
4549
  };
4822
4550
  }
4823
4551
  const javascript = (options) => {
4824
- const { isInEditor = false, overrides = {}, reportUnusedDisableDirectives = true } = options ?? {};
4552
+ const { overrides = {}, reportUnusedDisableDirectives = true } = options ?? {};
4825
4553
  return [{
4826
4554
  files: GLOB_CODE,
4827
4555
  languageOptions: {
@@ -4843,18 +4571,9 @@ const javascript = (options) => {
4843
4571
  },
4844
4572
  linterOptions: { reportUnusedDisableDirectives },
4845
4573
  name: "jsse/javascript",
4846
- plugins: { "unused-imports": pluginUnusedImports },
4847
4574
  rules: {
4848
4575
  ...eslintjs.configs.recommended.rules,
4849
- ...javascriptRules(),
4850
- "unused-imports/no-unused-imports": isInEditor ? "off" : "error",
4851
- "unused-imports/no-unused-vars": ["error", {
4852
- args: "after-used",
4853
- argsIgnorePattern: "^_",
4854
- ignoreRestSiblings: true,
4855
- vars: "all",
4856
- varsIgnorePattern: "^_"
4857
- }],
4576
+ ...javascriptSelectedRules(),
4858
4577
  ...overrides
4859
4578
  }
4860
4579
  }, {
@@ -4865,11 +4584,11 @@ const javascript = (options) => {
4865
4584
  };
4866
4585
  //#endregion
4867
4586
  //#region src/configs/jsdoc.ts
4868
- const jsdoc = async (options) => {
4587
+ const jsdoc = (options) => {
4869
4588
  return [{
4870
4589
  files: GLOB_CODE,
4871
4590
  name: "jsse/jsdoc",
4872
- plugins: { jsdoc: await interopDefault(import("eslint-plugin-jsdoc")) },
4591
+ plugins: { jsdoc: pluginJsdoc },
4873
4592
  rules: {
4874
4593
  "jsdoc/check-access": "warn",
4875
4594
  "jsdoc/check-alignment": "warn",
@@ -4888,12 +4607,237 @@ const jsdoc = async (options) => {
4888
4607
  "jsdoc/require-returns-check": "warn",
4889
4608
  "jsdoc/require-returns-description": "warn",
4890
4609
  "jsdoc/require-yields-check": "warn",
4891
- "jsdoc/tag-lines": "warn",
4610
+ "jsdoc/tag-lines": [
4611
+ "warn",
4612
+ "any",
4613
+ {
4614
+ endLines: 0,
4615
+ startLines: null
4616
+ }
4617
+ ],
4892
4618
  ...options?.overrides
4893
4619
  }
4894
4620
  }];
4895
4621
  };
4896
4622
  //#endregion
4623
+ //#region src/lager.ts
4624
+ var import_picocolors = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
4625
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
4626
+ let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
4627
+ let formatter = (open, close, replace = open) => (input) => {
4628
+ let string = "" + input, index = string.indexOf(close, open.length);
4629
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
4630
+ };
4631
+ let replaceClose = (string, close, replace, index) => {
4632
+ let result = "", cursor = 0;
4633
+ do {
4634
+ result += string.substring(cursor, index) + replace;
4635
+ cursor = index + close.length;
4636
+ index = string.indexOf(close, cursor);
4637
+ } while (~index);
4638
+ return result + string.substring(cursor);
4639
+ };
4640
+ let createColors = (enabled = isColorSupported) => {
4641
+ let f = enabled ? formatter : () => String;
4642
+ return {
4643
+ isColorSupported: enabled,
4644
+ reset: f("\x1B[0m", "\x1B[0m"),
4645
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
4646
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
4647
+ italic: f("\x1B[3m", "\x1B[23m"),
4648
+ underline: f("\x1B[4m", "\x1B[24m"),
4649
+ inverse: f("\x1B[7m", "\x1B[27m"),
4650
+ hidden: f("\x1B[8m", "\x1B[28m"),
4651
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
4652
+ black: f("\x1B[30m", "\x1B[39m"),
4653
+ red: f("\x1B[31m", "\x1B[39m"),
4654
+ green: f("\x1B[32m", "\x1B[39m"),
4655
+ yellow: f("\x1B[33m", "\x1B[39m"),
4656
+ blue: f("\x1B[34m", "\x1B[39m"),
4657
+ magenta: f("\x1B[35m", "\x1B[39m"),
4658
+ cyan: f("\x1B[36m", "\x1B[39m"),
4659
+ white: f("\x1B[37m", "\x1B[39m"),
4660
+ gray: f("\x1B[90m", "\x1B[39m"),
4661
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
4662
+ bgRed: f("\x1B[41m", "\x1B[49m"),
4663
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
4664
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
4665
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
4666
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
4667
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
4668
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
4669
+ blackBright: f("\x1B[90m", "\x1B[39m"),
4670
+ redBright: f("\x1B[91m", "\x1B[39m"),
4671
+ greenBright: f("\x1B[92m", "\x1B[39m"),
4672
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
4673
+ blueBright: f("\x1B[94m", "\x1B[39m"),
4674
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
4675
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
4676
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
4677
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
4678
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
4679
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
4680
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
4681
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
4682
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
4683
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
4684
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
4685
+ };
4686
+ };
4687
+ module.exports = createColors();
4688
+ module.exports.createColors = createColors;
4689
+ })))(), 1);
4690
+ const dbg = Debug("jsse:eslint-config");
4691
+ const WARN_LABEL = import_picocolors.default.yellow("[[@jsse/eslint-config::WARN]]");
4692
+ function enableDbg() {
4693
+ const currentNamespaces = Debug.namespaces;
4694
+ const current = typeof currentNamespaces === "string" ? currentNamespaces : void 0;
4695
+ Debug.enable([current, "jsse:eslint-config"].filter((ns) => ns !== void 0).join(","));
4696
+ dbg("Debugging enabled for @jsse/eslint-config");
4697
+ }
4698
+ const warn = (...args) => {
4699
+ const msg = args.map((arg) => {
4700
+ if (typeof arg === "string") return arg;
4701
+ if (arg instanceof Error) return arg.message;
4702
+ try {
4703
+ return JSON.stringify(arg, void 0, 2);
4704
+ } catch (_e) {
4705
+ return String(arg);
4706
+ }
4707
+ }).join(" ");
4708
+ console.warn(`${WARN_LABEL} ${msg}`);
4709
+ };
4710
+ //#endregion
4711
+ //#region src/utils.ts
4712
+ function isPromiseLike(value) {
4713
+ return typeof value === "object" && value !== null && "then" in value && typeof value.then === "function";
4714
+ }
4715
+ function flattenConfigs(configs) {
4716
+ return configs.flatMap((config) => Array.isArray(config) ? config : [config]);
4717
+ }
4718
+ async function resolveAndFlattenConfigs(configs) {
4719
+ return flattenConfigs(await Promise.all(configs.map((config) => Promise.resolve(config))));
4720
+ }
4721
+ /**
4722
+ * Combine array and non-array configs into a single array.
4723
+ * @param configs configs to combine and flatten
4724
+ * @returns combined configs as a flattened array
4725
+ */
4726
+ function combineAsync(...configs) {
4727
+ if (configs.every((config) => !isPromiseLike(config))) return flattenConfigs(configs);
4728
+ return resolveAndFlattenConfigs(configs);
4729
+ }
4730
+ function renameRules(rules, from, to) {
4731
+ if (from === to) return rules;
4732
+ return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
4733
+ if (key.startsWith(from)) return [to + key.slice(from.length), value];
4734
+ return [key, value];
4735
+ }));
4736
+ }
4737
+ async function interopDefault(m) {
4738
+ const resolved = await m;
4739
+ return resolved.default || resolved;
4740
+ }
4741
+ function isCI() {
4742
+ return !!process$1.env.CI;
4743
+ }
4744
+ function isInEditor() {
4745
+ return !!((process$1.env.VSCODE_PID || process$1.env.JETBRAINS_IDE) && !isCI());
4746
+ }
4747
+ /**
4748
+ * Make an array of strings unique maintaining order.
4749
+ * @param strings strings to make unique
4750
+ * @returns unique strings
4751
+ */
4752
+ function uniqueStrings(...strings) {
4753
+ const set = /* @__PURE__ */ new Set();
4754
+ for (const item of strings) if (typeof item === "string") set.add(item);
4755
+ else for (const str of item) set.add(str);
4756
+ return [...set];
4757
+ }
4758
+ function matchesRulePrefix(ruleName, rulePrefixes) {
4759
+ return rulePrefixes.some((prefix) => ruleName.startsWith(`${prefix}/`));
4760
+ }
4761
+ function scopeTypeScriptRules(configs, options) {
4762
+ dbg("scoping rules with prefixes %O to files: %O", options.rulePrefixes, options.files);
4763
+ const { files, rulePrefixes } = options;
4764
+ const normalizedPrefixes = uniqueStrings(rulePrefixes).filter(Boolean);
4765
+ if (normalizedPrefixes.length === 0) return configs;
4766
+ const cfgs = configs.flatMap((config) => {
4767
+ if (config.files || config.rules === void 0) return [config];
4768
+ const entries = Object.entries(config.rules);
4769
+ const tsRuleEntries = entries.filter(([ruleName]) => matchesRulePrefix(ruleName, normalizedPrefixes));
4770
+ if (tsRuleEntries.length === 0) return [config];
4771
+ if (tsRuleEntries.length === entries.length) return [{
4772
+ ...config,
4773
+ files
4774
+ }];
4775
+ const nonTsRuleEntries = entries.filter(([ruleName]) => !matchesRulePrefix(ruleName, normalizedPrefixes));
4776
+ return [{
4777
+ ...config,
4778
+ rules: Object.fromEntries(nonTsRuleEntries)
4779
+ }, {
4780
+ ...config,
4781
+ files,
4782
+ name: config.name ? `${config.name}/typescript` : void 0,
4783
+ rules: Object.fromEntries(tsRuleEntries)
4784
+ }];
4785
+ });
4786
+ dbg("scoped rules with prefixes %O to files: %O", normalizedPrefixes, files);
4787
+ return cfgs;
4788
+ }
4789
+ const parserPlain = {
4790
+ meta: { name: "parser-plain" },
4791
+ parseForESLint: (code) => ({
4792
+ ast: {
4793
+ body: [],
4794
+ comments: [],
4795
+ loc: {
4796
+ end: code.length,
4797
+ start: 0
4798
+ },
4799
+ range: [0, code.length],
4800
+ tokens: [],
4801
+ type: "Program"
4802
+ },
4803
+ scopeManager: void 0,
4804
+ services: { isPlain: true },
4805
+ visitorKeys: { Program: [] }
4806
+ })
4807
+ };
4808
+ function turnOffRules(configs, off, debug) {
4809
+ if (off.length > 0) {
4810
+ dbg("turning off rules: %O", off);
4811
+ const currentlyActiveRules = /* @__PURE__ */ new Set();
4812
+ for (const config of configs) {
4813
+ const cfgRules = Object.keys(config.rules ?? {});
4814
+ for (const rule of cfgRules) currentlyActiveRules.add(rule);
4815
+ }
4816
+ for (const rule of off) {
4817
+ if (currentlyActiveRules.has(rule)) continue;
4818
+ const msg = `Rule \`${rule}\` is not active in the current config, you can remove it from the off list`;
4819
+ dbg(msg);
4820
+ if (debug) warn(msg);
4821
+ }
4822
+ for (const config of configs) {
4823
+ const cfgRules = config.rules;
4824
+ if (cfgRules) {
4825
+ for (const rule of off) if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) cfgRules[rule] = "off";
4826
+ }
4827
+ }
4828
+ dbg("finished turning off rules");
4829
+ }
4830
+ return configs;
4831
+ }
4832
+ const TYPESCRIPT_ESLINT_PREFIX = "@typescript-eslint/";
4833
+ function replaceTypescriptEslintPrefixInplace(items, tsPrefix) {
4834
+ for (const [key, value] of Object.entries(items)) {
4835
+ if (!key.startsWith(TYPESCRIPT_ESLINT_PREFIX)) continue;
4836
+ delete items[key];
4837
+ items[`${tsPrefix}/${key.slice(19)}`] = value;
4838
+ }
4839
+ }
4840
+ //#endregion
4897
4841
  //#region src/configs/jsonc.ts
4898
4842
  async function importParserJsonc() {
4899
4843
  return { parserJsonc: await interopDefault(import("jsonc-eslint-parser")) };
@@ -4975,78 +4919,149 @@ const jsonc = async (options) => {
4975
4919
  }];
4976
4920
  };
4977
4921
  //#endregion
4922
+ //#region src/configs/ts/presets.ts
4923
+ const TYPESCRIPT_PRESET_CONFIGS = {
4924
+ all: "all",
4925
+ base: "base",
4926
+ "disable-type-checked": "disableTypeChecked",
4927
+ "eslint-recommended": "eslintRecommended",
4928
+ recommended: "recommended",
4929
+ "recommended-type-checked": "recommendedTypeChecked",
4930
+ "recommended-type-checked-only": "recommendedTypeCheckedOnly",
4931
+ strict: "strict",
4932
+ "strict-type-checked": "strictTypeChecked",
4933
+ "strict-type-checked-only": "strictTypeCheckedOnly",
4934
+ stylistic: "stylistic",
4935
+ "stylistic-type-checked": "stylisticTypeChecked",
4936
+ "stylistic-type-checked-only": "stylisticTypeCheckedOnly"
4937
+ };
4938
+ const TYPE_CHECKED_PRESETS = /* @__PURE__ */ new Set([
4939
+ "all",
4940
+ "disable-type-checked",
4941
+ "recommended-type-checked",
4942
+ "recommended-type-checked-only",
4943
+ "strict-type-checked",
4944
+ "strict-type-checked-only",
4945
+ "stylistic-type-checked",
4946
+ "stylistic-type-checked-only"
4947
+ ]);
4948
+ const TYPE_OBLIVIOUS_PRESET_EQUIVALENTS = {
4949
+ "recommended-type-checked": "recommended",
4950
+ "strict-type-checked": "strict",
4951
+ "stylistic-type-checked": "stylistic"
4952
+ };
4953
+ const extractRules = (configs) => {
4954
+ const rules = configs.filter((config) => config.rules !== void 0).map((config) => config.rules ?? {});
4955
+ return Object.assign({}, ...rules);
4956
+ };
4957
+ function isTypescriptPreset(preset) {
4958
+ return Object.hasOwn(TYPESCRIPT_PRESET_CONFIGS, preset);
4959
+ }
4960
+ function normalizePresets(presets) {
4961
+ if (presets === void 0) return;
4962
+ const presetList = Array.isArray(presets) ? presets : [presets];
4963
+ const normalized = [];
4964
+ const seen = /* @__PURE__ */ new Set();
4965
+ for (const preset of presetList) {
4966
+ if (!isTypescriptPreset(preset)) {
4967
+ const validPresets = Object.keys(TYPESCRIPT_PRESET_CONFIGS).join(", ");
4968
+ throw new Error(`Unknown TypeScript ESLint preset "${String(preset)}". Expected one of: ${validPresets}`);
4969
+ }
4970
+ if (seen.has(preset)) {
4971
+ warn(`Duplicate TypeScript ESLint preset "${preset}" ignored`);
4972
+ continue;
4973
+ }
4974
+ seen.add(preset);
4975
+ normalized.push(preset);
4976
+ }
4977
+ return normalized.length === 0 ? void 0 : normalized;
4978
+ }
4979
+ function defaultPresets(props) {
4980
+ return props?.typeAware ? props.strict ? ["strict-type-checked"] : ["recommended-type-checked"] : props?.strict ? ["strict"] : ["recommended"];
4981
+ }
4982
+ function presetsForScope(presets, typeAware) {
4983
+ if (typeAware) return presets;
4984
+ const scopedPresets = [];
4985
+ for (const preset of presets) {
4986
+ if (!TYPE_CHECKED_PRESETS.has(preset)) {
4987
+ scopedPresets.push(preset);
4988
+ continue;
4989
+ }
4990
+ const equivalent = TYPE_OBLIVIOUS_PRESET_EQUIVALENTS[preset];
4991
+ if (equivalent !== void 0) scopedPresets.push(equivalent);
4992
+ }
4993
+ return scopedPresets;
4994
+ }
4995
+ function configForPreset(preset) {
4996
+ const configName = TYPESCRIPT_PRESET_CONFIGS[preset];
4997
+ return tseslint.configs[configName];
4998
+ }
4999
+ function includesStrictPreset(presets) {
5000
+ if (presets === void 0) return false;
5001
+ return (Array.isArray(presets) ? presets : [presets]).some((preset) => preset === "strict" || preset.startsWith("strict-type-checked"));
5002
+ }
5003
+ function tsPresetRules(props) {
5004
+ const scopedPresets = presetsForScope(normalizePresets(props?.presets) ?? defaultPresets(props), props?.typeAware ?? false);
5005
+ const rules = {};
5006
+ for (const preset of scopedPresets) Object.assign(rules, extractRules(configForPreset(preset)));
5007
+ return rules;
5008
+ }
5009
+ //#endregion
4978
5010
  //#region src/configs/ts/typescript-rules.ts
4979
- const extractRules = (configs) => {
4980
- const rules = configs.filter((config) => config.rules !== void 0).map((config) => config.rules ?? {});
4981
- return Object.assign({}, ...rules);
4982
- };
4983
5011
  function typescriptRulesTypeAware() {
4984
5012
  return {
4985
5013
  "@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
4986
- "dot-notation": "off",
4987
5014
  "@typescript-eslint/dot-notation": ["error", {
4988
- allowPattern: "^_",
4989
- allowKeywords: true
5015
+ allowKeywords: true,
5016
+ allowPattern: "^_"
5017
+ }],
5018
+ "@typescript-eslint/no-floating-promises": ["error", {
5019
+ ignoreIIFE: true,
5020
+ ignoreVoid: true
4990
5021
  }],
4991
5022
  "@typescript-eslint/no-import-type-side-effects": "error",
4992
5023
  "@typescript-eslint/no-unnecessary-qualifier": "error",
4993
5024
  "@typescript-eslint/require-array-sort-compare": ["error", { ignoreStringArrays: true }],
4994
- "@typescript-eslint/no-floating-promises": ["error", {
4995
- ignoreVoid: true,
4996
- ignoreIIFE: true
4997
- }]
5025
+ "@typescript-eslint/restrict-template-expressions": ["error", {
5026
+ allow: [{
5027
+ from: "lib",
5028
+ name: [
5029
+ "Error",
5030
+ "URL",
5031
+ "URLSearchParams"
5032
+ ]
5033
+ }],
5034
+ allowAny: false,
5035
+ allowBoolean: true,
5036
+ allowNullish: true,
5037
+ allowNumber: true,
5038
+ allowRegExp: true
5039
+ }],
5040
+ "@typescript-eslint/switch-exhaustiveness-check": "error",
5041
+ "dot-notation": "off"
4998
5042
  };
4999
5043
  }
5000
5044
  function typescriptRulesTypeOblivious() {
5001
5045
  return {
5002
- eqeqeq: "error",
5003
- camelcase: "off",
5004
- yoda: "error",
5005
5046
  "arrow-parens": "off",
5006
- "no-console": ["warn", { allow: ["warn", "error"] }],
5007
- "object-curly-spacing": "off",
5008
- "@typescript-eslint/no-inferrable-types": "off",
5009
- "@typescript-eslint/consistent-type-imports": ["error", {
5010
- prefer: "type-imports",
5011
- fixStyle: "separate-type-imports"
5012
- }],
5013
- "@typescript-eslint/adjacent-overload-signatures": "error",
5014
- "@typescript-eslint/consistent-type-assertions": "error",
5015
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
5016
- "@typescript-eslint/member-ordering": ["warn", {
5017
- default: "never",
5018
- classes: [
5019
- "field",
5020
- "constructor",
5021
- "method"
5022
- ]
5023
- }],
5024
- "@typescript-eslint/no-namespace": ["error", {
5025
- allowDeclarations: false,
5026
- allowDefinitionFiles: false
5027
- }],
5028
- "@typescript-eslint/no-unused-vars": ["warn", {
5029
- vars: "all",
5030
- args: "none",
5031
- argsIgnorePattern: "^_",
5032
- varsIgnorePattern: "^_",
5033
- caughtErrorsIgnorePattern: "^_"
5034
- }],
5047
+ camelcase: "off",
5048
+ "comma-spacing": "off",
5049
+ "default-param-last": "off",
5050
+ "no-bitwise": "off",
5051
+ "no-duplicate-imports": "off",
5052
+ "no-empty-function": "off",
5053
+ "no-loop-func": "off",
5054
+ "no-loss-of-precision": "off",
5055
+ "no-restricted-imports": "off",
5035
5056
  "no-use-before-define": "off",
5036
- "@typescript-eslint/no-use-before-define": ["error", {
5037
- functions: true,
5038
- classes: true,
5039
- variables: true,
5040
- enums: true,
5041
- typedefs: true
5042
- }],
5043
- "@typescript-eslint/prefer-namespace-keyword": "warn",
5057
+ "object-curly-spacing": "off",
5044
5058
  "accessor-pairs": "error",
5059
+ eqeqeq: "error",
5045
5060
  "for-direction": "warn",
5046
5061
  "guard-for-in": "error",
5047
5062
  "max-lines": ["warn", { max: 2e3 }],
5048
- "no-bitwise": "off",
5049
5063
  "no-caller": "error",
5064
+ "no-console": ["warn", { allow: ["warn", "error"] }],
5050
5065
  "no-constant-condition": "warn",
5051
5066
  "no-debugger": "warn",
5052
5067
  "no-empty": "warn",
@@ -5063,6 +5078,14 @@ function typescriptRulesTypeOblivious() {
5063
5078
  "no-new-func": "error",
5064
5079
  "no-new-wrappers": "warn",
5065
5080
  "no-octal-escape": "error",
5081
+ "no-restricted-syntax": [
5082
+ "error",
5083
+ "DebuggerStatement",
5084
+ "LabeledStatement",
5085
+ "WithStatement",
5086
+ "TSEnumDeclaration[const=true]",
5087
+ "TSExportAssignment"
5088
+ ],
5066
5089
  "no-return-assign": "error",
5067
5090
  "no-script-url": "warn",
5068
5091
  "no-self-compare": "error",
@@ -5075,17 +5098,36 @@ function typescriptRulesTypeOblivious() {
5075
5098
  "require-atomic-updates": "error",
5076
5099
  "require-yield": "warn",
5077
5100
  strict: ["error", "never"],
5078
- "comma-spacing": "off",
5079
- "default-param-last": "off",
5101
+ yoda: "error",
5102
+ "@typescript-eslint/adjacent-overload-signatures": "error",
5103
+ "@typescript-eslint/consistent-type-assertions": ["error", {
5104
+ assertionStyle: "as",
5105
+ objectLiteralTypeAssertions: "allow-as-parameter"
5106
+ }],
5107
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
5108
+ "@typescript-eslint/consistent-type-imports": ["error", {
5109
+ fixStyle: "separate-type-imports",
5110
+ prefer: "type-imports"
5111
+ }],
5080
5112
  "@typescript-eslint/default-param-last": "error",
5113
+ "@typescript-eslint/member-ordering": ["warn", {
5114
+ classes: [
5115
+ "field",
5116
+ "constructor",
5117
+ "method"
5118
+ ],
5119
+ default: "never"
5120
+ }],
5121
+ "@typescript-eslint/method-signature-style": ["warn", "property"],
5081
5122
  "@typescript-eslint/no-dupe-class-members": "error",
5082
- "no-empty-function": "off",
5083
5123
  "@typescript-eslint/no-empty-function": "error",
5084
- "no-loop-func": "off",
5124
+ "@typescript-eslint/no-inferrable-types": "off",
5085
5125
  "@typescript-eslint/no-loop-func": "error",
5086
- "no-loss-of-precision": "off",
5126
+ "@typescript-eslint/no-namespace": ["error", {
5127
+ allowDeclarations: false,
5128
+ allowDefinitionFiles: false
5129
+ }],
5087
5130
  "@typescript-eslint/no-redeclare": "error",
5088
- "no-restricted-imports": "off",
5089
5131
  "@typescript-eslint/no-restricted-imports": ["error", { paths: [
5090
5132
  "error",
5091
5133
  "domain",
@@ -5096,39 +5138,47 @@ function typescriptRulesTypeOblivious() {
5096
5138
  "querystring",
5097
5139
  "colors"
5098
5140
  ] }],
5099
- "no-duplicate-imports": "off",
5100
- "@typescript-eslint/method-signature-style": ["warn", "property"],
5141
+ "@typescript-eslint/no-unused-expressions": ["error", {
5142
+ allowShortCircuit: true,
5143
+ allowTaggedTemplates: true,
5144
+ allowTernary: true
5145
+ }],
5146
+ "@typescript-eslint/no-unused-vars": ["warn", {
5147
+ args: "none",
5148
+ argsIgnorePattern: "^_",
5149
+ caughtErrorsIgnorePattern: "^_",
5150
+ vars: "all",
5151
+ varsIgnorePattern: "^_"
5152
+ }],
5153
+ "@typescript-eslint/no-use-before-define": ["error", {
5154
+ classes: true,
5155
+ enums: true,
5156
+ functions: true,
5157
+ typedefs: true,
5158
+ variables: true
5159
+ }],
5101
5160
  "@typescript-eslint/prefer-literal-enum-member": ["error", { allowBitwiseExpressions: true }],
5102
- "no-restricted-syntax": [
5103
- "error",
5104
- "DebuggerStatement",
5105
- "LabeledStatement",
5106
- "WithStatement",
5107
- "TSEnumDeclaration[const=true]",
5108
- "TSExportAssignment"
5109
- ]
5161
+ "@typescript-eslint/prefer-namespace-keyword": "warn"
5110
5162
  };
5111
5163
  }
5112
- function tsPresetRules(props) {
5113
- const tseslintConfig = props?.typeAware ? props.strict ? tseslint.configs.strictTypeChecked : tseslint.configs.recommendedTypeChecked : props?.strict ? tseslint.configs.strict : tseslint.configs.recommended;
5114
- return extractRules(tseslintConfig);
5115
- }
5116
5164
  function typescriptRules(props) {
5117
5165
  const normalized = {
5118
5166
  includeTsEslintPresetRules: true,
5119
- typeAware: false,
5120
5167
  strict: false,
5168
+ typeAware: false,
5121
5169
  ...props
5122
5170
  };
5171
+ if (normalized.presets !== void 0 && normalized.strictProvided) throw new Error("Use either TypeScript `presets` or deprecated `strict`, not both.");
5123
5172
  dbg("building typescript rules: %O", normalized);
5124
5173
  const rulesFromPreset = normalized.includeTsEslintPresetRules ? tsPresetRules(normalized) : {};
5174
+ const strictRules = normalized.presets === void 0 ? normalized.strict : includesStrictPreset(normalized.presets);
5125
5175
  dbg("ts-eslint preset rules: %O", rulesFromPreset);
5126
5176
  return {
5127
5177
  ...rulesFromPreset,
5128
5178
  ...typescriptRulesTypeOblivious(),
5129
5179
  ...normalized.typeAware && typescriptRulesTypeAware(),
5130
- ...normalized.typeAware && !normalized.strict && { "@typescript-eslint/no-deprecated": "error" },
5131
- ...normalized.typeAware && normalized.strict && { "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: "only-allowed-literals" }] }
5180
+ ...normalized.typeAware && !strictRules && { "@typescript-eslint/no-deprecated": "error" },
5181
+ ...normalized.typeAware && strictRules && { "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: "only-allowed-literals" }] }
5132
5182
  };
5133
5183
  }
5134
5184
  //#endregion
@@ -5136,7 +5186,7 @@ function typescriptRules(props) {
5136
5186
  const markdown = async (options) => {
5137
5187
  const { componentExts = [], overrides = {} } = options ?? {};
5138
5188
  const files = [GLOB_MARKDOWN];
5139
- const { pluginMarkdown } = await importPluginMarkdown();
5189
+ const pluginMarkdown = await interopDefault(import("@eslint/markdown"));
5140
5190
  const tsRulesOff = Object.fromEntries(Object.keys(typescriptRulesTypeAware()).map((key) => [`@typescript-eslint/${key}`, "off"]));
5141
5191
  const processor = mergeProcessors([pluginMarkdown.processors.markdown, processorPassThrough]);
5142
5192
  return [
@@ -5354,121 +5404,321 @@ const pnpm = async (options) => {
5354
5404
  }];
5355
5405
  };
5356
5406
  //#endregion
5407
+ //#region src/_generated/eslint-config-prettier-rules.ts
5408
+ const ESLINT_CONFIG_PRETTIER_RULES = {
5409
+ "@stylistic/array-bracket-newline": "off",
5410
+ "@stylistic/array-bracket-spacing": "off",
5411
+ "@stylistic/array-element-newline": "off",
5412
+ "@stylistic/arrow-parens": "off",
5413
+ "@stylistic/arrow-spacing": "off",
5414
+ "@stylistic/block-spacing": "off",
5415
+ "@stylistic/brace-style": "off",
5416
+ "@stylistic/comma-dangle": "off",
5417
+ "@stylistic/comma-spacing": "off",
5418
+ "@stylistic/comma-style": "off",
5419
+ "@stylistic/computed-property-spacing": "off",
5420
+ "@stylistic/dot-location": "off",
5421
+ "@stylistic/eol-last": "off",
5422
+ "@stylistic/func-call-spacing": "off",
5423
+ "@stylistic/function-call-argument-newline": "off",
5424
+ "@stylistic/function-call-spacing": "off",
5425
+ "@stylistic/function-paren-newline": "off",
5426
+ "@stylistic/generator-star-spacing": "off",
5427
+ "@stylistic/implicit-arrow-linebreak": "off",
5428
+ "@stylistic/indent": "off",
5429
+ "@stylistic/indent-binary-ops": "off",
5430
+ "@stylistic/js/array-bracket-newline": "off",
5431
+ "@stylistic/js/array-bracket-spacing": "off",
5432
+ "@stylistic/js/array-element-newline": "off",
5433
+ "@stylistic/js/arrow-parens": "off",
5434
+ "@stylistic/js/arrow-spacing": "off",
5435
+ "@stylistic/js/block-spacing": "off",
5436
+ "@stylistic/js/brace-style": "off",
5437
+ "@stylistic/js/comma-dangle": "off",
5438
+ "@stylistic/js/comma-spacing": "off",
5439
+ "@stylistic/js/comma-style": "off",
5440
+ "@stylistic/js/computed-property-spacing": "off",
5441
+ "@stylistic/js/dot-location": "off",
5442
+ "@stylistic/js/eol-last": "off",
5443
+ "@stylistic/js/func-call-spacing": "off",
5444
+ "@stylistic/js/function-call-argument-newline": "off",
5445
+ "@stylistic/js/function-call-spacing": "off",
5446
+ "@stylistic/js/function-paren-newline": "off",
5447
+ "@stylistic/js/generator-star-spacing": "off",
5448
+ "@stylistic/js/implicit-arrow-linebreak": "off",
5449
+ "@stylistic/js/indent": "off",
5450
+ "@stylistic/js/jsx-quotes": "off",
5451
+ "@stylistic/js/key-spacing": "off",
5452
+ "@stylistic/js/keyword-spacing": "off",
5453
+ "@stylistic/js/linebreak-style": "off",
5454
+ "@stylistic/js/lines-around-comment": 0,
5455
+ "@stylistic/js/max-len": 0,
5456
+ "@stylistic/js/max-statements-per-line": "off",
5457
+ "@stylistic/js/multiline-ternary": "off",
5458
+ "@stylistic/js/new-parens": "off",
5459
+ "@stylistic/js/newline-per-chained-call": "off",
5460
+ "@stylistic/js/no-confusing-arrow": 0,
5461
+ "@stylistic/js/no-extra-parens": "off",
5462
+ "@stylistic/js/no-extra-semi": "off",
5463
+ "@stylistic/js/no-floating-decimal": "off",
5464
+ "@stylistic/js/no-mixed-operators": 0,
5465
+ "@stylistic/js/no-mixed-spaces-and-tabs": "off",
5466
+ "@stylistic/js/no-multi-spaces": "off",
5467
+ "@stylistic/js/no-multiple-empty-lines": "off",
5468
+ "@stylistic/js/no-tabs": 0,
5469
+ "@stylistic/js/no-trailing-spaces": "off",
5470
+ "@stylistic/js/no-whitespace-before-property": "off",
5471
+ "@stylistic/js/nonblock-statement-body-position": "off",
5472
+ "@stylistic/js/object-curly-newline": "off",
5473
+ "@stylistic/js/object-curly-spacing": "off",
5474
+ "@stylistic/js/object-property-newline": "off",
5475
+ "@stylistic/js/one-var-declaration-per-line": "off",
5476
+ "@stylistic/js/operator-linebreak": "off",
5477
+ "@stylistic/js/padded-blocks": "off",
5478
+ "@stylistic/js/quote-props": "off",
5479
+ "@stylistic/js/quotes": 0,
5480
+ "@stylistic/js/rest-spread-spacing": "off",
5481
+ "@stylistic/js/semi": "off",
5482
+ "@stylistic/js/semi-spacing": "off",
5483
+ "@stylistic/js/semi-style": "off",
5484
+ "@stylistic/js/space-before-blocks": "off",
5485
+ "@stylistic/js/space-before-function-paren": "off",
5486
+ "@stylistic/js/space-in-parens": "off",
5487
+ "@stylistic/js/space-infix-ops": "off",
5488
+ "@stylistic/js/space-unary-ops": "off",
5489
+ "@stylistic/js/switch-colon-spacing": "off",
5490
+ "@stylistic/js/template-curly-spacing": "off",
5491
+ "@stylistic/js/template-tag-spacing": "off",
5492
+ "@stylistic/js/wrap-iife": "off",
5493
+ "@stylistic/js/wrap-regex": "off",
5494
+ "@stylistic/js/yield-star-spacing": "off",
5495
+ "@stylistic/jsx-child-element-spacing": "off",
5496
+ "@stylistic/jsx-closing-bracket-location": "off",
5497
+ "@stylistic/jsx-closing-tag-location": "off",
5498
+ "@stylistic/jsx-curly-newline": "off",
5499
+ "@stylistic/jsx-curly-spacing": "off",
5500
+ "@stylistic/jsx-equals-spacing": "off",
5501
+ "@stylistic/jsx-first-prop-new-line": "off",
5502
+ "@stylistic/jsx-indent": "off",
5503
+ "@stylistic/jsx-indent-props": "off",
5504
+ "@stylistic/jsx-max-props-per-line": "off",
5505
+ "@stylistic/jsx-newline": "off",
5506
+ "@stylistic/jsx-one-expression-per-line": "off",
5507
+ "@stylistic/jsx-props-no-multi-spaces": "off",
5508
+ "@stylistic/jsx-quotes": "off",
5509
+ "@stylistic/jsx-tag-spacing": "off",
5510
+ "@stylistic/jsx-wrap-multilines": "off",
5511
+ "@stylistic/jsx/jsx-child-element-spacing": "off",
5512
+ "@stylistic/jsx/jsx-closing-bracket-location": "off",
5513
+ "@stylistic/jsx/jsx-closing-tag-location": "off",
5514
+ "@stylistic/jsx/jsx-curly-newline": "off",
5515
+ "@stylistic/jsx/jsx-curly-spacing": "off",
5516
+ "@stylistic/jsx/jsx-equals-spacing": "off",
5517
+ "@stylistic/jsx/jsx-first-prop-new-line": "off",
5518
+ "@stylistic/jsx/jsx-indent": "off",
5519
+ "@stylistic/jsx/jsx-indent-props": "off",
5520
+ "@stylistic/jsx/jsx-max-props-per-line": "off",
5521
+ "@stylistic/key-spacing": "off",
5522
+ "@stylistic/keyword-spacing": "off",
5523
+ "@stylistic/linebreak-style": "off",
5524
+ "@stylistic/lines-around-comment": 0,
5525
+ "@stylistic/max-len": 0,
5526
+ "@stylistic/max-statements-per-line": "off",
5527
+ "@stylistic/member-delimiter-style": "off",
5528
+ "@stylistic/multiline-ternary": "off",
5529
+ "@stylistic/new-parens": "off",
5530
+ "@stylistic/newline-per-chained-call": "off",
5531
+ "@stylistic/no-confusing-arrow": 0,
5532
+ "@stylistic/no-extra-parens": "off",
5533
+ "@stylistic/no-extra-semi": "off",
5534
+ "@stylistic/no-floating-decimal": "off",
5535
+ "@stylistic/no-mixed-operators": 0,
5536
+ "@stylistic/no-mixed-spaces-and-tabs": "off",
5537
+ "@stylistic/no-multi-spaces": "off",
5538
+ "@stylistic/no-multiple-empty-lines": "off",
5539
+ "@stylistic/no-tabs": 0,
5540
+ "@stylistic/no-trailing-spaces": "off",
5541
+ "@stylistic/no-whitespace-before-property": "off",
5542
+ "@stylistic/nonblock-statement-body-position": "off",
5543
+ "@stylistic/object-curly-newline": "off",
5544
+ "@stylistic/object-curly-spacing": "off",
5545
+ "@stylistic/object-property-newline": "off",
5546
+ "@stylistic/one-var-declaration-per-line": "off",
5547
+ "@stylistic/operator-linebreak": "off",
5548
+ "@stylistic/padded-blocks": "off",
5549
+ "@stylistic/quote-props": "off",
5550
+ "@stylistic/quotes": 0,
5551
+ "@stylistic/rest-spread-spacing": "off",
5552
+ "@stylistic/semi": "off",
5553
+ "@stylistic/semi-spacing": "off",
5554
+ "@stylistic/semi-style": "off",
5555
+ "@stylistic/space-before-blocks": "off",
5556
+ "@stylistic/space-before-function-paren": "off",
5557
+ "@stylistic/space-in-parens": "off",
5558
+ "@stylistic/space-infix-ops": "off",
5559
+ "@stylistic/space-unary-ops": "off",
5560
+ "@stylistic/switch-colon-spacing": "off",
5561
+ "@stylistic/template-curly-spacing": "off",
5562
+ "@stylistic/template-tag-spacing": "off",
5563
+ "@stylistic/ts/block-spacing": "off",
5564
+ "@stylistic/ts/brace-style": "off",
5565
+ "@stylistic/ts/comma-dangle": "off",
5566
+ "@stylistic/ts/comma-spacing": "off",
5567
+ "@stylistic/ts/func-call-spacing": "off",
5568
+ "@stylistic/ts/function-call-spacing": "off",
5569
+ "@stylistic/ts/indent": "off",
5570
+ "@stylistic/ts/key-spacing": "off",
5571
+ "@stylistic/ts/keyword-spacing": "off",
5572
+ "@stylistic/ts/lines-around-comment": 0,
5573
+ "@stylistic/ts/member-delimiter-style": "off",
5574
+ "@stylistic/ts/no-extra-parens": "off",
5575
+ "@stylistic/ts/no-extra-semi": "off",
5576
+ "@stylistic/ts/object-curly-spacing": "off",
5577
+ "@stylistic/ts/quotes": 0,
5578
+ "@stylistic/ts/semi": "off",
5579
+ "@stylistic/ts/space-before-blocks": "off",
5580
+ "@stylistic/ts/space-before-function-paren": "off",
5581
+ "@stylistic/ts/space-infix-ops": "off",
5582
+ "@stylistic/ts/type-annotation-spacing": "off",
5583
+ "@stylistic/type-annotation-spacing": "off",
5584
+ "@stylistic/type-generic-spacing": "off",
5585
+ "@stylistic/type-named-tuple-spacing": "off",
5586
+ "@stylistic/wrap-iife": "off",
5587
+ "@stylistic/wrap-regex": "off",
5588
+ "@stylistic/yield-star-spacing": "off",
5589
+ "@typescript-eslint/block-spacing": "off",
5590
+ "@typescript-eslint/brace-style": "off",
5591
+ "@typescript-eslint/comma-dangle": "off",
5592
+ "@typescript-eslint/comma-spacing": "off",
5593
+ "@typescript-eslint/func-call-spacing": "off",
5594
+ "@typescript-eslint/indent": "off",
5595
+ "@typescript-eslint/key-spacing": "off",
5596
+ "@typescript-eslint/keyword-spacing": "off",
5597
+ "@typescript-eslint/lines-around-comment": 0,
5598
+ "@typescript-eslint/member-delimiter-style": "off",
5599
+ "@typescript-eslint/no-extra-parens": "off",
5600
+ "@typescript-eslint/no-extra-semi": "off",
5601
+ "@typescript-eslint/object-curly-spacing": "off",
5602
+ "@typescript-eslint/quotes": 0,
5603
+ "@typescript-eslint/semi": "off",
5604
+ "@typescript-eslint/space-before-blocks": "off",
5605
+ "@typescript-eslint/space-before-function-paren": "off",
5606
+ "@typescript-eslint/space-infix-ops": "off",
5607
+ "@typescript-eslint/type-annotation-spacing": "off",
5608
+ "array-bracket-newline": "off",
5609
+ "array-bracket-spacing": "off",
5610
+ "array-element-newline": "off",
5611
+ "arrow-parens": "off",
5612
+ "arrow-spacing": "off",
5613
+ "block-spacing": "off",
5614
+ "brace-style": "off",
5615
+ "comma-dangle": "off",
5616
+ "comma-spacing": "off",
5617
+ "comma-style": "off",
5618
+ "computed-property-spacing": "off",
5619
+ curly: 0,
5620
+ "dot-location": "off",
5621
+ "eol-last": "off",
5622
+ "func-call-spacing": "off",
5623
+ "function-call-argument-newline": "off",
5624
+ "function-paren-newline": "off",
5625
+ "generator-star": "off",
5626
+ "generator-star-spacing": "off",
5627
+ "implicit-arrow-linebreak": "off",
5628
+ indent: "off",
5629
+ "indent-legacy": "off",
5630
+ "jsx-quotes": "off",
5631
+ "key-spacing": "off",
5632
+ "keyword-spacing": "off",
5633
+ "linebreak-style": "off",
5634
+ "lines-around-comment": 0,
5635
+ "max-len": 0,
5636
+ "max-statements-per-line": "off",
5637
+ "multiline-ternary": "off",
5638
+ "new-parens": "off",
5639
+ "newline-per-chained-call": "off",
5640
+ "no-arrow-condition": "off",
5641
+ "no-comma-dangle": "off",
5642
+ "no-confusing-arrow": 0,
5643
+ "no-extra-parens": "off",
5644
+ "no-extra-semi": "off",
5645
+ "no-floating-decimal": "off",
5646
+ "no-mixed-operators": 0,
5647
+ "no-mixed-spaces-and-tabs": "off",
5648
+ "no-multi-spaces": "off",
5649
+ "no-multiple-empty-lines": "off",
5650
+ "no-reserved-keys": "off",
5651
+ "no-space-before-semi": "off",
5652
+ "no-spaced-func": "off",
5653
+ "no-tabs": 0,
5654
+ "no-trailing-spaces": "off",
5655
+ "no-unexpected-multiline": 0,
5656
+ "no-whitespace-before-property": "off",
5657
+ "no-wrap-func": "off",
5658
+ "nonblock-statement-body-position": "off",
5659
+ "object-curly-newline": "off",
5660
+ "object-curly-spacing": "off",
5661
+ "object-property-newline": "off",
5662
+ "one-var-declaration-per-line": "off",
5663
+ "operator-linebreak": "off",
5664
+ "padded-blocks": "off",
5665
+ "quote-props": "off",
5666
+ quotes: 0,
5667
+ "react/jsx-child-element-spacing": "off",
5668
+ "react/jsx-closing-bracket-location": "off",
5669
+ "react/jsx-closing-tag-location": "off",
5670
+ "react/jsx-curly-newline": "off",
5671
+ "react/jsx-curly-spacing": "off",
5672
+ "react/jsx-equals-spacing": "off",
5673
+ "react/jsx-first-prop-new-line": "off",
5674
+ "react/jsx-indent": "off",
5675
+ "react/jsx-indent-props": "off",
5676
+ "react/jsx-max-props-per-line": "off",
5677
+ "react/jsx-newline": "off",
5678
+ "react/jsx-one-expression-per-line": "off",
5679
+ "react/jsx-props-no-multi-spaces": "off",
5680
+ "react/jsx-space-before-closing": "off",
5681
+ "react/jsx-tag-spacing": "off",
5682
+ "react/jsx-wrap-multilines": "off",
5683
+ "rest-spread-spacing": "off",
5684
+ semi: "off",
5685
+ "semi-spacing": "off",
5686
+ "semi-style": "off",
5687
+ "space-after-function-name": "off",
5688
+ "space-after-keywords": "off",
5689
+ "space-before-blocks": "off",
5690
+ "space-before-function-paren": "off",
5691
+ "space-before-function-parentheses": "off",
5692
+ "space-before-keywords": "off",
5693
+ "space-in-brackets": "off",
5694
+ "space-in-parens": "off",
5695
+ "space-infix-ops": "off",
5696
+ "space-return-throw-case": "off",
5697
+ "space-unary-ops": "off",
5698
+ "space-unary-word-ops": "off",
5699
+ "standard/array-bracket-even-spacing": "off",
5700
+ "standard/computed-property-even-spacing": "off",
5701
+ "standard/object-curly-even-spacing": "off",
5702
+ "switch-colon-spacing": "off",
5703
+ "template-curly-spacing": "off",
5704
+ "template-tag-spacing": "off",
5705
+ "unicorn/empty-brace-spaces": "off",
5706
+ "unicorn/no-nested-ternary": "off",
5707
+ "unicorn/number-literal-case": "off",
5708
+ "unicorn/template-indent": 0,
5709
+ "wrap-iife": "off",
5710
+ "wrap-regex": "off",
5711
+ "yield-star-spacing": "off"
5712
+ };
5713
+ //#endregion
5357
5714
  //#region src/configs/prettier.ts
5358
5715
  /**
5359
- * Copied from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
5716
+ * Generated from https://raw.githubusercontent.com/prettier/eslint-config-prettier/main/index.js
5360
5717
  * Main difference is we exclude rules we don't care about.... (flow/babel/etc)
5361
5718
  * @returns ESLint rules to disable when using Prettier
5362
5719
  */
5363
5720
  function eslintConfigPrettierRules() {
5364
- return {
5365
- "@typescript-eslint/block-spacing": "off",
5366
- "@typescript-eslint/brace-style": "off",
5367
- "@typescript-eslint/comma-dangle": "off",
5368
- "@typescript-eslint/comma-spacing": "off",
5369
- "@typescript-eslint/func-call-spacing": "off",
5370
- "@typescript-eslint/indent": "off",
5371
- "@typescript-eslint/key-spacing": "off",
5372
- "@typescript-eslint/keyword-spacing": "off",
5373
- "@typescript-eslint/lines-around-comment": 0,
5374
- "@typescript-eslint/member-delimiter-style": "off",
5375
- "@typescript-eslint/no-extra-parens": "off",
5376
- "@typescript-eslint/no-extra-semi": "off",
5377
- "@typescript-eslint/object-curly-spacing": "off",
5378
- "@typescript-eslint/quotes": 0,
5379
- "@typescript-eslint/semi": "off",
5380
- "@typescript-eslint/space-before-blocks": "off",
5381
- "@typescript-eslint/space-before-function-paren": "off",
5382
- "@typescript-eslint/space-infix-ops": "off",
5383
- "@typescript-eslint/type-annotation-spacing": "off",
5384
- "array-bracket-newline": "off",
5385
- "array-bracket-spacing": "off",
5386
- "array-element-newline": "off",
5387
- "arrow-parens": "off",
5388
- "arrow-spacing": "off",
5389
- "block-spacing": "off",
5390
- "brace-style": "off",
5391
- "comma-dangle": "off",
5392
- "comma-spacing": "off",
5393
- "comma-style": "off",
5394
- "computed-property-spacing": "off",
5395
- curly: 0,
5396
- "dot-location": "off",
5397
- "eol-last": "off",
5398
- "func-call-spacing": "off",
5399
- "function-call-argument-newline": "off",
5400
- "function-paren-newline": "off",
5401
- "generator-star-spacing": "off",
5402
- "implicit-arrow-linebreak": "off",
5403
- indent: "off",
5404
- "jsx-quotes": "off",
5405
- "key-spacing": "off",
5406
- "keyword-spacing": "off",
5407
- "linebreak-style": "off",
5408
- "lines-around-comment": 0,
5409
- "max-len": 0,
5410
- "max-statements-per-line": "off",
5411
- "multiline-ternary": "off",
5412
- "new-parens": "off",
5413
- "newline-per-chained-call": "off",
5414
- "no-confusing-arrow": 0,
5415
- "no-extra-parens": "off",
5416
- "no-extra-semi": "off",
5417
- "no-floating-decimal": "off",
5418
- "no-mixed-operators": 0,
5419
- "no-mixed-spaces-and-tabs": "off",
5420
- "no-multi-spaces": "off",
5421
- "no-multiple-empty-lines": "off",
5422
- "no-tabs": 0,
5423
- "no-trailing-spaces": "off",
5424
- "no-unexpected-multiline": 0,
5425
- "no-whitespace-before-property": "off",
5426
- "nonblock-statement-body-position": "off",
5427
- "object-curly-newline": "off",
5428
- "object-curly-spacing": "off",
5429
- "object-property-newline": "off",
5430
- "one-var-declaration-per-line": "off",
5431
- "operator-linebreak": "off",
5432
- "padded-blocks": "off",
5433
- "quote-props": "off",
5434
- quotes: 0,
5435
- "react/jsx-child-element-spacing": "off",
5436
- "react/jsx-closing-bracket-location": "off",
5437
- "react/jsx-closing-tag-location": "off",
5438
- "react/jsx-curly-newline": "off",
5439
- "react/jsx-curly-spacing": "off",
5440
- "react/jsx-equals-spacing": "off",
5441
- "react/jsx-first-prop-new-line": "off",
5442
- "react/jsx-indent": "off",
5443
- "react/jsx-indent-props": "off",
5444
- "react/jsx-max-props-per-line": "off",
5445
- "react/jsx-newline": "off",
5446
- "react/jsx-one-expression-per-line": "off",
5447
- "react/jsx-props-no-multi-spaces": "off",
5448
- "react/jsx-tag-spacing": "off",
5449
- "react/jsx-wrap-multilines": "off",
5450
- "rest-spread-spacing": "off",
5451
- semi: "off",
5452
- "semi-spacing": "off",
5453
- "semi-style": "off",
5454
- "space-before-blocks": "off",
5455
- "space-before-function-paren": "off",
5456
- "space-in-parens": "off",
5457
- "space-infix-ops": "off",
5458
- "space-unary-ops": "off",
5459
- "standard/array-bracket-even-spacing": "off",
5460
- "standard/computed-property-even-spacing": "off",
5461
- "standard/object-curly-even-spacing": "off",
5462
- "switch-colon-spacing": "off",
5463
- "template-curly-spacing": "off",
5464
- "template-tag-spacing": "off",
5465
- "unicorn/empty-brace-spaces": "off",
5466
- "unicorn/no-nested-ternary": "off",
5467
- "unicorn/number-literal-case": "off",
5468
- "wrap-iife": "off",
5469
- "wrap-regex": "off",
5470
- "yield-star-spacing": "off"
5471
- };
5721
+ return ESLINT_CONFIG_PRETTIER_RULES;
5472
5722
  }
5473
5723
  const prettier = () => {
5474
5724
  return [{
@@ -5478,19 +5728,292 @@ const prettier = () => {
5478
5728
  }];
5479
5729
  };
5480
5730
  //#endregion
5731
+ //#region src/configs/react/eslint-react.ts
5732
+ const REACT_PRESETS = /* @__PURE__ */ new Set([
5733
+ "recommended",
5734
+ "recommended-type-checked",
5735
+ "recommended-typescript",
5736
+ "strict",
5737
+ "strict-type-checked",
5738
+ "strict-typescript"
5739
+ ]);
5740
+ function isReactPreset(preset) {
5741
+ return REACT_PRESETS.has(preset);
5742
+ }
5743
+ function normalizeReactPreset(preset) {
5744
+ if (preset === void 0) return "recommended";
5745
+ if (!isReactPreset(preset)) {
5746
+ const validPresets = [...REACT_PRESETS].join(", ");
5747
+ throw new Error(`Unknown @eslint-react preset "${String(preset)}". Expected one of: ${validPresets}`);
5748
+ }
5749
+ return preset;
5750
+ }
5751
+ async function importReactPlugins() {
5752
+ return { pluginReact: await Promise.resolve(interopDefault(import("@eslint-react/eslint-plugin"))) };
5753
+ }
5754
+ const eslintReact = async (options) => {
5755
+ const { preset } = options ?? {};
5756
+ const { pluginReact } = await importReactPlugins();
5757
+ const coreReactPlugins = pluginReact.configs.all.plugins?.["@eslint-react"];
5758
+ if (!coreReactPlugins) throw new Error("coreReactPlugins is undefined");
5759
+ const presetRules = pluginReact.configs[normalizeReactPreset(preset)].rules;
5760
+ return [{
5761
+ files: [GLOB_SRC],
5762
+ name: "jsse/react/setup",
5763
+ plugins: { "@eslint-react": coreReactPlugins }
5764
+ }, {
5765
+ files: [GLOB_SRC],
5766
+ name: "jsse/react/rules",
5767
+ rules: { ...presetRules },
5768
+ settings: { react: { version: "detect" } }
5769
+ }];
5770
+ };
5771
+ //#endregion
5772
+ //#region src/configs/react/hooks.ts
5773
+ async function importPluginReactHooks() {
5774
+ try {
5775
+ return await interopDefault(import("eslint-plugin-react-hooks"));
5776
+ } catch (error) {
5777
+ throw new Error("eslint-plugin-react-hooks is not installed", { cause: error });
5778
+ }
5779
+ }
5780
+ const reactHooks = async ({ overrides = {}, preset = "recommended" } = {}) => {
5781
+ const pluginReactHooks = await importPluginReactHooks();
5782
+ const presetRules = pluginReactHooks.configs[preset].rules;
5783
+ return [{
5784
+ files: [GLOB_SRC],
5785
+ name: "jsse/react-hooks/rules",
5786
+ plugins: { "react-hooks": pluginReactHooks },
5787
+ rules: {
5788
+ "react-hooks/exhaustive-deps": "error",
5789
+ "react-hooks/rules-of-hooks": "error",
5790
+ ...presetRules,
5791
+ ...overrides
5792
+ },
5793
+ settings: { react: { version: "detect" } }
5794
+ }];
5795
+ };
5796
+ //#endregion
5797
+ //#region src/configs/react/refresh.ts
5798
+ async function importPluginReactRefresh() {
5799
+ try {
5800
+ return await interopDefault(import("eslint-plugin-react-refresh"));
5801
+ } catch (error) {
5802
+ throw new Error("eslint-plugin-react-refresh is not installed", { cause: error });
5803
+ }
5804
+ }
5805
+ const reactRefresh = async () => {
5806
+ const pluginReactRefresh = await importPluginReactRefresh();
5807
+ return [
5808
+ {
5809
+ files: [GLOB_SRC],
5810
+ name: "jsse/react-refresh/setup",
5811
+ plugins: { "react-refresh": pluginReactRefresh }
5812
+ },
5813
+ {
5814
+ files: [GLOB_SRC],
5815
+ name: "jsse/react/refresh",
5816
+ rules: { "react-refresh/only-export-components": "error" }
5817
+ },
5818
+ {
5819
+ files: ["**/*.stories.tsx"],
5820
+ name: "jsse/react-refresh/stories",
5821
+ rules: { "react-refresh/only-export-components": "off" }
5822
+ }
5823
+ ];
5824
+ };
5825
+ //#endregion
5826
+ //#region src/configs/react/react.ts
5827
+ const LEGACY_REACT_REFRESH_OPTION = "reactRefresh";
5828
+ const react = async (options) => {
5829
+ const { hooks = true, overrides, ...rest } = options ?? {};
5830
+ const refresh = options?.refresh ?? options?.[LEGACY_REACT_REFRESH_OPTION] ?? true;
5831
+ const config = [
5832
+ ...await eslintReact({
5833
+ ...rest,
5834
+ overrides
5835
+ }),
5836
+ ...hooks === false ? [] : await reactHooks({
5837
+ overrides,
5838
+ preset: hooks === true ? void 0 : hooks
5839
+ }),
5840
+ {
5841
+ files: [GLOB_JSX, GLOB_TSX],
5842
+ name: "jsse/react/disables",
5843
+ rules: { "unicorn/no-null": "off" }
5844
+ }
5845
+ ];
5846
+ if (refresh) config.push(...await reactRefresh());
5847
+ if (options?.overrides) config.push({
5848
+ files: [GLOB_JSX, GLOB_TSX],
5849
+ name: "jsse/react/overrides",
5850
+ rules: { ...options.overrides }
5851
+ });
5852
+ return config;
5853
+ };
5854
+ //#endregion
5481
5855
  //#region src/configs/regexp.ts
5482
5856
  const regexp = () => {
5483
5857
  const config = configs["flat/recommended"];
5484
- const rules = { ...config.rules };
5485
5858
  return [{
5486
5859
  ...config,
5487
5860
  files: [GLOB_SRC],
5488
5861
  name: "jsse/regexp/rules",
5489
- rules
5862
+ rules: { ...config.rules }
5490
5863
  }];
5491
5864
  };
5492
5865
  //#endregion
5493
5866
  //#region src/configs/sort-package-json.ts
5867
+ const WIREIT_SCRIPT_PATH = String.raw`wireit(?:\.[A-Za-z_$][\w$]*|\[[^\]]+\])`;
5868
+ const WIREIT_ENV_PATH_BASE = String.raw`${WIREIT_SCRIPT_PATH}\.env`;
5869
+ const WIREIT_SERVICE_PATH_BASE = String.raw`${WIREIT_SCRIPT_PATH}\.service`;
5870
+ const WIREIT_DEPENDENCY_PATH = String.raw`^${WIREIT_SCRIPT_PATH}\.dependencies\[\d+\]$`;
5871
+ const WIREIT_ENV_PATH = `^${WIREIT_ENV_PATH_BASE}$`;
5872
+ const WIREIT_ENV_VALUE_PATH = String.raw`^${WIREIT_ENV_PATH_BASE}(?:\.[A-Za-z_$][\w$]*|\[[^\]]+\])$`;
5873
+ const WIREIT_SERVICE_PATH = `^${WIREIT_SERVICE_PATH_BASE}$`;
5874
+ const WIREIT_READY_WHEN_PATH = String.raw`^${WIREIT_SERVICE_PATH_BASE}\.readyWhen$`;
5875
+ const PACKAGE_JSON_ORDER = [
5876
+ "$schema",
5877
+ "name",
5878
+ "displayName",
5879
+ "version",
5880
+ "stableVersion",
5881
+ "gitHead",
5882
+ "private",
5883
+ "description",
5884
+ "categories",
5885
+ "keywords",
5886
+ "homepage",
5887
+ "bugs",
5888
+ "license",
5889
+ "author",
5890
+ "maintainers",
5891
+ "contributors",
5892
+ "repository",
5893
+ "funding",
5894
+ "donate",
5895
+ "sponsor",
5896
+ "qna",
5897
+ "publisher",
5898
+ "man",
5899
+ "style",
5900
+ "example",
5901
+ "examplestyle",
5902
+ "assets",
5903
+ "bin",
5904
+ "source",
5905
+ "directories",
5906
+ "workspaces",
5907
+ "binary",
5908
+ "files",
5909
+ "os",
5910
+ "cpu",
5911
+ "libc",
5912
+ "type",
5913
+ "sideEffects",
5914
+ "main",
5915
+ "module",
5916
+ "browser",
5917
+ "types",
5918
+ "typings",
5919
+ "typesVersions",
5920
+ "typeScriptVersion",
5921
+ "typesPublisherContentHash",
5922
+ "react-native",
5923
+ "svelte",
5924
+ "unpkg",
5925
+ "jsdelivr",
5926
+ "jsnext:main",
5927
+ "umd",
5928
+ "umd:main",
5929
+ "es5",
5930
+ "esm5",
5931
+ "fesm5",
5932
+ "es2015",
5933
+ "esm2015",
5934
+ "fesm2015",
5935
+ "es2020",
5936
+ "esm2020",
5937
+ "fesm2020",
5938
+ "esnext",
5939
+ "imports",
5940
+ "exports",
5941
+ "publishConfig",
5942
+ "scripts",
5943
+ "betterScripts",
5944
+ "wireit",
5945
+ "dependencies",
5946
+ "devDependencies",
5947
+ "dependenciesMeta",
5948
+ "peerDependencies",
5949
+ "peerDependenciesMeta",
5950
+ "optionalDependencies",
5951
+ "bundledDependencies",
5952
+ "bundleDependencies",
5953
+ "resolutions",
5954
+ "overrides",
5955
+ "husky",
5956
+ "simple-git-hooks",
5957
+ "vite-staged",
5958
+ "lint-staged",
5959
+ "nano-staged",
5960
+ "pre-commit",
5961
+ "commitlint",
5962
+ "l10n",
5963
+ "contributes",
5964
+ "activationEvents",
5965
+ "extensionPack",
5966
+ "extensionDependencies",
5967
+ "extensionKind",
5968
+ "icon",
5969
+ "badges",
5970
+ "galleryBanner",
5971
+ "preview",
5972
+ "markdown",
5973
+ "napi",
5974
+ "flat",
5975
+ "config",
5976
+ "nodemonConfig",
5977
+ "browserify",
5978
+ "babel",
5979
+ "browserslist",
5980
+ "xo",
5981
+ "prettier",
5982
+ "eslintConfig",
5983
+ "eslintIgnore",
5984
+ "standard",
5985
+ "npmpkgjsonlint",
5986
+ "npmPackageJsonLintConfig",
5987
+ "npmpackagejsonlint",
5988
+ "release",
5989
+ "auto-changelog",
5990
+ "remarkConfig",
5991
+ "stylelint",
5992
+ "typescript",
5993
+ "typedoc",
5994
+ "tshy",
5995
+ "tsdown",
5996
+ "size-limit",
5997
+ "ava",
5998
+ "jest",
5999
+ "jest-junit",
6000
+ "jest-stare",
6001
+ "mocha",
6002
+ "nyc",
6003
+ "c8",
6004
+ "tap",
6005
+ "tsd",
6006
+ "typeCoverage",
6007
+ "oclif",
6008
+ "languageName",
6009
+ "preferGlobal",
6010
+ "devEngines",
6011
+ "engines",
6012
+ "engineStrict",
6013
+ "volta",
6014
+ "packageManager",
6015
+ "pnpm"
6016
+ ];
5494
6017
  /**
5495
6018
  * Sort package.json
5496
6019
  *
@@ -5509,53 +6032,7 @@ const sortPackageJson = () => {
5509
6032
  "jsonc/sort-keys": [
5510
6033
  "error",
5511
6034
  {
5512
- order: [
5513
- "publisher",
5514
- "name",
5515
- "displayName",
5516
- "type",
5517
- "version",
5518
- "private",
5519
- "packageManager",
5520
- "description",
5521
- "author",
5522
- "contributors",
5523
- "license",
5524
- "funding",
5525
- "homepage",
5526
- "repository",
5527
- "bugs",
5528
- "keywords",
5529
- "categories",
5530
- "sideEffects",
5531
- "imports",
5532
- "exports",
5533
- "main",
5534
- "module",
5535
- "unpkg",
5536
- "jsdelivr",
5537
- "types",
5538
- "typesVersions",
5539
- "bin",
5540
- "icon",
5541
- "files",
5542
- "engines",
5543
- "activationEvents",
5544
- "contributes",
5545
- "scripts",
5546
- "peerDependencies",
5547
- "peerDependenciesMeta",
5548
- "dependencies",
5549
- "optionalDependencies",
5550
- "devDependencies",
5551
- "pnpm",
5552
- "overrides",
5553
- "resolutions",
5554
- "husky",
5555
- "simple-git-hooks",
5556
- "lint-staged",
5557
- "eslintConfig"
5558
- ],
6035
+ order: [...PACKAGE_JSON_ORDER],
5559
6036
  pathPattern: "^$"
5560
6037
  },
5561
6038
  {
@@ -5566,6 +6043,60 @@ const sortPackageJson = () => {
5566
6043
  order: { type: "asc" },
5567
6044
  pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
5568
6045
  },
6046
+ {
6047
+ order: { type: "asc" },
6048
+ pathPattern: "^wireit$"
6049
+ },
6050
+ {
6051
+ order: [
6052
+ "command",
6053
+ "dependencies",
6054
+ "files",
6055
+ "output",
6056
+ {
6057
+ keyPattern: ".*",
6058
+ order: { type: "asc" }
6059
+ }
6060
+ ],
6061
+ pathPattern: `^${WIREIT_SCRIPT_PATH}$`
6062
+ },
6063
+ {
6064
+ order: [
6065
+ "script",
6066
+ "cascade",
6067
+ {
6068
+ keyPattern: ".*",
6069
+ order: { type: "asc" }
6070
+ }
6071
+ ],
6072
+ pathPattern: WIREIT_DEPENDENCY_PATH
6073
+ },
6074
+ {
6075
+ order: { type: "asc" },
6076
+ pathPattern: WIREIT_ENV_PATH
6077
+ },
6078
+ {
6079
+ order: [
6080
+ "external",
6081
+ "default",
6082
+ {
6083
+ keyPattern: ".*",
6084
+ order: { type: "asc" }
6085
+ }
6086
+ ],
6087
+ pathPattern: WIREIT_ENV_VALUE_PATH
6088
+ },
6089
+ {
6090
+ order: ["readyWhen", {
6091
+ keyPattern: ".*",
6092
+ order: { type: "asc" }
6093
+ }],
6094
+ pathPattern: WIREIT_SERVICE_PATH
6095
+ },
6096
+ {
6097
+ order: { type: "asc" },
6098
+ pathPattern: WIREIT_READY_WHEN_PATH
6099
+ },
5569
6100
  {
5570
6101
  order: [
5571
6102
  "types",
@@ -5722,15 +6253,23 @@ const sortTsconfig = (options) => {
5722
6253
  };
5723
6254
  //#endregion
5724
6255
  //#region src/configs/stylistic.ts
5725
- function jsxStylistic(indent) {
6256
+ function jsxStylistic(indent = 2) {
5726
6257
  return {
5727
6258
  "@stylistic/jsx-curly-brace-presence": ["error", { propElementValues: "always" }],
5728
6259
  "@stylistic/jsx-indent-props": ["error", { indentMode: indent === "tab" ? "tab" : indent }],
5729
6260
  "@stylistic/jsx-quotes": "error"
5730
6261
  };
5731
6262
  }
6263
+ async function importPluginStylistic() {
6264
+ try {
6265
+ return { pluginStylistic: await interopDefault(import("@stylistic/eslint-plugin")) };
6266
+ } catch (error) {
6267
+ console.error("Failed to import @stylistic/eslint-plugin; `pnpm add -D @stylistic/eslint-plugin`", error);
6268
+ throw error;
6269
+ }
6270
+ }
5732
6271
  const stylistic = async (options) => {
5733
- const { jsx = true, quotes = "double" } = options ?? {};
6272
+ const { jsx = true, overrides: overridesStylistic, quotes = "double" } = options ?? {};
5734
6273
  const hasIndent = options?.indent !== void 0;
5735
6274
  const indent = options?.indent ?? 2;
5736
6275
  const { pluginStylistic } = await importPluginStylistic();
@@ -5749,7 +6288,8 @@ const stylistic = async (options) => {
5749
6288
  avoidEscape: true
5750
6289
  }
5751
6290
  ],
5752
- ...jsx && jsxStylistic(indent)
6291
+ ...jsx && jsxStylistic(indent),
6292
+ ...overridesStylistic
5753
6293
  }
5754
6294
  }];
5755
6295
  };
@@ -5808,7 +6348,8 @@ function typescriptParser(options) {
5808
6348
  //#region src/configs/ts/typescript.ts
5809
6349
  const typescript = (options) => {
5810
6350
  dbg("typescript-options: %O", options);
5811
- const { componentExts = [], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [GLOB_MARKDOWN], overrides = {}, overridesTypeAware = {}, parserOptions = {}, prefix, strict = false, tsconfig: tsconfigPath, typeAware = true } = options ?? {};
6351
+ const { componentExts = [], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [GLOB_MARKDOWN], overrides = {}, overridesTypeAware = {}, parserOptions = {}, prefix, presets, strict = false, tsconfig: tsconfigPath, typeAware = true } = options ?? {};
6352
+ const strictProvided = options?.strict !== void 0;
5812
6353
  const hasCustomTypeAwareScope = options?.filesTypeAware !== void 0 || options?.ignoresTypeAware !== void 0;
5813
6354
  const parserConfigs = typeAware ? [typescriptParser({
5814
6355
  filesTypeAware,
@@ -5834,7 +6375,9 @@ const typescript = (options) => {
5834
6375
  const tsRules = {
5835
6376
  "no-invalid-this": "off",
5836
6377
  ...typescriptRules({
6378
+ presets,
5837
6379
  strict,
6380
+ strictProvided,
5838
6381
  typeAware: false
5839
6382
  }),
5840
6383
  ...overrides
@@ -5864,7 +6407,9 @@ const typescript = (options) => {
5864
6407
  name: "jsse/typescript/rules-type-aware",
5865
6408
  rules: renameRules({
5866
6409
  ...typescriptRules({
6410
+ presets,
5867
6411
  strict,
6412
+ strictProvided,
5868
6413
  typeAware: true
5869
6414
  }),
5870
6415
  ...overrides,
@@ -5902,9 +6447,7 @@ const typescript = (options) => {
5902
6447
  function unicornOff() {
5903
6448
  return {
5904
6449
  "unicorn/catch-error-name": "off",
5905
- "unicorn/comment-content": "off",
5906
6450
  "unicorn/consistent-boolean-name": "off",
5907
- "unicorn/consistent-destructuring": "off",
5908
6451
  "unicorn/name-replacements": "off",
5909
6452
  "unicorn/no-array-reduce": "off",
5910
6453
  "unicorn/no-nested-ternary": "off",
@@ -5915,6 +6458,16 @@ function unicornOff() {
5915
6458
  "unicorn/prevent-abbreviations": "off"
5916
6459
  };
5917
6460
  }
6461
+ function unicornSelectedRules() {
6462
+ return {
6463
+ "unicorn/better-regex": "error",
6464
+ "unicorn/custom-error-definition": "error",
6465
+ "unicorn/no-array-push-push": "error",
6466
+ "unicorn/no-hex-escape": "error",
6467
+ "unicorn/no-instanceof-array": "error",
6468
+ "unicorn/prefer-dom-node-dataset": "error"
6469
+ };
6470
+ }
5918
6471
  function unicornRecommended(pluginUnicorn) {
5919
6472
  const rules = pluginUnicorn.configs.recommended.rules;
5920
6473
  if (rules === void 0) throw new Error("Expected rules to be defined in unicorn plugin");
@@ -5936,59 +6489,7 @@ const unicorn = ({ overrides = {}, preset = "recommended" } = {}) => {
5936
6489
  rules: {
5937
6490
  ...unicornPresetRules(pluginUnicorn, preset),
5938
6491
  ...unicornOff(),
5939
- "unicorn/better-regex": "error",
5940
- "unicorn/consistent-empty-array-spread": "error",
5941
- "unicorn/custom-error-definition": "error",
5942
- "unicorn/error-message": "error",
5943
- "unicorn/escape-case": "error",
5944
- "unicorn/explicit-length-check": "error",
5945
- "unicorn/filename-case": "error",
5946
- "unicorn/new-for-builtins": "error",
5947
- "unicorn/no-array-callback-reference": "error",
5948
- "unicorn/no-array-method-this-argument": "error",
5949
- "unicorn/no-array-push-push": "error",
5950
- "unicorn/no-console-spaces": "error",
5951
- "unicorn/no-for-loop": "error",
5952
- "unicorn/no-hex-escape": "error",
5953
- "unicorn/no-instanceof-array": "error",
5954
- "unicorn/no-invalid-remove-event-listener": "error",
5955
- "unicorn/no-lonely-if": "error",
5956
- "unicorn/no-new-array": "error",
5957
- "unicorn/no-new-buffer": "error",
5958
- "unicorn/no-static-only-class": "error",
5959
- "unicorn/no-unnecessary-await": "error",
5960
- "unicorn/no-zero-fractions": "error",
5961
- "unicorn/number-literal-case": "error",
5962
- "unicorn/prefer-add-event-listener": "error",
5963
- "unicorn/prefer-array-find": "error",
5964
- "unicorn/prefer-array-flat-map": "error",
5965
- "unicorn/prefer-array-index-of": "error",
5966
- "unicorn/prefer-array-some": "error",
5967
- "unicorn/prefer-at": "error",
5968
- "unicorn/prefer-blob-reading-methods": "error",
5969
- "unicorn/prefer-date-now": "error",
5970
- "unicorn/prefer-dom-node-append": "error",
5971
- "unicorn/prefer-dom-node-dataset": "error",
5972
- "unicorn/prefer-dom-node-remove": "error",
5973
- "unicorn/prefer-dom-node-text-content": "error",
5974
- "unicorn/prefer-includes": "error",
5975
- "unicorn/prefer-keyboard-event-key": "error",
5976
- "unicorn/prefer-math-trunc": "error",
5977
- "unicorn/prefer-modern-dom-apis": "error",
5978
- "unicorn/prefer-modern-math-apis": "error",
5979
- "unicorn/prefer-negative-index": "error",
5980
- "unicorn/prefer-node-protocol": "error",
5981
- "unicorn/prefer-number-properties": "error",
5982
- "unicorn/prefer-prototype-methods": "error",
5983
- "unicorn/prefer-query-selector": "error",
5984
- "unicorn/prefer-reflect-apply": "error",
5985
- "unicorn/prefer-regexp-test": "error",
5986
- "unicorn/prefer-string-replace-all": "error",
5987
- "unicorn/prefer-string-slice": "error",
5988
- "unicorn/prefer-string-starts-ends-with": "error",
5989
- "unicorn/prefer-string-trim-start-end": "error",
5990
- "unicorn/prefer-type-error": "error",
5991
- "unicorn/throw-new-error": "error",
6492
+ ...unicornSelectedRules(),
5992
6493
  ...overrides
5993
6494
  }
5994
6495
  }, {
@@ -6001,6 +6502,27 @@ const unicorn = ({ overrides = {}, preset = "recommended" } = {}) => {
6001
6502
  }];
6002
6503
  };
6003
6504
  //#endregion
6505
+ //#region src/configs/unused-imports.ts
6506
+ const unusedImports = (options) => {
6507
+ const { isInEditor = false, overrides = {} } = options ?? {};
6508
+ return [{
6509
+ files: GLOB_CODE,
6510
+ name: "jsse/unused-imports",
6511
+ plugins: { "unused-imports": pluginUnusedImports },
6512
+ rules: {
6513
+ "unused-imports/no-unused-imports": isInEditor ? "off" : "error",
6514
+ "unused-imports/no-unused-vars": ["error", {
6515
+ args: "after-used",
6516
+ argsIgnorePattern: "^_",
6517
+ ignoreRestSiblings: true,
6518
+ vars: "all",
6519
+ varsIgnorePattern: "^_"
6520
+ }],
6521
+ ...overrides
6522
+ }
6523
+ }];
6524
+ };
6525
+ //#endregion
6004
6526
  //#region src/configs/vitest.ts
6005
6527
  const vitest = async (options = {}) => {
6006
6528
  const { overrides = {} } = options;
@@ -6037,7 +6559,6 @@ const yml = async (options) => {
6037
6559
  languageOptions: { parser: parserYaml },
6038
6560
  name: "jsse/yaml/rules",
6039
6561
  rules: {
6040
- "style/spaced-comment": "off",
6041
6562
  "yaml/block-mapping": "error",
6042
6563
  "yaml/block-sequence": "error",
6043
6564
  "yaml/no-empty-key": "error",
@@ -12687,6 +13208,7 @@ function defaultOptions() {
12687
13208
  typeAware: false,
12688
13209
  typescript: typescriptExists,
12689
13210
  unicorn: true,
13211
+ unusedImports: true,
12690
13212
  vitest: vitestExists,
12691
13213
  yaml: false
12692
13214
  };
@@ -12731,7 +13253,8 @@ const CODE_SCOPED_CFG_NAMES = /* @__PURE__ */ new Set([
12731
13253
  "jsse/perfectionist",
12732
13254
  "jsse/prettier/config",
12733
13255
  "jsse/stylistic",
12734
- "jsse/unicorn"
13256
+ "jsse/unicorn",
13257
+ "jsse/unused-imports"
12735
13258
  ]);
12736
13259
  function postProcessConfigs(configs, options) {
12737
13260
  const { componentExts, debug = false, off, rootId = "jsse", tsPrefix, typescript } = options;
@@ -12768,6 +13291,17 @@ const FLAT_CFG_PROPS = [
12768
13291
  "rules",
12769
13292
  "settings"
12770
13293
  ];
13294
+ function getReactRefreshOption(options) {
13295
+ const compatOptions = options;
13296
+ return options.refresh ?? compatOptions.reactRefresh;
13297
+ }
13298
+ async function gitignoreConfig(options) {
13299
+ if (options === false) return [];
13300
+ const flatGitignore = await interopDefault(import("./dist-DS02OtwI.js"));
13301
+ const config = options === true ? flatGitignore() : flatGitignore(options);
13302
+ dbg("Using eslint-config-flat-gitignore: %O", config);
13303
+ return [config];
13304
+ }
12771
13305
  /**
12772
13306
  * Construct an array of ESLint flat config items.
12773
13307
  * @param options Configuration options `@jsse/eslint-config` & ESLint Flat Config
@@ -12777,30 +13311,29 @@ const FLAT_CFG_PROPS = [
12777
13311
  async function jsse(options = {}, ...userConfigs) {
12778
13312
  const startTime = process$1.hrtime.bigint();
12779
13313
  const normalizedOptions = normalizeOptions(options);
12780
- const { antfu: antfuOptions, command: commandOptions, componentExts, debug = false, demorgan: deMorganOptions, e18e: e18eOptions, gitignore: enableGitignore, isInEditor, javascript: javascriptOptions, jsdoc: jsdocOptions, jsonc: enableJsonc, markdown: enableMarkdown, n: nOptions, nodeTest: nodeTestOptions, off, pnpm: pnpmOptions, prettier: enablePrettier, react: enableReact, regexp: enableRegexp, reportUnusedDisableDirectives, rootId, sortGeojson: enableSortGeojson, sortImports: enableSortImports, sortPackageJson: enableSortPackageJson, sortTsconfig: enableSortTsconfig, stylistic: stylisticOptions, tailwind: tailwindOptions, tsPrefix, typescript: typescriptOptions, unicorn: unicornOptions, vitest: enableVitest, yaml: enableYaml } = normalizedOptions;
13314
+ const { antfu: antfuOptions, command: commandOptions, componentExts, debug = false, demorgan: deMorganOptions, e18e: e18eOptions, gitignore: enableGitignore, isInEditor, javascript: javascriptOptions, jsdoc: jsdocOptions, jsonc: enableJsonc, markdown: enableMarkdown, n: nOptions, nodeTest: nodeTestOptions, off, pnpm: pnpmOptions, prettier: enablePrettier, react: enableReact, regexp: enableRegexp, reportUnusedDisableDirectives, rootId, sortGeojson: enableSortGeojson, sortImports: enableSortImports, sortPackageJson: enableSortPackageJson, sortTsconfig: enableSortTsconfig, stylistic: stylisticOptions, tailwind: tailwindOptions, tsPrefix, typescript: typescriptOptions, unicorn: unicornOptions, unusedImports: unusedImportsOptions, vitest: enableVitest, yaml: enableYaml } = normalizedOptions;
12781
13315
  if (debug || process$1.argv.includes("--debug")) enableDbg();
12782
13316
  dbg("@jsse/eslint-config debug=true");
12783
13317
  dbg("@jsse/eslint-config isInEditor: %O", isInEditor);
12784
13318
  dbg("@jsse/eslint-config enableTypeScript: %O", typescriptOptions);
12785
13319
  dbg("@jsse/eslint-config normalizedOptions: %O", normalizedOptions);
12786
13320
  const configs = [];
12787
- if (enableGitignore) if (typeof enableGitignore === "boolean") {
12788
- if (fs.existsSync(".gitignore")) configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => {
12789
- const res = r();
12790
- dbg("Using eslint-config-flat-gitignore res: %O", res);
12791
- return [res];
12792
- }));
12793
- } else configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => {
12794
- dbg("Using eslint-config-flat-gitignore: %O", r);
12795
- const res = r(enableGitignore);
12796
- dbg("Using eslint-config-flat-gitignore: %O", res);
12797
- return [res];
12798
- }));
13321
+ if (enableGitignore) configs.push(gitignoreConfig(enableGitignore));
12799
13322
  configs.push(ignores(), javascript({
12800
- isInEditor,
12801
13323
  ...javascriptOptions,
12802
13324
  reportUnusedDisableDirectives
12803
- }), eslintComments(), ...nOptions ? [n(typeof nOptions === "object" ? nOptions : void 0)] : [], ...jsdocOptions ? [jsdoc(typeof jsdocOptions === "object" ? jsdocOptions : void 0)] : [], imports({ stylistic: stylisticOptions }), ...unicornOptions ? [unicorn(typeof unicornOptions === "object" ? unicornOptions : {})] : [], ...antfuOptions ? [antfu(typeof antfuOptions === "object" ? antfuOptions : void 0)] : [], ...deMorganOptions ? [deMorgan(typeof deMorganOptions === "object" ? deMorganOptions : void 0)] : [], ...e18eOptions ? [e18e(typeof e18eOptions === "object" ? e18eOptions : {})] : []);
13325
+ }), eslintComments());
13326
+ if (unusedImportsOptions) configs.push(unusedImports({
13327
+ isInEditor,
13328
+ ...typeof unusedImportsOptions === "object" && unusedImportsOptions
13329
+ }));
13330
+ if (nOptions) configs.push(n(typeof nOptions === "object" ? nOptions : void 0));
13331
+ if (jsdocOptions) configs.push(jsdoc(typeof jsdocOptions === "object" ? jsdocOptions : void 0));
13332
+ configs.push(imports({ stylistic: stylisticOptions }));
13333
+ if (unicornOptions) configs.push(unicorn(typeof unicornOptions === "object" ? unicornOptions : {}));
13334
+ if (antfuOptions) configs.push(antfu(typeof antfuOptions === "object" ? antfuOptions : void 0));
13335
+ if (deMorganOptions) configs.push(deMorgan(typeof deMorganOptions === "object" ? deMorganOptions : void 0));
13336
+ if (e18eOptions) configs.push(e18e(typeof e18eOptions === "object" ? e18eOptions : {}));
12804
13337
  if (enableSortImports) configs.push(perfectionist());
12805
13338
  /**
12806
13339
  * =========================================================================
@@ -12844,9 +13377,9 @@ async function jsse(options = {}, ...userConfigs) {
12844
13377
  const ymlConfig = yml(typeof enableYaml === "object" ? enableYaml : void 0);
12845
13378
  configs.push(ymlConfig);
12846
13379
  }
12847
- if (enableReact) configs.push(eslintReact({
13380
+ if (enableReact) configs.push(react({
12848
13381
  ...typeof enableReact === "object" && enableReact,
12849
- reactRefresh: typeof enableReact === "object" && enableReact.reactRefresh !== void 0 ? enableReact.reactRefresh : normalizedOptions.reactRefresh !== false
13382
+ refresh: typeof enableReact === "object" && getReactRefreshOption(enableReact) !== void 0 ? getReactRefreshOption(enableReact) : normalizedOptions.reactRefresh !== false
12850
13383
  }));
12851
13384
  if (enablePrettier) configs.push(prettier());
12852
13385
  if (stylisticOptions) configs.push(stylistic(stylisticOptions === true ? {} : stylisticOptions));
@@ -12874,7 +13407,11 @@ async function jsse(options = {}, ...userConfigs) {
12874
13407
  return acc;
12875
13408
  }, {});
12876
13409
  if (Object.keys(fusedConfig).length > 0) configs.push([fusedConfig]);
12877
- const finalizedConfigs = postProcessConfigs(await combineAsync(...configs, ...userConfigs), {
13410
+ dbg("ENTER::combining-configs");
13411
+ const combinedConfigs = await combineAsync(...configs, ...userConfigs);
13412
+ dbg("EXIT::combining-configs");
13413
+ dbg("ENTER::post-processing configs");
13414
+ const finalizedConfigs = postProcessConfigs(combinedConfigs, {
12878
13415
  componentExts,
12879
13416
  debug,
12880
13417
  off,
@@ -12882,6 +13419,7 @@ async function jsse(options = {}, ...userConfigs) {
12882
13419
  tsPrefix,
12883
13420
  typescript: !!typescriptOptions
12884
13421
  });
13422
+ dbg("EXIT::post-processing configs");
12885
13423
  if (normalizedOptions.preReturn) {
12886
13424
  dbg("Running preReturn");
12887
13425
  const res = await normalizedOptions.preReturn(finalizedConfigs);