@jsse/eslint-config 0.8.5 → 0.8.7

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,8 +1,7 @@
1
1
  import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DJK8HYOj.js";
2
- import { n as SLOW_RULES, r as VERSION, t as DEBUG } from "./const-a9k0qaHM.js";
3
2
  import { builtinModules, createRequire } from "node:module";
4
- import process$1 from "node:process";
5
3
  import fs, { realpathSync, statSync } from "node:fs";
4
+ import process$1 from "node:process";
6
5
  import Debug from "debug";
7
6
  import pluginE18e from "@e18e/eslint-plugin";
8
7
  import pluginEslintComments from "@eslint-community/eslint-plugin-eslint-comments";
@@ -14,7 +13,7 @@ import pluginImportLite from "eslint-plugin-import-lite";
14
13
  import pluginN from "eslint-plugin-n";
15
14
  import pluginPerfectionist from "eslint-plugin-perfectionist";
16
15
  import pluginPnpm from "eslint-plugin-pnpm";
17
- import pluginRegexp, { configs } from "eslint-plugin-regexp";
16
+ import { configs } from "eslint-plugin-regexp";
18
17
  import pluginUnicorn from "eslint-plugin-unicorn";
19
18
  import pluginUnusedImports from "eslint-plugin-unused-imports";
20
19
  import createCommand from "eslint-plugin-command/config";
@@ -27,6 +26,9 @@ import { fileURLToPath, pathToFileURL } from "node:url";
27
26
  import assert from "node:assert";
28
27
  import v8 from "node:v8";
29
28
  import { format, inspect } from "node:util";
29
+ //#region src/_generated/version.ts
30
+ const VERSION = "0.8.7";
31
+ //#endregion
30
32
  //#region src/globs.ts
31
33
  var globs_exports = /* @__PURE__ */ __exportAll({
32
34
  GLOB_ALL_SRC: () => GLOB_ALL_SRC,
@@ -232,14 +234,6 @@ const warn = (...args) => {
232
234
  async function combineAsync(...configs) {
233
235
  return (await Promise.all(configs)).flatMap((config) => Array.isArray(config) ? config : [config]);
234
236
  }
235
- /**
236
- * Combine array and non-array configs into a single array.
237
- * @param configs configs to combine
238
- * @returns combined configs as an array
239
- */
240
- async function combine(...configs) {
241
- return combineAsync(...configs);
242
- }
243
237
  function renameRules(rules, from, to) {
244
238
  if (from === to) return rules;
245
239
  return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
@@ -319,7 +313,7 @@ const parserPlain = {
319
313
  };
320
314
  function turnOffRules(configs, off, debug) {
321
315
  if (off.length > 0) {
322
- for (const rule of off) dbg(`turning-off: ${rule}`);
316
+ dbg("turning off rules: %O", off);
323
317
  const currentlyActiveRules = /* @__PURE__ */ new Set();
324
318
  for (const config of configs) {
325
319
  const cfgRules = Object.keys(config.rules ?? {});
@@ -337,32 +331,10 @@ function turnOffRules(configs, off, debug) {
337
331
  for (const rule of off) if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) cfgRules[rule] = "off";
338
332
  }
339
333
  }
334
+ dbg("finished turning off rules");
340
335
  }
341
336
  return configs;
342
337
  }
343
- function changeRuleEntrySeverity(ruleConfig, level) {
344
- if (Array.isArray(ruleConfig)) {
345
- if (ruleConfig[0] !== level) ruleConfig[0] = level;
346
- return ruleConfig;
347
- }
348
- return level;
349
- }
350
- function error2warn(configs) {
351
- for (const config of configs) if (config.rules) config.rules = Object.fromEntries(Object.entries(config.rules).map(([key, value]) => {
352
- if (value === "error" || value === 2) return [key, changeRuleEntrySeverity(value, "warn")];
353
- if (Array.isArray(value) && (value[0] === "error" || value[0] === 2)) return [key, changeRuleEntrySeverity(value, "warn")];
354
- return [key, value];
355
- }));
356
- return configs;
357
- }
358
- function warn2error(configs) {
359
- for (const config of configs) if (config.rules) config.rules = Object.fromEntries(Object.entries(config.rules).map(([key, value]) => {
360
- if (value === "warn" || value === 1) return [key, changeRuleEntrySeverity(value, "error")];
361
- if (Array.isArray(value) && (value[0] === "warn" || value[0] === 1)) return [key, changeRuleEntrySeverity(value, "error")];
362
- return [key, value];
363
- }));
364
- return configs;
365
- }
366
338
  const TYPESCRIPT_ESLINT_PREFIX = "@typescript-eslint/";
367
339
  function replaceTypescriptEslintPrefixInplace(items, tsPrefix) {
368
340
  for (const [key, value] of Object.entries(items)) {
@@ -373,12 +345,6 @@ function replaceTypescriptEslintPrefixInplace(items, tsPrefix) {
373
345
  }
374
346
  //#endregion
375
347
  //#region src/plugins.ts
376
- async function importPluginReact() {
377
- return { pluginReact: await interopDefault(import("eslint-plugin-react")) };
378
- }
379
- async function importPluginReactRefresh() {
380
- return { pluginReactRefresh: await interopDefault(import("eslint-plugin-react-refresh")) };
381
- }
382
348
  async function importPluginMarkdown() {
383
349
  return { pluginMarkdown: await interopDefault(import("@eslint/markdown")) };
384
350
  }
@@ -392,7 +358,10 @@ const antfu = async (options) => {
392
358
  files: GLOB_CODE,
393
359
  name: "jsse/antfu",
394
360
  plugins: { antfu: pluginAntfu },
395
- rules: { "antfu/top-level-function": options?.topLevelFunction ?? "off" }
361
+ rules: {
362
+ "antfu/top-level-function": options?.topLevelFunction ?? "off",
363
+ ...options?.overrides
364
+ }
396
365
  }];
397
366
  };
398
367
  //#endregion
@@ -404,20 +373,29 @@ const antfu = async (options) => {
404
373
  * Docs: https://eslint-plugin-command.antfu.me/guide/
405
374
  * @returns Typed config arr
406
375
  */
407
- const command = async () => {
376
+ const command = async (options) => {
377
+ const config = createCommand();
408
378
  return [{
409
- ...createCommand(),
379
+ ...config,
410
380
  files: GLOB_CODE,
411
- name: "jsse/command/rules"
381
+ name: "jsse/command/rules",
382
+ rules: {
383
+ ...config.rules,
384
+ ...options?.overrides
385
+ }
412
386
  }];
413
387
  };
414
388
  //#endregion
415
389
  //#region src/configs/de-morgan.ts
416
- const deMorgan = async () => {
390
+ const deMorgan = async (options) => {
417
391
  return [{
418
392
  ...pluginDeMorgan.configs.recommended,
419
393
  files: GLOB_CODE,
420
- name: "jsse/de-morgan"
394
+ name: "jsse/de-morgan",
395
+ rules: {
396
+ ...pluginDeMorgan.configs.recommended.rules,
397
+ ...options?.overrides
398
+ }
421
399
  }];
422
400
  };
423
401
  //#endregion
@@ -504,7 +482,7 @@ async function importReactPlugins() {
504
482
  };
505
483
  }
506
484
  const eslintReact = async (options) => {
507
- const { componentExts, parserOptions = {}, react, reactRefresh, tsconfig } = options ?? {};
485
+ const { componentExts, overrides = {}, parserOptions = {}, react, reactRefresh, tsconfig } = options ?? {};
508
486
  const { pluginReact, pluginReactRefresh } = await importReactPlugins();
509
487
  const coreReactPlugins = pluginReact.configs.all.plugins?.["@eslint-react"];
510
488
  if (!coreReactPlugins) throw new Error("coreReactPlugins is undefined");
@@ -530,7 +508,8 @@ const eslintReact = async (options) => {
530
508
  rules: {
531
509
  ...pluginReact.configs.recommended.rules,
532
510
  "react/dom-no-string-style-prop": "off",
533
- "react/dom-no-unknown-property": "off"
511
+ "react/dom-no-unknown-property": "off",
512
+ ...overrides
534
513
  },
535
514
  settings: { react: { version: "detect" } }
536
515
  },
@@ -4913,7 +4892,7 @@ const javascript = async (options) => {
4913
4892
  };
4914
4893
  //#endregion
4915
4894
  //#region src/configs/jsdoc.ts
4916
- const jsdoc = async () => {
4895
+ const jsdoc = async (options) => {
4917
4896
  return [{
4918
4897
  files: GLOB_CODE,
4919
4898
  name: "jsse/jsdoc",
@@ -4936,7 +4915,8 @@ const jsdoc = async () => {
4936
4915
  "jsdoc/require-returns-check": "warn",
4937
4916
  "jsdoc/require-returns-description": "warn",
4938
4917
  "jsdoc/require-yields-check": "warn",
4939
- "jsdoc/tag-lines": "warn"
4918
+ "jsdoc/tag-lines": "warn",
4919
+ ...options?.overrides
4940
4920
  }
4941
4921
  }];
4942
4922
  };
@@ -5037,13 +5017,11 @@ function typescriptRulesTypeAware() {
5037
5017
  }],
5038
5018
  "@typescript-eslint/no-import-type-side-effects": "error",
5039
5019
  "@typescript-eslint/no-unnecessary-qualifier": "error",
5040
- "@typescript-eslint/no-redundant-type-constituents": "warn",
5041
5020
  "@typescript-eslint/require-array-sort-compare": ["error", { ignoreStringArrays: true }],
5042
5021
  "@typescript-eslint/no-floating-promises": ["error", {
5043
5022
  ignoreVoid: true,
5044
5023
  ignoreIIFE: true
5045
- }],
5046
- "@typescript-eslint/no-deprecated": "warn"
5024
+ }]
5047
5025
  };
5048
5026
  }
5049
5027
  function typescriptRulesTypeOblivious() {
@@ -5159,7 +5137,8 @@ function typescriptRulesTypeOblivious() {
5159
5137
  };
5160
5138
  }
5161
5139
  function tsPresetRules(props) {
5162
- return extractRules(props?.typeAware ? props.strict ? tseslint.configs.strictTypeChecked : tseslint.configs.recommendedTypeChecked : props?.strict ? tseslint.configs.strict : tseslint.configs.recommended);
5140
+ const tseslintConfig = props?.typeAware ? props.strict ? tseslint.configs.strictTypeChecked : tseslint.configs.recommendedTypeChecked : props?.strict ? tseslint.configs.strict : tseslint.configs.recommended;
5141
+ return extractRules(tseslintConfig);
5163
5142
  }
5164
5143
  function typescriptRules(props) {
5165
5144
  const normalized = {
@@ -5174,7 +5153,9 @@ function typescriptRules(props) {
5174
5153
  return {
5175
5154
  ...rulesFromPreset,
5176
5155
  ...typescriptRulesTypeOblivious(),
5177
- ...normalized.typeAware && typescriptRulesTypeAware()
5156
+ ...normalized.typeAware && typescriptRulesTypeAware(),
5157
+ ...normalized.typeAware && !normalized.strict && { "@typescript-eslint/no-deprecated": "error" },
5158
+ ...normalized.typeAware && normalized.strict && { "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: "only-allowed-literals" }] }
5178
5159
  };
5179
5160
  }
5180
5161
  //#endregion
@@ -5259,7 +5240,7 @@ const markdown = async (options) => {
5259
5240
  };
5260
5241
  //#endregion
5261
5242
  //#region src/configs/n.ts
5262
- const n = async () => {
5243
+ const n = async (options) => {
5263
5244
  return [{
5264
5245
  files: GLOB_CODE,
5265
5246
  name: "jsse/n",
@@ -5272,7 +5253,8 @@ const n = async () => {
5272
5253
  "n/no-path-concat": "error",
5273
5254
  "n/prefer-global/buffer": ["error", "never"],
5274
5255
  "n/prefer-global/process": ["error", "never"],
5275
- "n/process-exit-as-throw": "error"
5256
+ "n/process-exit-as-throw": "error",
5257
+ ...options?.overrides
5276
5258
  }
5277
5259
  }];
5278
5260
  };
@@ -5353,7 +5335,9 @@ const perfectionist = async () => {
5353
5335
  };
5354
5336
  //#endregion
5355
5337
  //#region src/configs/pnpm.ts
5356
- const pnpm = async () => {
5338
+ const pnpm = async (options) => {
5339
+ const jsonOverrides = Object.fromEntries(Object.entries(options?.overrides ?? {}).filter(([rule]) => rule.startsWith("pnpm/json-")));
5340
+ const yamlOverrides = Object.fromEntries(Object.entries(options?.overrides ?? {}).filter(([rule]) => rule.startsWith("pnpm/yaml-")));
5357
5341
  return [{
5358
5342
  files: ["package.json", "**/package.json"],
5359
5343
  languageOptions: { parser: await import("jsonc-eslint-parser") },
@@ -5362,7 +5346,8 @@ const pnpm = async () => {
5362
5346
  rules: {
5363
5347
  "pnpm/json-enforce-catalog": "error",
5364
5348
  "pnpm/json-prefer-workspace-settings": "error",
5365
- "pnpm/json-valid-catalog": "error"
5349
+ "pnpm/json-valid-catalog": "error",
5350
+ ...jsonOverrides
5366
5351
  }
5367
5352
  }, {
5368
5353
  files: ["pnpm-workspace.yaml"],
@@ -5371,7 +5356,8 @@ const pnpm = async () => {
5371
5356
  plugins: { pnpm: pluginPnpm },
5372
5357
  rules: {
5373
5358
  "pnpm/yaml-no-duplicate-catalog-item": "error",
5374
- "pnpm/yaml-no-unused-catalog-item": "error"
5359
+ "pnpm/yaml-no-unused-catalog-item": "error",
5360
+ ...yamlOverrides
5375
5361
  }
5376
5362
  }];
5377
5363
  };
@@ -5618,6 +5604,11 @@ const sortPackageJson = async () => {
5618
5604
  };
5619
5605
  //#endregion
5620
5606
  //#region src/configs/sort-tsconfig.ts
5607
+ /**
5608
+ * Sort tsconfig.json
5609
+ *
5610
+ * Requires `jsonc` config
5611
+ */
5621
5612
  const tsconfigGlobs = (extendGlobs) => {
5622
5613
  return extendGlobs === void 0 || extendGlobs.length === 0 ? GLOB_TSCONFIG : uniqueStrings(GLOB_TSCONFIG, extendGlobs);
5623
5614
  };
@@ -5894,7 +5885,7 @@ const typescript = async (options) => {
5894
5885
  });
5895
5886
  tsEslintConfigs.push({
5896
5887
  files: ["**/*.d.ts"],
5897
- name: "jsse/typescript:disables/dts",
5888
+ name: "jsse/typescript/disables/dts",
5898
5889
  rules: {
5899
5890
  "eslint-comments/no-unlimited-disable": "off",
5900
5891
  "import/no-duplicates": "off",
@@ -5903,14 +5894,14 @@ const typescript = async (options) => {
5903
5894
  }
5904
5895
  }, {
5905
5896
  files: ["**/*.{test,spec}.ts?(x)"],
5906
- name: "jsse/typescript:disable/test",
5897
+ name: "jsse/typescript/disables/test",
5907
5898
  rules: {
5908
5899
  "@typescript-eslint/no-unused-expressions": "off",
5909
5900
  "no-unused-expressions": "off"
5910
5901
  }
5911
5902
  }, {
5912
5903
  files: ["**/*.js", "**/*.cjs"],
5913
- name: "jsse/typescript/javascript-overrides",
5904
+ name: "jsse/typescript/disables/js",
5914
5905
  rules: {
5915
5906
  "@typescript-eslint/no-require-imports": "off",
5916
5907
  "@typescript-eslint/no-var-requires": "off"
@@ -5941,13 +5932,21 @@ function unicornRecommended(pluginUnicorn) {
5941
5932
  if (rules === void 0) throw new Error("Expected rules to be defined in unicorn plugin");
5942
5933
  return rules;
5943
5934
  }
5944
- const unicorn = async () => {
5935
+ function unicornPresetRules(pluginUnicorn, preset) {
5936
+ switch (preset) {
5937
+ case "recommended": return unicornRecommended(pluginUnicorn);
5938
+ case "unopinionated": return pluginUnicorn.configs.unopinionated.rules ?? {};
5939
+ case "all": return pluginUnicorn.configs.all.rules ?? {};
5940
+ default: throw new Error(`Unknown preset: ${preset}`);
5941
+ }
5942
+ }
5943
+ const unicorn = async ({ overrides = {}, preset = "recommended" } = {}) => {
5945
5944
  return [{
5946
5945
  files: GLOB_CODE,
5947
5946
  name: "jsse/unicorn",
5948
5947
  plugins: { unicorn: pluginUnicorn },
5949
5948
  rules: {
5950
- ...unicornRecommended(pluginUnicorn),
5949
+ ...unicornPresetRules(pluginUnicorn, preset),
5951
5950
  ...unicornOff(),
5952
5951
  "unicorn/better-regex": "error",
5953
5952
  "unicorn/consistent-empty-array-spread": "error",
@@ -6001,7 +6000,8 @@ const unicorn = async () => {
6001
6000
  "unicorn/prefer-string-starts-ends-with": "error",
6002
6001
  "unicorn/prefer-string-trim-start-end": "error",
6003
6002
  "unicorn/prefer-type-error": "error",
6004
- "unicorn/throw-new-error": "error"
6003
+ "unicorn/throw-new-error": "error",
6004
+ ...overrides
6005
6005
  }
6006
6006
  }, {
6007
6007
  files: GLOB_TESTS,
@@ -11748,7 +11748,8 @@ function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
11748
11748
  const format = extensionFormatMap[value];
11749
11749
  if (format) return format;
11750
11750
  if (ignoreErrors) return;
11751
- throw new ERR_UNKNOWN_FILE_EXTENSION(value, fileURLToPath(url));
11751
+ const filepath = fileURLToPath(url);
11752
+ throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath);
11752
11753
  }
11753
11754
  function getHttpProtocolModuleFormat() {}
11754
11755
  /**
@@ -11957,7 +11958,8 @@ function exportsNotFound(subpath, packageJsonUrl, base) {
11957
11958
  * @returns {never}
11958
11959
  */
11959
11960
  function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {
11960
- throw new ERR_INVALID_MODULE_SPECIFIER(request, `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath(packageJsonUrl)}`, base && fileURLToPath(base));
11961
+ const reason = `request is not a valid match in pattern "${match}" for the "${internal ? "imports" : "exports"}" resolution of ${fileURLToPath(packageJsonUrl)}`;
11962
+ throw new ERR_INVALID_MODULE_SPECIFIER(request, reason, base && fileURLToPath(base));
11961
11963
  }
11962
11964
  /**
11963
11965
  * @param {string} subpath
@@ -12616,21 +12618,70 @@ quansync(function* (name, cwd) {
12616
12618
  return name in (pkg.dependencies || {}) || name in (pkg.devDependencies || {});
12617
12619
  }).sync;
12618
12620
  //#endregion
12621
+ //#region src/const.ts
12622
+ /**
12623
+ * CONSTANTS LISTS AND REFERENCES OH MY!
12624
+ */
12625
+ const isEnvDebug = () => {
12626
+ return [
12627
+ "DEBUG",
12628
+ "JSSE_DEBUG",
12629
+ "JSSEDEBUG"
12630
+ ].some((env) => {
12631
+ const value = process$1.env[env];
12632
+ return [
12633
+ "1",
12634
+ "true",
12635
+ "t",
12636
+ "on",
12637
+ "yes",
12638
+ "y"
12639
+ ].includes(value ?? "");
12640
+ });
12641
+ };
12642
+ const DEBUG = isEnvDebug();
12643
+ const SLOW_RULES = [
12644
+ "@typescript-eslint/no-misused-promises",
12645
+ "@typescript-eslint/no-redeclare",
12646
+ "@typescript-eslint/no-unsafe-assignment",
12647
+ "@typescript-eslint/no-unsafe-call",
12648
+ "@typescript-eslint/no-unsafe-member-access",
12649
+ "@typescript-eslint/no-unsafe-return",
12650
+ "import/no-duplicates",
12651
+ "jsdoc/check-access",
12652
+ "jsdoc/check-alignment",
12653
+ "jsdoc/check-property-names",
12654
+ "jsdoc/check-types",
12655
+ "jsdoc/empty-tags",
12656
+ "jsdoc/multiline-blocks",
12657
+ "jsdoc/no-multi-asterisks",
12658
+ "jsdoc/require-property-description",
12659
+ "jsdoc/require-property-name",
12660
+ "jsdoc/require-property",
12661
+ "unicorn/expiring-todo-comments",
12662
+ "unicorn/no-unnecessary-polyfills"
12663
+ ];
12664
+ //#endregion
12619
12665
  //#region src/options.ts
12620
12666
  function defaultOptions() {
12621
12667
  const typescriptExists = isPackageExists("typescript");
12622
12668
  const vitestExists = isPackageExists("vitest");
12623
12669
  return {
12670
+ antfu: true,
12624
12671
  command: true,
12625
12672
  componentExts: [],
12626
12673
  debug: DEBUG && process$1.env.TEST !== "true",
12674
+ demorgan: true,
12675
+ diagnostics: true,
12676
+ e18e: true,
12627
12677
  fast: false,
12628
12678
  gitignore: true,
12629
12679
  isInEditor: isInEditor(),
12680
+ jsdoc: true,
12630
12681
  jsonc: true,
12631
12682
  markdown: false,
12683
+ n: true,
12632
12684
  off: [],
12633
- overrides: {},
12634
12685
  pnpm: false,
12635
12686
  prettier: true,
12636
12687
  react: false,
@@ -12647,15 +12698,24 @@ function defaultOptions() {
12647
12698
  tsPrefix: "@typescript-eslint",
12648
12699
  typeAware: false,
12649
12700
  typescript: typescriptExists,
12650
- warnings: true,
12701
+ unicorn: true,
12651
12702
  yaml: false
12652
12703
  };
12653
12704
  }
12654
- function normalizeOptions(options = {}) {
12655
- const off = [.../* @__PURE__ */ new Set([...options.off ?? [], ...options.fast ? [...SLOW_RULES] : []])].sort((a, b) => a.localeCompare(b, void 0, {
12705
+ function normalizeOff(off) {
12706
+ const offArr = [...off instanceof Set ? off : new Set(off)].sort((a, b) => a.localeCompare(b, void 0, {
12656
12707
  numeric: true,
12657
12708
  sensitivity: "base"
12658
12709
  }));
12710
+ const offSet = off instanceof Set ? off : new Set(off);
12711
+ if (offArr.length !== offSet.size && offArr.length > 1) {
12712
+ for (let i = 1; i < offArr.length; i++) if (offArr[i] === offArr[i - 1]) warn(`Duplicate rule "${offArr[i]}" found in the "off" array`);
12713
+ }
12714
+ return offArr;
12715
+ }
12716
+ function normalizeOptions(options = {}) {
12717
+ const configuredOff = normalizeOff(options.off ?? []);
12718
+ const off = options.fast ? normalizeOff(/* @__PURE__ */ new Set([...configuredOff, ...SLOW_RULES])) : configuredOff;
12659
12719
  const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? { ...options.stylistic } : {};
12660
12720
  if (stylisticOptions && !("jsx" in stylisticOptions)) stylisticOptions.jsx = options.jsx ?? true;
12661
12721
  const defaults = defaultOptions();
@@ -12726,8 +12786,9 @@ const FLAT_CFG_PROPS = [
12726
12786
  * @returns Array of ESLint flat config items
12727
12787
  */
12728
12788
  async function jsse(options = {}, ...userConfigs) {
12789
+ const startTime = process$1.hrtime.bigint();
12729
12790
  const normalizedOptions = normalizeOptions(options);
12730
- const { command: enableCommand, componentExts, debug = false, gitignore: enableGitignore, isInEditor, jsonc: enableJsonc, markdown: enableMarkdown, off, overrides = {}, pnpm: enablePnpm, prettier: enablePrettier, react: enableReact, regexp: enableRegexp, reportUnusedDisableDirectives, rootId, sortGeojson: enableSortGeojson, sortImports: enableSortImports, sortPackageJson: enableSortPackageJson, sortTsconfig: enableSortTsconfig, stylistic: stylisticOptions, tailwind: tailwindOptions, test: enableTest, tsPrefix, typescript: typescriptOptions, yaml: enableYaml } = normalizedOptions;
12791
+ 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, off, pnpm: pnpmOptions, prettier: enablePrettier, react: enableReact, regexp: enableRegexp, reportUnusedDisableDirectives, rootId, sortGeojson: enableSortGeojson, sortImports: enableSortImports, sortPackageJson: enableSortPackageJson, sortTsconfig: enableSortTsconfig, stylistic: stylisticOptions, tailwind: tailwindOptions, test: enableTest, tsPrefix, typescript: typescriptOptions, unicorn: unicornOptions, yaml: enableYaml } = normalizedOptions;
12731
12792
  if (debug || process$1.argv.includes("--debug")) enableDbg();
12732
12793
  dbg("@jsse/eslint-config debug=true");
12733
12794
  dbg("@jsse/eslint-config isInEditor: %O", isInEditor);
@@ -12748,22 +12809,22 @@ async function jsse(options = {}, ...userConfigs) {
12748
12809
  }));
12749
12810
  configs.push(ignores(), javascript({
12750
12811
  isInEditor,
12751
- overrides: overrides.javascript,
12812
+ ...javascriptOptions,
12752
12813
  reportUnusedDisableDirectives
12753
- }), eslintComments(), n(), jsdoc(), imports({ stylistic: stylisticOptions }), unicorn(), antfu(), deMorgan(), e18e());
12814
+ }), 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 : {})] : []);
12754
12815
  if (enableSortImports) configs.push(perfectionist());
12755
12816
  /**
12756
12817
  * =========================================================================
12757
12818
  * COMMAND
12758
12819
  * ========================================================================
12759
12820
  */
12760
- if (enableCommand) configs.push(command());
12821
+ if (commandOptions) configs.push(command(typeof commandOptions === "object" ? commandOptions : void 0));
12761
12822
  /**
12762
12823
  * =========================================================================
12763
12824
  * PNPM
12764
12825
  * ========================================================================
12765
12826
  */
12766
- if (enablePnpm) configs.push(pnpm());
12827
+ if (pnpmOptions) configs.push(pnpm(typeof pnpmOptions === "object" ? pnpmOptions : void 0));
12767
12828
  /**
12768
12829
  * =========================================================================
12769
12830
  * TYPESCRIPT
@@ -12775,13 +12836,11 @@ async function jsse(options = {}, ...userConfigs) {
12775
12836
  const tscfg = typescript({
12776
12837
  ...typeof typescriptOptions !== "boolean" && typescriptOptions,
12777
12838
  componentExts,
12778
- overrides: overrides.typescript,
12779
- overridesTypeAware: typeof typescriptOptions === "object" ? typescriptOptions.overridesTypeAware : void 0,
12780
12839
  prefix: {
12781
12840
  from: "@typescript-eslint",
12782
12841
  to: tsPrefix ?? "@typescript-eslint"
12783
12842
  },
12784
- react: enableReact,
12843
+ react: !!enableReact,
12785
12844
  typeAware: effectiveTypeAware
12786
12845
  });
12787
12846
  configs.push(tscfg);
@@ -12789,26 +12848,39 @@ async function jsse(options = {}, ...userConfigs) {
12789
12848
  ignores: [GLOB_TS, GLOB_TSX],
12790
12849
  name: "jsse/ignores/typescript-disabled"
12791
12850
  }]);
12792
- if (enableMarkdown) configs.push(markdown());
12851
+ if (enableMarkdown) configs.push(markdown({
12852
+ componentExts,
12853
+ ...typeof enableMarkdown === "object" && enableMarkdown
12854
+ }));
12793
12855
  if (enableYaml) {
12794
- const ymlConfig = yml();
12856
+ const ymlConfig = yml(typeof enableYaml === "object" ? enableYaml : void 0);
12795
12857
  configs.push(ymlConfig);
12796
12858
  }
12797
- if (enableReact) configs.push(eslintReact({ reactRefresh: normalizedOptions.reactRefresh !== false }));
12859
+ if (enableReact) configs.push(eslintReact({
12860
+ componentExts,
12861
+ parserOptions: normalizedOptions.parserOptions,
12862
+ ...typeof typescriptOptions === "object" && { tsconfig: typescriptOptions.tsconfig },
12863
+ ...typeof enableReact === "object" && enableReact,
12864
+ react: true,
12865
+ reactRefresh: typeof enableReact === "object" && enableReact.reactRefresh !== void 0 ? enableReact.reactRefresh : normalizedOptions.reactRefresh !== false
12866
+ }));
12798
12867
  if (enablePrettier) configs.push(prettier());
12799
12868
  if (stylisticOptions) configs.push(stylistic(stylisticOptions === true ? {} : stylisticOptions));
12800
12869
  if (enableRegexp) configs.push(regexp());
12801
12870
  if (enableTest) configs.push(vitest({
12802
12871
  isInEditor,
12803
- overrides: overrides.test
12872
+ ...typeof enableTest === "object" && enableTest
12804
12873
  }), noOnlyTests({ isInEditor }));
12805
12874
  if (enableJsonc) {
12806
12875
  configs.push(jsonc({
12807
- overrides: overrides.jsonc,
12808
- stylistic: stylisticOptions
12876
+ stylistic: stylisticOptions,
12877
+ ...typeof enableJsonc === "object" && enableJsonc
12809
12878
  }));
12810
12879
  if (enableSortPackageJson) configs.push(sortPackageJson());
12811
- if (enableSortTsconfig) configs.push(sortTsconfig({ extendTsconfigGlobs: normalizedOptions.extendTsconfigLintGlobs }));
12880
+ if (enableSortTsconfig) configs.push(sortTsconfig({
12881
+ extendTsconfigGlobs: typeof enableSortTsconfig === "object" ? enableSortTsconfig.extendTsconfigGlobs : normalizedOptions.extendTsconfigLintGlobs,
12882
+ ...typeof enableSortTsconfig === "object" && enableSortTsconfig
12883
+ }));
12812
12884
  if (enableSortGeojson) configs.push(sortGeojson());
12813
12885
  }
12814
12886
  if (tailwindOptions) console.error("Tailwind configuration is deprecated...");
@@ -12830,22 +12902,16 @@ async function jsse(options = {}, ...userConfigs) {
12830
12902
  const res = await normalizedOptions.preReturn(finalizedConfigs);
12831
12903
  dbg("preReturn finished");
12832
12904
  dbg("final config", res);
12905
+ const endTime = process$1.hrtime.bigint();
12906
+ dbg("defineConfig completed in %d ms", Number(endTime - startTime) / 1e6);
12833
12907
  return res;
12834
12908
  }
12909
+ const endTime = process$1.hrtime.bigint();
12910
+ dbg("defineConfig completed in %d ms", Number(endTime - startTime) / 1e6);
12835
12911
  return finalizedConfigs;
12836
12912
  }
12837
12913
  async function defineConfig(options = {}, ...userConfigs) {
12838
12914
  return jsse(options, ...userConfigs);
12839
12915
  }
12840
12916
  //#endregion
12841
- //#region src/presets.ts
12842
- const jsseReact = (options, ...configs) => {
12843
- return jsse({
12844
- react: true,
12845
- reactRefresh: true,
12846
- typescript: { tsconfig: ["./tsconfig.json", "./tsconfig.eslint.json"] },
12847
- ...options
12848
- }, ...configs);
12849
- };
12850
- //#endregion
12851
- export { SLOW_RULES, VERSION, changeRuleEntrySeverity, combine, combineAsync, jsse as default, jsse, defaultOptions, defineConfig, error2warn, globs_exports as globs, importPluginMarkdown, importPluginReact, importPluginReactRefresh, importPluginStylistic, interopDefault, isCI, isInEditor, jsseReact, normalizeOptions, parserPlain, parserTs, pluginAntfu, pluginDeMorgan, pluginE18e, pluginEslintComments, pluginImportLite, pluginN, pluginPerfectionist, pluginPnpm, pluginRegexp, pluginTs, pluginUnicorn, pluginUnusedImports, renameRules, replaceTypescriptEslintPrefixInplace, scopeTypeScriptRules, turnOffRules, uniqueStrings, warn2error };
12917
+ export { VERSION, jsse as default, jsse, defaultOptions, defineConfig, globs_exports as globs };
@@ -1 +1 @@
1
- {"root":["../src/cli.ts","../src/config-fns.ts","../src/configs.test.ts","../src/const.ts","../src/define-config.ts","../src/fixable.test.ts","../src/fixable.ts","../src/globs.ts","../src/index.ts","../src/lager.ts","../src/options.test.ts","../src/options.ts","../src/plugins-all.test.ts","../src/plugins-all.ts","../src/plugins.ts","../src/postprocess.test.ts","../src/postprocess.ts","../src/presets.ts","../src/types.ts","../src/utils.ts","../src/_generated/fixable-rules-map.ts","../src/_generated/rule-options.d.ts","../src/_generated/version.ts","../src/_generated/dts/antfu.d.ts","../src/_generated/dts/builtins.d.ts","../src/_generated/dts/command.d.ts","../src/_generated/dts/de-morgan.d.ts","../src/_generated/dts/e18e.d.ts","../src/_generated/dts/eslint-comments.d.ts","../src/_generated/dts/eslint-react.d.ts","../src/_generated/dts/ignores.d.ts","../src/_generated/dts/imports.d.ts","../src/_generated/dts/javascript.d.ts","../src/_generated/dts/jsdoc.d.ts","../src/_generated/dts/jsonc.d.ts","../src/_generated/dts/markdown.d.ts","../src/_generated/dts/n.d.ts","../src/_generated/dts/no-only-tests.d.ts","../src/_generated/dts/perfectionist.d.ts","../src/_generated/dts/pnpm.d.ts","../src/_generated/dts/prettier.d.ts","../src/_generated/dts/react-hooks.d.ts","../src/_generated/dts/regexp.d.ts","../src/_generated/dts/sort-package-json.d.ts","../src/_generated/dts/sort-tsconfig.d.ts","../src/_generated/dts/stylistic.d.ts","../src/_generated/dts/toml.d.ts","../src/_generated/dts/typescript.d.ts","../src/_generated/dts/unicorn.d.ts","../src/_generated/dts/vitest.d.ts","../src/_generated/dts/yml.d.ts","../src/configs/_template.ts","../src/configs/antfu.ts","../src/configs/command.ts","../src/configs/de-morgan.ts","../src/configs/disables.ts","../src/configs/e18e.ts","../src/configs/eslint-comments.ts","../src/configs/eslint-react.ts","../src/configs/ignores.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/configs/jsdoc.ts","../src/configs/jsonc.ts","../src/configs/markdown.ts","../src/configs/n.ts","../src/configs/no-only-tests.ts","../src/configs/perfectionist.ts","../src/configs/pnpm.ts","../src/configs/prettier.ts","../src/configs/react-hooks.ts","../src/configs/react.ts","../src/configs/regexp.ts","../src/configs/rules.test.ts","../src/configs/sort-geojson.ts","../src/configs/sort-package-json.ts","../src/configs/sort-tsconfig.ts","../src/configs/stylistic.ts","../src/configs/toml.ts","../src/configs/tsdoc.ts","../src/configs/unicorn.ts","../src/configs/vitest.ts","../src/configs/yml.ts","../src/configs/_legacy/tailwind.ts","../src/configs/ts/parser.ts","../src/configs/ts/requires-type-checking.ts","../src/configs/ts/typescript-language-options.ts","../src/configs/ts/typescript-rules.ts","../src/configs/ts/typescript.ts"],"version":"6.0.3"}
1
+ {"root":["../src/cli.ts","../src/config-registry.test.ts","../src/config-registry.ts","../src/const.ts","../src/define-config.ts","../src/fixable.test.ts","../src/fixable.ts","../src/globs.ts","../src/index.ts","../src/lager.ts","../src/options.test.ts","../src/options.ts","../src/plugin-registry.test.ts","../src/plugin-registry.ts","../src/plugins.ts","../src/postprocess.test.ts","../src/postprocess.ts","../src/types.ts","../src/utils.ts","../src/_generated/fixable-rules-map.ts","../src/_generated/rule-options.d.ts","../src/_generated/version.ts","../src/_generated/dts/antfu.d.ts","../src/_generated/dts/builtins.d.ts","../src/_generated/dts/command.d.ts","../src/_generated/dts/de-morgan.d.ts","../src/_generated/dts/e18e.d.ts","../src/_generated/dts/eslint-comments.d.ts","../src/_generated/dts/eslint-react.d.ts","../src/_generated/dts/ignores.d.ts","../src/_generated/dts/imports.d.ts","../src/_generated/dts/javascript.d.ts","../src/_generated/dts/jsdoc.d.ts","../src/_generated/dts/jsonc.d.ts","../src/_generated/dts/markdown.d.ts","../src/_generated/dts/n.d.ts","../src/_generated/dts/no-only-tests.d.ts","../src/_generated/dts/perfectionist.d.ts","../src/_generated/dts/pnpm.d.ts","../src/_generated/dts/prettier.d.ts","../src/_generated/dts/react-hooks.d.ts","../src/_generated/dts/regexp.d.ts","../src/_generated/dts/sort-package-json.d.ts","../src/_generated/dts/sort-tsconfig.d.ts","../src/_generated/dts/stylistic.d.ts","../src/_generated/dts/toml.d.ts","../src/_generated/dts/typescript.d.ts","../src/_generated/dts/unicorn.d.ts","../src/_generated/dts/vitest.d.ts","../src/_generated/dts/yml.d.ts","../src/configs/_template.ts","../src/configs/antfu.ts","../src/configs/command.ts","../src/configs/de-morgan.ts","../src/configs/disables.ts","../src/configs/e18e.ts","../src/configs/eslint-comments.ts","../src/configs/eslint-react.ts","../src/configs/ignores.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/configs/jsdoc.ts","../src/configs/jsonc.ts","../src/configs/markdown.ts","../src/configs/n.ts","../src/configs/no-only-tests.ts","../src/configs/perfectionist.ts","../src/configs/pnpm.ts","../src/configs/prettier.ts","../src/configs/react-hooks.ts","../src/configs/react.ts","../src/configs/regexp.ts","../src/configs/rules.test.ts","../src/configs/sort-geojson.ts","../src/configs/sort-package-json.ts","../src/configs/sort-tsconfig.ts","../src/configs/stylistic.ts","../src/configs/toml.ts","../src/configs/tsdoc.ts","../src/configs/unicorn.ts","../src/configs/vitest.ts","../src/configs/yml.ts","../src/configs/_legacy/tailwind.ts","../src/configs/_legacy/typescript-legacy-rules.ts","../src/configs/ts/parser.ts","../src/configs/ts/requires-type-checking.ts","../src/configs/ts/typescript-language-options.ts","../src/configs/ts/typescript-rules.ts","../src/configs/ts/typescript.ts"],"version":"6.0.3"}