@jsse/eslint-config 0.2.19 → 0.2.21

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.
Files changed (137) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.cjs +1 -1
  3. package/dist/cli.js +1 -1
  4. package/dist/esm/cli.d.ts +1 -0
  5. package/dist/esm/cli.js +96 -0
  6. package/dist/esm/cli.js.map +1 -0
  7. package/dist/esm/config-fns.d.ts +56 -0
  8. package/dist/esm/config-fns.js +76 -0
  9. package/dist/esm/config-fns.js.map +1 -0
  10. package/dist/esm/configs/antfu.d.ts +4 -0
  11. package/dist/esm/configs/antfu.js +31 -0
  12. package/dist/esm/configs/antfu.js.map +1 -0
  13. package/dist/esm/configs/comments.d.ts +2 -0
  14. package/dist/esm/configs/comments.js +17 -0
  15. package/dist/esm/configs/comments.js.map +1 -0
  16. package/dist/esm/configs/gql.d.ts +2 -0
  17. package/dist/esm/configs/gql.js +5 -0
  18. package/dist/esm/configs/gql.js.map +1 -0
  19. package/dist/esm/configs/ignores.d.ts +2 -0
  20. package/dist/esm/configs/ignores.js +10 -0
  21. package/dist/esm/configs/ignores.js.map +1 -0
  22. package/dist/esm/configs/imports.d.ts +2 -0
  23. package/dist/esm/configs/imports.js +30 -0
  24. package/dist/esm/configs/imports.js.map +1 -0
  25. package/dist/esm/configs/javascript.d.ts +6 -0
  26. package/dist/esm/configs/javascript.js +263 -0
  27. package/dist/esm/configs/javascript.js.map +1 -0
  28. package/dist/esm/configs/jsdoc.d.ts +2 -0
  29. package/dist/esm/configs/jsdoc.js +32 -0
  30. package/dist/esm/configs/jsdoc.js.map +1 -0
  31. package/dist/esm/configs/jsonc.d.ts +4 -0
  32. package/dist/esm/configs/jsonc.js +77 -0
  33. package/dist/esm/configs/jsonc.js.map +1 -0
  34. package/dist/esm/configs/markdown.d.ts +4 -0
  35. package/dist/esm/configs/markdown.js +123 -0
  36. package/dist/esm/configs/markdown.js.map +1 -0
  37. package/dist/esm/configs/n.d.ts +2 -0
  38. package/dist/esm/configs/n.js +22 -0
  39. package/dist/esm/configs/n.js.map +1 -0
  40. package/dist/esm/configs/no-only-tests.d.ts +4 -0
  41. package/dist/esm/configs/no-only-tests.js +32 -0
  42. package/dist/esm/configs/no-only-tests.js.map +1 -0
  43. package/dist/esm/configs/perfectionist.d.ts +7 -0
  44. package/dist/esm/configs/perfectionist.js +61 -0
  45. package/dist/esm/configs/perfectionist.js.map +1 -0
  46. package/dist/esm/configs/prettier.d.ts +7 -0
  47. package/dist/esm/configs/prettier.js +127 -0
  48. package/dist/esm/configs/prettier.js.map +1 -0
  49. package/dist/esm/configs/react.d.ts +6 -0
  50. package/dist/esm/configs/react.js +302 -0
  51. package/dist/esm/configs/react.js.map +1 -0
  52. package/dist/esm/configs/sort-package-json.d.ts +7 -0
  53. package/dist/esm/configs/sort-package-json.js +90 -0
  54. package/dist/esm/configs/sort-package-json.js.map +1 -0
  55. package/dist/esm/configs/sort-tsconfig.d.ts +14 -0
  56. package/dist/esm/configs/sort-tsconfig.js +134 -0
  57. package/dist/esm/configs/sort-tsconfig.js.map +1 -0
  58. package/dist/esm/configs/stylistic.d.ts +2 -0
  59. package/dist/esm/configs/stylistic.js +38 -0
  60. package/dist/esm/configs/stylistic.js.map +1 -0
  61. package/dist/esm/configs/tailwind.d.ts +2 -0
  62. package/dist/esm/configs/tailwind.js +49 -0
  63. package/dist/esm/configs/tailwind.js.map +1 -0
  64. package/dist/esm/configs/toml.d.ts +2 -0
  65. package/dist/esm/configs/toml.js +51 -0
  66. package/dist/esm/configs/toml.js.map +1 -0
  67. package/dist/esm/configs/ts/parser.d.ts +7 -0
  68. package/dist/esm/configs/ts/parser.js +66 -0
  69. package/dist/esm/configs/ts/parser.js.map +1 -0
  70. package/dist/esm/configs/ts/requires-type-checking.d.ts +1 -0
  71. package/dist/esm/configs/ts/requires-type-checking.js +58 -0
  72. package/dist/esm/configs/ts/requires-type-checking.js.map +1 -0
  73. package/dist/esm/configs/ts/typescript-language-options.d.ts +2 -0
  74. package/dist/esm/configs/ts/typescript-language-options.js +23 -0
  75. package/dist/esm/configs/ts/typescript-language-options.js.map +1 -0
  76. package/dist/esm/configs/ts/typescript-rules.d.ts +6 -0
  77. package/dist/esm/configs/ts/typescript-rules.js +416 -0
  78. package/dist/esm/configs/ts/typescript-rules.js.map +1 -0
  79. package/dist/esm/configs/ts/typescript.d.ts +4 -0
  80. package/dist/esm/configs/ts/typescript.js +110 -0
  81. package/dist/esm/configs/ts/typescript.js.map +1 -0
  82. package/dist/esm/configs/tsdoc.d.ts +2 -0
  83. package/dist/esm/configs/tsdoc.js +17 -0
  84. package/dist/esm/configs/tsdoc.js.map +1 -0
  85. package/dist/esm/configs/unicorn.d.ts +2 -0
  86. package/dist/esm/configs/unicorn.js +116 -0
  87. package/dist/esm/configs/unicorn.js.map +1 -0
  88. package/dist/esm/configs/vitest.d.ts +4 -0
  89. package/dist/esm/configs/vitest.js +30 -0
  90. package/dist/esm/configs/vitest.js.map +1 -0
  91. package/dist/esm/configs/yml.d.ts +4 -0
  92. package/dist/esm/configs/yml.js +52 -0
  93. package/dist/esm/configs/yml.js.map +1 -0
  94. package/dist/esm/const.d.ts +5 -0
  95. package/dist/esm/const.js +12 -0
  96. package/dist/esm/const.js.map +1 -0
  97. package/dist/esm/define-config.d.ts +7 -0
  98. package/dist/esm/define-config.js +234 -0
  99. package/dist/esm/define-config.js.map +1 -0
  100. package/dist/esm/dev.d.ts +4 -0
  101. package/dist/esm/dev.js +26 -0
  102. package/dist/esm/dev.js.map +1 -0
  103. package/dist/esm/fixable.d.ts +1 -0
  104. package/dist/esm/fixable.js +390 -0
  105. package/dist/esm/fixable.js.map +1 -0
  106. package/dist/esm/globs.d.ts +25 -0
  107. package/dist/esm/globs.js +74 -0
  108. package/dist/esm/globs.js.map +1 -0
  109. package/dist/esm/index.d.ts +8 -0
  110. package/dist/esm/index.js +9 -0
  111. package/dist/esm/index.js.map +1 -0
  112. package/dist/esm/lager.d.ts +31 -0
  113. package/dist/esm/lager.js +87 -0
  114. package/dist/esm/lager.js.map +1 -0
  115. package/dist/esm/plugindex.d.ts +7 -0
  116. package/dist/esm/plugindex.js +61 -0
  117. package/dist/esm/plugindex.js.map +1 -0
  118. package/dist/esm/plugins-all.d.ts +23 -0
  119. package/dist/esm/plugins-all.js +27 -0
  120. package/dist/esm/plugins-all.js.map +1 -0
  121. package/dist/esm/plugins.d.ts +983 -0
  122. package/dist/esm/plugins.js +113 -0
  123. package/dist/esm/plugins.js.map +1 -0
  124. package/dist/esm/presets.d.ts +2 -0
  125. package/dist/esm/presets.js +13 -0
  126. package/dist/esm/presets.js.map +1 -0
  127. package/dist/esm/types.d.ts +255 -0
  128. package/dist/esm/types.js +2 -0
  129. package/dist/esm/types.js.map +1 -0
  130. package/dist/esm/utils.d.ts +51 -0
  131. package/dist/esm/utils.js +157 -0
  132. package/dist/esm/utils.js.map +1 -0
  133. package/dist/index.cjs +908 -307
  134. package/dist/index.d.cts +207 -25
  135. package/dist/index.d.ts +207 -25
  136. package/dist/index.js +909 -315
  137. package/package.json +23 -14
package/dist/index.js CHANGED
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  mod
25
25
  ));
26
26
 
27
- // node_modules/.pnpm/globals@15.10.0/node_modules/globals/globals.json
27
+ // node_modules/.pnpm/globals@15.11.0/node_modules/globals/globals.json
28
28
  var require_globals = __commonJS({
29
- "node_modules/.pnpm/globals@15.10.0/node_modules/globals/globals.json"(exports, module) {
29
+ "node_modules/.pnpm/globals@15.11.0/node_modules/globals/globals.json"(exports, module) {
30
30
  module.exports = {
31
31
  amd: {
32
32
  define: false,
@@ -1954,6 +1954,38 @@ var require_globals = __commonJS({
1954
1954
  WeakRef: false,
1955
1955
  WeakSet: false
1956
1956
  },
1957
+ es3: {
1958
+ Array: false,
1959
+ Boolean: false,
1960
+ Date: false,
1961
+ decodeURI: false,
1962
+ decodeURIComponent: false,
1963
+ encodeURI: false,
1964
+ encodeURIComponent: false,
1965
+ Error: false,
1966
+ escape: false,
1967
+ eval: false,
1968
+ EvalError: false,
1969
+ Function: false,
1970
+ Infinity: false,
1971
+ isFinite: false,
1972
+ isNaN: false,
1973
+ Math: false,
1974
+ NaN: false,
1975
+ Number: false,
1976
+ Object: false,
1977
+ parseFloat: false,
1978
+ parseInt: false,
1979
+ RangeError: false,
1980
+ ReferenceError: false,
1981
+ RegExp: false,
1982
+ String: false,
1983
+ SyntaxError: false,
1984
+ TypeError: false,
1985
+ undefined: false,
1986
+ unescape: false,
1987
+ URIError: false
1988
+ },
1957
1989
  es5: {
1958
1990
  Array: false,
1959
1991
  Boolean: false,
@@ -2968,9 +3000,9 @@ var require_globals = __commonJS({
2968
3000
  }
2969
3001
  });
2970
3002
 
2971
- // node_modules/.pnpm/globals@15.10.0/node_modules/globals/index.js
3003
+ // node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js
2972
3004
  var require_globals2 = __commonJS({
2973
- "node_modules/.pnpm/globals@15.10.0/node_modules/globals/index.js"(exports, module) {
3005
+ "node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js"(exports, module) {
2974
3006
  "use strict";
2975
3007
  module.exports = require_globals();
2976
3008
  }
@@ -2986,7 +3018,7 @@ var SLOW_RULES = [
2986
3018
  "unicorn/no-unnecessary-polyfills"
2987
3019
  ];
2988
3020
 
2989
- // src/factory.ts
3021
+ // src/define-config.ts
2990
3022
  import fs2 from "node:fs";
2991
3023
  import process6 from "node:process";
2992
3024
 
@@ -6097,11 +6129,11 @@ var pp$4 = Parser.prototype;
6097
6129
  pp$4.raise = function(pos, message) {
6098
6130
  var loc = getLineInfo(this.input, pos);
6099
6131
  message += " (" + loc.line + ":" + loc.column + ")";
6100
- var err = new SyntaxError(message);
6101
- err.pos = pos;
6102
- err.loc = loc;
6103
- err.raisedAt = this.pos;
6104
- throw err;
6132
+ var err2 = new SyntaxError(message);
6133
+ err2.pos = pos;
6134
+ err2.loc = loc;
6135
+ err2.raisedAt = this.pos;
6136
+ throw err2;
6105
6137
  };
6106
6138
  pp$4.raiseRecoverable = pp$4.raise;
6107
6139
  pp$4.curPosition = function() {
@@ -8171,11 +8203,11 @@ pp.tryReadTemplateToken = function() {
8171
8203
  this.inTemplateElement = true;
8172
8204
  try {
8173
8205
  this.readTmplToken();
8174
- } catch (err) {
8175
- if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
8206
+ } catch (err2) {
8207
+ if (err2 === INVALID_TEMPLATE_ESCAPE_ERROR) {
8176
8208
  this.readInvalidTemplateToken();
8177
8209
  } else {
8178
- throw err;
8210
+ throw err2;
8179
8211
  }
8180
8212
  }
8181
8213
  this.inTemplateElement = false;
@@ -8414,11 +8446,11 @@ Parser.acorn = {
8414
8446
  nonASCIIwhitespace
8415
8447
  };
8416
8448
 
8417
- // node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
8449
+ // node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs
8418
8450
  import { builtinModules, createRequire } from "node:module";
8419
8451
  import fs, { realpathSync, statSync, promises } from "node:fs";
8420
8452
 
8421
- // node_modules/.pnpm/ufo@1.5.3/node_modules/ufo/dist/index.mjs
8453
+ // node_modules/.pnpm/ufo@1.5.4/node_modules/ufo/dist/index.mjs
8422
8454
  var r = String.fromCharCode;
8423
8455
  var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
8424
8456
  var JOIN_LEADING_SLASH_RE = /^\.?\//;
@@ -8471,7 +8503,7 @@ var isAbsolute = function(p) {
8471
8503
  return _IS_ABSOLUTE_RE.test(p);
8472
8504
  };
8473
8505
 
8474
- // node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
8506
+ // node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs
8475
8507
  import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL as pathToFileURL$1 } from "node:url";
8476
8508
  import assert from "node:assert";
8477
8509
  import process$1 from "node:process";
@@ -9786,7 +9818,7 @@ function _resolve(id, options = {}) {
9786
9818
  for (const prefix of ["", "/index"]) {
9787
9819
  for (const extension of options.extensions || DEFAULT_EXTENSIONS) {
9788
9820
  resolved = _tryModuleResolve(
9789
- id + prefix + extension,
9821
+ joinURL(id, prefix) + extension,
9790
9822
  url,
9791
9823
  conditionsSet
9792
9824
  );
@@ -9847,138 +9879,651 @@ function resolvePackage(name, options = {}) {
9847
9879
  }
9848
9880
  }
9849
9881
 
9850
- // src/globs.ts
9851
- var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
9852
- var GLOB_JS_SRC_EXT = "?([cm])js?(x)";
9853
- var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
9854
- var GLOB_JS = "**/*.?([cm])js";
9855
- var GLOB_JSX = "**/*.?([cm])jsx";
9856
- var GLOB_TS = "**/*.?([cm])ts";
9857
- var GLOB_TSX = "**/*.?([cm])tsx";
9858
- var GLOB_STYLE = "**/*.{c,le,sc}ss";
9859
- var GLOB_CSS = "**/*.css";
9860
- var GLOB_LESS = "**/*.less";
9861
- var GLOB_SCSS = "**/*.scss";
9862
- var GLOB_JSON = "**/*.json";
9863
- var GLOB_JSON5 = "**/*.json5";
9864
- var GLOB_JSONC = "**/*.jsonc";
9865
- var GLOB_TOML = "**/*.toml";
9866
- var GLOB_MARKDOWN = "**/*.md";
9867
- var GLOB_GRAPHQL = ["**/*.graphql", "**/*.gql"];
9868
- var GLOB_YAML = "**/*.y?(a)ml";
9869
- var GLOB_HTML = "**/*.htm?(l)";
9870
- var GLOB_TSCONFIG = ["**/tsconfig.json", "**/tsconfig.*.json"];
9871
- var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
9872
- var GLOB_TESTS = [
9873
- `**/__tests__/**/*.${GLOB_SRC_EXT}`,
9874
- `**/*.spec.${GLOB_SRC_EXT}`,
9875
- `**/*.test.${GLOB_SRC_EXT}`,
9876
- `**/*.bench.${GLOB_SRC_EXT}`,
9877
- `**/*.benchmark.${GLOB_SRC_EXT}`
9878
- ];
9879
- var GLOB_ALL_SRC = [
9880
- GLOB_SRC,
9881
- GLOB_STYLE,
9882
- GLOB_JSON,
9883
- GLOB_JSON5,
9884
- GLOB_MARKDOWN,
9885
- GLOB_YAML,
9886
- GLOB_HTML
9887
- ];
9888
- var GLOB_EXCLUDE = [
9889
- "**/__snapshots__",
9890
- "**/.cache",
9891
- "**/.changeset",
9892
- "**/.history",
9893
- "**/.idea",
9894
- "**/.next",
9895
- "**/.nuxt",
9896
- "**/.output",
9897
- "**/.temp",
9898
- "**/.tmp",
9899
- "**/.vercel",
9900
- "**/.vite-inspect",
9901
- "**/.vitepress/cache",
9902
- "**/*.bak",
9903
- "**/*.min.*",
9904
- "**/.yarn",
9905
- "**/.pnp.*",
9906
- "**/auto-import?(s).d.ts",
9907
- "**/bun.lockb",
9908
- "**/CHANGELOG*.md",
9909
- "**/components.d.ts",
9910
- "**/coverage",
9911
- "**/dist",
9912
- "**/LICENSE*",
9913
- "**/node_modules",
9914
- "**/out",
9915
- "**/output",
9916
- "**/package-lock.json",
9917
- "**/pnpm-lock.yaml",
9918
- "**/scratch",
9919
- "**/temp",
9920
- "**/tmp",
9921
- "**/yarn.lock"
9922
- ];
9923
-
9924
- // src/utils.ts
9925
- import process3 from "node:process";
9926
- async function combine(...configs) {
9927
- const resolved = await Promise.all(configs);
9928
- return resolved.flat();
9929
- }
9930
- async function combineAsync(...configs) {
9931
- const resolved = await Promise.all(configs);
9932
- return resolved.flatMap(
9933
- (config) => Array.isArray(config) ? config : [config]
9934
- );
9935
- }
9936
- function renameRules(rules, from, to) {
9937
- if (from === to) {
9938
- return rules;
9882
+ // node_modules/.pnpm/neverthrow@8.0.0/node_modules/neverthrow/dist/index.es.js
9883
+ var defaultErrorConfig = {
9884
+ withStackTrace: false
9885
+ };
9886
+ var createNeverThrowError = (message, result, config = defaultErrorConfig) => {
9887
+ const data2 = result.isOk() ? { type: "Ok", value: result.value } : { type: "Err", value: result.error };
9888
+ const maybeStack = config.withStackTrace ? new Error().stack : void 0;
9889
+ return {
9890
+ data: data2,
9891
+ message,
9892
+ stack: maybeStack
9893
+ };
9894
+ };
9895
+ function __awaiter(thisArg, _arguments, P, generator) {
9896
+ function adopt(value) {
9897
+ return value instanceof P ? value : new P(function(resolve2) {
9898
+ resolve2(value);
9899
+ });
9939
9900
  }
9940
- return Object.fromEntries(
9941
- Object.entries(rules).map(([key, value]) => {
9942
- if (key.startsWith(from)) {
9943
- return [to + key.slice(from.length), value];
9901
+ return new (P || (P = Promise))(function(resolve2, reject) {
9902
+ function fulfilled(value) {
9903
+ try {
9904
+ step(generator.next(value));
9905
+ } catch (e) {
9906
+ reject(e);
9944
9907
  }
9945
- return [key, value];
9946
- })
9947
- );
9948
- }
9949
- async function interopDefault2(m) {
9950
- const resolved = await m;
9951
- return resolved.default || resolved;
9952
- }
9953
- function isCI() {
9954
- return !!process3.env.CI;
9908
+ }
9909
+ function rejected(value) {
9910
+ try {
9911
+ step(generator["throw"](value));
9912
+ } catch (e) {
9913
+ reject(e);
9914
+ }
9915
+ }
9916
+ function step(result) {
9917
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
9918
+ }
9919
+ step((generator = generator.apply(thisArg, [])).next());
9920
+ });
9955
9921
  }
9956
- function isInEditor() {
9957
- return !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE) && !isCI());
9922
+ function __values(o) {
9923
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
9924
+ if (m) return m.call(o);
9925
+ if (o && typeof o.length === "number") return {
9926
+ next: function() {
9927
+ if (o && i >= o.length) o = void 0;
9928
+ return { value: o && o[i++], done: !o };
9929
+ }
9930
+ };
9931
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
9932
+ }
9933
+ function __await(v) {
9934
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
9935
+ }
9936
+ function __asyncGenerator(thisArg, _arguments, generator) {
9937
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
9938
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
9939
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
9940
+ return this;
9941
+ }, i;
9942
+ function verb(n2) {
9943
+ if (g[n2]) i[n2] = function(v) {
9944
+ return new Promise(function(a, b) {
9945
+ q.push([n2, v, a, b]) > 1 || resume(n2, v);
9946
+ });
9947
+ };
9948
+ }
9949
+ function resume(n2, v) {
9950
+ try {
9951
+ step(g[n2](v));
9952
+ } catch (e) {
9953
+ settle(q[0][3], e);
9954
+ }
9955
+ }
9956
+ function step(r2) {
9957
+ r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
9958
+ }
9959
+ function fulfill(value) {
9960
+ resume("next", value);
9961
+ }
9962
+ function reject(value) {
9963
+ resume("throw", value);
9964
+ }
9965
+ function settle(f, v) {
9966
+ if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
9967
+ }
9968
+ }
9969
+ function __asyncDelegator(o) {
9970
+ var i, p;
9971
+ return i = {}, verb("next"), verb("throw", function(e) {
9972
+ throw e;
9973
+ }), verb("return"), i[Symbol.iterator] = function() {
9974
+ return this;
9975
+ }, i;
9976
+ function verb(n2, f) {
9977
+ i[n2] = o[n2] ? function(v) {
9978
+ return (p = !p) ? { value: __await(o[n2](v)), done: n2 === "return" } : f ? f(v) : v;
9979
+ } : f;
9980
+ }
9981
+ }
9982
+ function __asyncValues(o) {
9983
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
9984
+ var m = o[Symbol.asyncIterator], i;
9985
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
9986
+ return this;
9987
+ }, i);
9988
+ function verb(n2) {
9989
+ i[n2] = o[n2] && function(v) {
9990
+ return new Promise(function(resolve2, reject) {
9991
+ v = o[n2](v), settle(resolve2, reject, v.done, v.value);
9992
+ });
9993
+ };
9994
+ }
9995
+ function settle(resolve2, reject, d, v) {
9996
+ Promise.resolve(v).then(function(v2) {
9997
+ resolve2({ value: v2, done: d });
9998
+ }, reject);
9999
+ }
9958
10000
  }
9959
- function uniqueStrings(...strings) {
9960
- const set = /* @__PURE__ */ new Set();
9961
- for (const item of strings) {
9962
- if (typeof item === "string") {
9963
- set.add(item);
9964
- } else {
9965
- for (const str of item) {
9966
- set.add(str);
10001
+ var ResultAsync = class _ResultAsync {
10002
+ constructor(res) {
10003
+ this._promise = res;
10004
+ }
10005
+ static fromSafePromise(promise) {
10006
+ const newPromise = promise.then((value) => new Ok(value));
10007
+ return new _ResultAsync(newPromise);
10008
+ }
10009
+ static fromPromise(promise, errorFn) {
10010
+ const newPromise = promise.then((value) => new Ok(value)).catch((e) => new Err(errorFn(e)));
10011
+ return new _ResultAsync(newPromise);
10012
+ }
10013
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10014
+ static fromThrowable(fn, errorFn) {
10015
+ return (...args) => {
10016
+ return new _ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
10017
+ try {
10018
+ return new Ok(yield fn(...args));
10019
+ } catch (error) {
10020
+ return new Err(errorFn ? errorFn(error) : error);
10021
+ }
10022
+ }))());
10023
+ };
10024
+ }
10025
+ static combine(asyncResultList) {
10026
+ return combineResultAsyncList(asyncResultList);
10027
+ }
10028
+ static combineWithAllErrors(asyncResultList) {
10029
+ return combineResultAsyncListWithAllErrors(asyncResultList);
10030
+ }
10031
+ map(f) {
10032
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10033
+ if (res.isErr()) {
10034
+ return new Err(res.error);
10035
+ }
10036
+ return new Ok(yield f(res.value));
10037
+ })));
10038
+ }
10039
+ andThrough(f) {
10040
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10041
+ if (res.isErr()) {
10042
+ return new Err(res.error);
9967
10043
  }
10044
+ const newRes = yield f(res.value);
10045
+ if (newRes.isErr()) {
10046
+ return new Err(newRes.error);
10047
+ }
10048
+ return new Ok(res.value);
10049
+ })));
10050
+ }
10051
+ andTee(f) {
10052
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10053
+ if (res.isErr()) {
10054
+ return new Err(res.error);
10055
+ }
10056
+ try {
10057
+ yield f(res.value);
10058
+ } catch (e) {
10059
+ }
10060
+ return new Ok(res.value);
10061
+ })));
10062
+ }
10063
+ mapErr(f) {
10064
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10065
+ if (res.isOk()) {
10066
+ return new Ok(res.value);
10067
+ }
10068
+ return new Err(yield f(res.error));
10069
+ })));
10070
+ }
10071
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10072
+ andThen(f) {
10073
+ return new _ResultAsync(this._promise.then((res) => {
10074
+ if (res.isErr()) {
10075
+ return new Err(res.error);
10076
+ }
10077
+ const newValue = f(res.value);
10078
+ return newValue instanceof _ResultAsync ? newValue._promise : newValue;
10079
+ }));
10080
+ }
10081
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10082
+ orElse(f) {
10083
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10084
+ if (res.isErr()) {
10085
+ return f(res.error);
10086
+ }
10087
+ return new Ok(res.value);
10088
+ })));
10089
+ }
10090
+ match(ok2, _err) {
10091
+ return this._promise.then((res) => res.match(ok2, _err));
10092
+ }
10093
+ unwrapOr(t) {
10094
+ return this._promise.then((res) => res.unwrapOr(t));
10095
+ }
10096
+ /**
10097
+ * Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
10098
+ */
10099
+ safeUnwrap() {
10100
+ return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
10101
+ return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
10102
+ });
10103
+ }
10104
+ // Makes ResultAsync implement PromiseLike<Result>
10105
+ then(successCallback, failureCallback) {
10106
+ return this._promise.then(successCallback, failureCallback);
10107
+ }
10108
+ };
10109
+ var errAsync = (err2) => new ResultAsync(Promise.resolve(new Err(err2)));
10110
+ var fromPromise = ResultAsync.fromPromise;
10111
+ var fromSafePromise = ResultAsync.fromSafePromise;
10112
+ var fromAsyncThrowable = ResultAsync.fromThrowable;
10113
+ var combineResultList = (resultList) => {
10114
+ let acc = ok([]);
10115
+ for (const result of resultList) {
10116
+ if (result.isErr()) {
10117
+ acc = err(result.error);
10118
+ break;
10119
+ } else {
10120
+ acc.map((list) => list.push(result.value));
9968
10121
  }
9969
10122
  }
9970
- return [...set];
10123
+ return acc;
10124
+ };
10125
+ var combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
10126
+ var combineResultListWithAllErrors = (resultList) => {
10127
+ let acc = ok([]);
10128
+ for (const result of resultList) {
10129
+ if (result.isErr() && acc.isErr()) {
10130
+ acc.error.push(result.error);
10131
+ } else if (result.isErr() && acc.isOk()) {
10132
+ acc = err([result.error]);
10133
+ } else if (result.isOk() && acc.isOk()) {
10134
+ acc.value.push(result.value);
10135
+ }
10136
+ }
10137
+ return acc;
10138
+ };
10139
+ var combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
10140
+ var Result;
10141
+ (function(Result2) {
10142
+ function fromThrowable2(fn, errorFn) {
10143
+ return (...args) => {
10144
+ try {
10145
+ const result = fn(...args);
10146
+ return ok(result);
10147
+ } catch (e) {
10148
+ return err(errorFn ? errorFn(e) : e);
10149
+ }
10150
+ };
10151
+ }
10152
+ Result2.fromThrowable = fromThrowable2;
10153
+ function combine2(resultList) {
10154
+ return combineResultList(resultList);
10155
+ }
10156
+ Result2.combine = combine2;
10157
+ function combineWithAllErrors(resultList) {
10158
+ return combineResultListWithAllErrors(resultList);
10159
+ }
10160
+ Result2.combineWithAllErrors = combineWithAllErrors;
10161
+ })(Result || (Result = {}));
10162
+ var ok = (value) => new Ok(value);
10163
+ function err(err2) {
10164
+ return new Err(err2);
9971
10165
  }
10166
+ var Ok = class {
10167
+ constructor(value) {
10168
+ this.value = value;
10169
+ }
10170
+ isOk() {
10171
+ return true;
10172
+ }
10173
+ isErr() {
10174
+ return !this.isOk();
10175
+ }
10176
+ map(f) {
10177
+ return ok(f(this.value));
10178
+ }
10179
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10180
+ mapErr(_f) {
10181
+ return ok(this.value);
10182
+ }
10183
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10184
+ andThen(f) {
10185
+ return f(this.value);
10186
+ }
10187
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10188
+ andThrough(f) {
10189
+ return f(this.value).map((_value) => this.value);
10190
+ }
10191
+ andTee(f) {
10192
+ try {
10193
+ f(this.value);
10194
+ } catch (e) {
10195
+ }
10196
+ return ok(this.value);
10197
+ }
10198
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10199
+ orElse(_f) {
10200
+ return ok(this.value);
10201
+ }
10202
+ asyncAndThen(f) {
10203
+ return f(this.value);
10204
+ }
10205
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10206
+ asyncAndThrough(f) {
10207
+ return f(this.value).map(() => this.value);
10208
+ }
10209
+ asyncMap(f) {
10210
+ return ResultAsync.fromSafePromise(f(this.value));
10211
+ }
10212
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10213
+ unwrapOr(_v) {
10214
+ return this.value;
10215
+ }
10216
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10217
+ match(ok2, _err) {
10218
+ return ok2(this.value);
10219
+ }
10220
+ safeUnwrap() {
10221
+ const value = this.value;
10222
+ return function* () {
10223
+ return value;
10224
+ }();
10225
+ }
10226
+ _unsafeUnwrap(_) {
10227
+ return this.value;
10228
+ }
10229
+ _unsafeUnwrapErr(config) {
10230
+ throw createNeverThrowError("Called `_unsafeUnwrapErr` on an Ok", this, config);
10231
+ }
10232
+ };
10233
+ var Err = class {
10234
+ constructor(error) {
10235
+ this.error = error;
10236
+ }
10237
+ isOk() {
10238
+ return false;
10239
+ }
10240
+ isErr() {
10241
+ return !this.isOk();
10242
+ }
10243
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10244
+ map(_f) {
10245
+ return err(this.error);
10246
+ }
10247
+ mapErr(f) {
10248
+ return err(f(this.error));
10249
+ }
10250
+ andThrough(_f) {
10251
+ return err(this.error);
10252
+ }
10253
+ andTee(_f) {
10254
+ return err(this.error);
10255
+ }
10256
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10257
+ andThen(_f) {
10258
+ return err(this.error);
10259
+ }
10260
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10261
+ orElse(f) {
10262
+ return f(this.error);
10263
+ }
10264
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10265
+ asyncAndThen(_f) {
10266
+ return errAsync(this.error);
10267
+ }
10268
+ asyncAndThrough(_f) {
10269
+ return errAsync(this.error);
10270
+ }
10271
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10272
+ asyncMap(_f) {
10273
+ return errAsync(this.error);
10274
+ }
10275
+ unwrapOr(v) {
10276
+ return v;
10277
+ }
10278
+ match(_ok, err2) {
10279
+ return err2(this.error);
10280
+ }
10281
+ safeUnwrap() {
10282
+ const error = this.error;
10283
+ return function* () {
10284
+ yield err(error);
10285
+ throw new Error("Do not use this generator out of `safeTry`");
10286
+ }();
10287
+ }
10288
+ _unsafeUnwrap(config) {
10289
+ throw createNeverThrowError("Called `_unsafeUnwrap` on an Err", this, config);
10290
+ }
10291
+ _unsafeUnwrapErr(_) {
10292
+ return this.error;
10293
+ }
10294
+ };
10295
+ var fromThrowable = Result.fromThrowable;
9972
10296
 
9973
- // src/plugins.ts
9974
- import { default as default2 } from "@typescript-eslint/eslint-plugin";
9975
- import * as parserTs from "@typescript-eslint/parser";
9976
- import { default as default3 } from "eslint-plugin-antfu";
9977
- import { default as default4 } from "eslint-plugin-eslint-comments";
9978
- import * as pluginImport from "eslint-plugin-import-x";
9979
- import { default as default5 } from "eslint-plugin-n";
9980
- import { default as default6 } from "eslint-plugin-perfectionist";
9981
- import { default as default7 } from "eslint-plugin-unicorn";
10297
+ // src/utils.ts
10298
+ import process3 from "node:process";
10299
+
10300
+ // src/lager.ts
10301
+ var LAGER_LEVELS = {
10302
+ trace: 10,
10303
+ debug: 20,
10304
+ info: 30,
10305
+ warn: 40,
10306
+ error: 50,
10307
+ fatal: 60
10308
+ };
10309
+ function isLagerLevel(level) {
10310
+ return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
10311
+ }
10312
+ var Lager = class {
10313
+ _level = "info";
10314
+ id = "lager";
10315
+ levelNo = LAGER_LEVELS[this._level];
10316
+ prefix = "";
10317
+ constructor(options) {
10318
+ const { level, id, prefix } = {
10319
+ level: "info",
10320
+ id: "lager",
10321
+ prefix: "@jsse/eslint-config",
10322
+ ...options
10323
+ };
10324
+ this.id = id;
10325
+ this._level = isLagerLevel(level) ? level : "info";
10326
+ this.levelNo = LAGER_LEVELS[this._level];
10327
+ this.prefix = prefix;
10328
+ this.log = this.log.bind(this);
10329
+ this.debug = this.debug.bind(this);
10330
+ }
10331
+ get level() {
10332
+ return this._level;
10333
+ }
10334
+ set level(level) {
10335
+ this._level = level;
10336
+ this.levelNo = LAGER_LEVELS[level];
10337
+ }
10338
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10339
+ log(...args) {
10340
+ console.log(this.prefix, ...args);
10341
+ }
10342
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10343
+ trace(...args) {
10344
+ if (this.levelNo <= LAGER_LEVELS.trace) {
10345
+ console.trace(this.prefix, ...args);
10346
+ }
10347
+ }
10348
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10349
+ debug(...args) {
10350
+ if (this.levelNo <= LAGER_LEVELS.debug) {
10351
+ console.debug(this.prefix, ...args);
10352
+ }
10353
+ }
10354
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10355
+ info(...args) {
10356
+ if (this.levelNo <= LAGER_LEVELS.info) {
10357
+ console.info(this.prefix, ...args);
10358
+ }
10359
+ }
10360
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10361
+ warn(...args) {
10362
+ if (this.levelNo <= LAGER_LEVELS.warn) {
10363
+ console.warn(this.prefix, ...args);
10364
+ }
10365
+ }
10366
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10367
+ error(...args) {
10368
+ if (this.levelNo <= LAGER_LEVELS.error) {
10369
+ console.error(this.prefix, ...args);
10370
+ }
10371
+ }
10372
+ };
10373
+ var log = new Lager();
10374
+
10375
+ // src/utils.ts
10376
+ async function combine(...configs) {
10377
+ const resolved = await Promise.all(configs);
10378
+ return resolved.flat();
10379
+ }
10380
+ async function combineAsync(...configs) {
10381
+ const resolved = await Promise.all(configs);
10382
+ return resolved.flatMap(
10383
+ (config) => Array.isArray(config) ? config : [config]
10384
+ );
10385
+ }
10386
+ function renameRules(rules, from, to) {
10387
+ if (from === to) {
10388
+ return rules;
10389
+ }
10390
+ return Object.fromEntries(
10391
+ Object.entries(rules).map(([key, value]) => {
10392
+ if (key.startsWith(from)) {
10393
+ return [to + key.slice(from.length), value];
10394
+ }
10395
+ return [key, value];
10396
+ })
10397
+ );
10398
+ }
10399
+ async function interopDefault2(m) {
10400
+ const resolved = await m;
10401
+ return resolved.default || resolved;
10402
+ }
10403
+ function isCI() {
10404
+ return !!process3.env.CI;
10405
+ }
10406
+ function isInEditor() {
10407
+ return !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE) && !isCI());
10408
+ }
10409
+ function uniqueStrings(...strings) {
10410
+ const set = /* @__PURE__ */ new Set();
10411
+ for (const item of strings) {
10412
+ if (typeof item === "string") {
10413
+ set.add(item);
10414
+ } else {
10415
+ for (const str of item) {
10416
+ set.add(str);
10417
+ }
10418
+ }
10419
+ }
10420
+ return [...set];
10421
+ }
10422
+ var parserPlain = {
10423
+ meta: {
10424
+ name: "parser-plain"
10425
+ },
10426
+ parseForESLint: (code) => ({
10427
+ ast: {
10428
+ body: [],
10429
+ comments: [],
10430
+ loc: { end: code.length, start: 0 },
10431
+ range: [0, code.length],
10432
+ tokens: [],
10433
+ type: "Program"
10434
+ },
10435
+ scopeManager: void 0,
10436
+ services: { isPlain: true },
10437
+ visitorKeys: {
10438
+ Program: []
10439
+ }
10440
+ })
10441
+ };
10442
+ function turnOffRules(configs, off) {
10443
+ if (off && off.length > 0) {
10444
+ for (const rule of off) {
10445
+ log.debug(`turning-off: ${rule}`);
10446
+ }
10447
+ const currentlyActiveRules = /* @__PURE__ */ new Set();
10448
+ for (const config of configs) {
10449
+ for (const rule of Object.keys(config.rules ?? {}))
10450
+ currentlyActiveRules.add(rule);
10451
+ }
10452
+ for (const rule of off) {
10453
+ if (!currentlyActiveRules.has(rule)) {
10454
+ log.info(
10455
+ `Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
10456
+ );
10457
+ }
10458
+ }
10459
+ for (const config of configs) {
10460
+ const cfgRules = config.rules;
10461
+ if (cfgRules) {
10462
+ for (const rule of off) {
10463
+ if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) {
10464
+ cfgRules[rule] = "off";
10465
+ }
10466
+ }
10467
+ }
10468
+ }
10469
+ }
10470
+ return configs;
10471
+ }
10472
+ function changeRuleEntrySeverity(ruleConfig, level) {
10473
+ if (Array.isArray(ruleConfig)) {
10474
+ if (ruleConfig[0] !== level) {
10475
+ ruleConfig[0] = level;
10476
+ }
10477
+ return ruleConfig;
10478
+ }
10479
+ return level;
10480
+ }
10481
+ function error2warn(configs) {
10482
+ for (const config of configs) {
10483
+ if (config.rules) {
10484
+ config.rules = Object.fromEntries(
10485
+ Object.entries(config.rules).map(([key, value]) => {
10486
+ if (value === "error" || value === 2) {
10487
+ return [key, changeRuleEntrySeverity(value, "warn")];
10488
+ }
10489
+ if (Array.isArray(value) && (value[0] === "error" || value[0] === 2)) {
10490
+ return [key, changeRuleEntrySeverity(value, "warn")];
10491
+ }
10492
+ return [key, value];
10493
+ })
10494
+ );
10495
+ }
10496
+ }
10497
+ return configs;
10498
+ }
10499
+ function warn2error(configs) {
10500
+ for (const config of configs) {
10501
+ if (config.rules) {
10502
+ config.rules = Object.fromEntries(
10503
+ Object.entries(config.rules).map(([key, value]) => {
10504
+ if (value === "warn" || value === 1) {
10505
+ return [key, changeRuleEntrySeverity(value, "error")];
10506
+ }
10507
+ if (Array.isArray(value) && (value[0] === "warn" || value[0] === 1)) {
10508
+ return [key, changeRuleEntrySeverity(value, "error")];
10509
+ }
10510
+ return [key, value];
10511
+ })
10512
+ );
10513
+ }
10514
+ }
10515
+ return configs;
10516
+ }
10517
+
10518
+ // src/plugins.ts
10519
+ import { default as default2 } from "@eslint-community/eslint-plugin-eslint-comments";
10520
+ import { default as default3 } from "@typescript-eslint/eslint-plugin";
10521
+ import * as parserTs from "@typescript-eslint/parser";
10522
+ import { default as default4 } from "eslint-plugin-antfu";
10523
+ import * as pluginImport from "eslint-plugin-import-x";
10524
+ import { default as default5 } from "eslint-plugin-n";
10525
+ import { default as default6 } from "eslint-plugin-perfectionist";
10526
+ import { default as default7 } from "eslint-plugin-unicorn";
9982
10527
  import { default as default8 } from "eslint-plugin-unused-imports";
9983
10528
  async function importPluginReact() {
9984
10529
  const pluginReact = await interopDefault2(import("eslint-plugin-react"));
@@ -9988,6 +10533,7 @@ async function importPluginReact() {
9988
10533
  }
9989
10534
  async function importPluginReactHooks() {
9990
10535
  const pluginReactHooks = await interopDefault2(
10536
+ // @ts-expect-error - bad types
9991
10537
  import("eslint-plugin-react-hooks")
9992
10538
  );
9993
10539
  return {
@@ -9996,6 +10542,7 @@ async function importPluginReactHooks() {
9996
10542
  }
9997
10543
  async function importPluginReactRefresh() {
9998
10544
  const pluginReactRefresh = await interopDefault2(
10545
+ // @ts-expect-error - bad types
9999
10546
  import("eslint-plugin-react-refresh")
10000
10547
  );
10001
10548
  return {
@@ -10006,7 +10553,9 @@ async function importReactPlugins() {
10006
10553
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
10007
10554
  [
10008
10555
  interopDefault2(import("eslint-plugin-react")),
10556
+ // @ts-expect-error - bad types
10009
10557
  interopDefault2(import("eslint-plugin-react-hooks")),
10558
+ // @ts-expect-error - bad types
10010
10559
  interopDefault2(import("eslint-plugin-react-refresh"))
10011
10560
  ]
10012
10561
  );
@@ -10039,7 +10588,7 @@ async function importYmlLibs() {
10039
10588
  return { parserYaml, pluginYaml };
10040
10589
  }
10041
10590
  async function importPluginMarkdown() {
10042
- const pluginMarkdown = await interopDefault2(import("eslint-plugin-markdown"));
10591
+ const pluginMarkdown = await interopDefault2(import("@eslint/markdown"));
10043
10592
  return {
10044
10593
  pluginMarkdown
10045
10594
  };
@@ -10064,41 +10613,52 @@ async function importPluginStylistic() {
10064
10613
  }
10065
10614
  async function importPluginTailwind() {
10066
10615
  const pluginTailwind = await interopDefault2(
10616
+ // @ts-expect-error - bad types
10067
10617
  import("eslint-plugin-tailwindcss")
10068
10618
  );
10069
10619
  return { pluginTailwind };
10070
10620
  }
10621
+ async function safeImportPluginTailwind() {
10622
+ try {
10623
+ const plugin = await importPluginTailwind();
10624
+ return ok(plugin);
10625
+ } catch (e) {
10626
+ return err(
10627
+ new Error(
10628
+ `Failed to import \`eslint-plugin-tailwindcss\`. You might need to install it. ${e}`
10629
+ )
10630
+ );
10631
+ }
10632
+ }
10071
10633
 
10072
10634
  // src/configs/antfu.ts
10073
- var antfu = async () => {
10635
+ var antfu = async (options) => {
10074
10636
  return [
10075
10637
  {
10076
10638
  name: "jsse/antfu",
10077
10639
  plugins: {
10078
- antfu: default3
10640
+ antfu: default4
10079
10641
  },
10080
- // @ts-expect-error - antfu plugin types err
10081
- rules: {
10082
- "antfu/no-import-node-modules-by-path": "error",
10083
- "antfu/top-level-function": "error"
10084
- }
10085
- },
10086
- {
10087
- files: ["**/src/**/*"],
10088
- name: "jsse/antfu/src",
10089
- // @ts-expect-error - antfu plugin types err
10090
- rules: {
10091
- "antfu/no-import-dist": "error"
10092
- }
10093
- },
10094
- {
10095
- files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
10096
- name: "jsse/antfu/bin",
10097
10642
  rules: {
10098
- "antfu/no-import-dist": "off",
10099
- "antfu/no-import-node-modules-by-path": "off"
10643
+ // used to like the following rule, but now find it annoying
10644
+ "antfu/top-level-function": options?.topLevelFunction ?? "off"
10100
10645
  }
10101
10646
  }
10647
+ // {
10648
+ // files: ["**/src/**/*"],
10649
+ // name: "jsse/antfu/src",
10650
+ // rules: {
10651
+ // "antfu/no-import-dist": "error",
10652
+ // },
10653
+ // },
10654
+ // {
10655
+ // files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
10656
+ // name: "jsse/antfu/bin",
10657
+ // rules: {
10658
+ // "antfu/no-import-dist": "off",
10659
+ // "antfu/no-import-node-modules-by-path": "off",
10660
+ // },
10661
+ // },
10102
10662
  ];
10103
10663
  };
10104
10664
 
@@ -10108,7 +10668,7 @@ var comments = async () => [
10108
10668
  name: "jsse/eslint-comments",
10109
10669
  plugins: {
10110
10670
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10111
- "eslint-comments": default4
10671
+ "eslint-comments": default2
10112
10672
  },
10113
10673
  rules: {
10114
10674
  "eslint-comments/no-aggregating-enable": "error",
@@ -10119,6 +10679,81 @@ var comments = async () => [
10119
10679
  }
10120
10680
  ];
10121
10681
 
10682
+ // src/globs.ts
10683
+ var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
10684
+ var GLOB_JS_SRC_EXT = "?([cm])js?(x)";
10685
+ var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
10686
+ var GLOB_JS = "**/*.?([cm])js";
10687
+ var GLOB_JSX = "**/*.?([cm])jsx";
10688
+ var GLOB_TS = "**/*.?([cm])ts";
10689
+ var GLOB_TSX = "**/*.?([cm])tsx";
10690
+ var GLOB_STYLE = "**/*.{c,le,sc}ss";
10691
+ var GLOB_CSS = "**/*.css";
10692
+ var GLOB_LESS = "**/*.less";
10693
+ var GLOB_SCSS = "**/*.scss";
10694
+ var GLOB_JSON = "**/*.json";
10695
+ var GLOB_JSON5 = "**/*.json5";
10696
+ var GLOB_JSONC = "**/*.jsonc";
10697
+ var GLOB_TOML = "**/*.toml";
10698
+ var GLOB_MARKDOWN = "**/*.md";
10699
+ var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
10700
+ var GLOB_GRAPHQL = ["**/*.graphql", "**/*.gql"];
10701
+ var GLOB_YAML = "**/*.y?(a)ml";
10702
+ var GLOB_HTML = "**/*.htm?(l)";
10703
+ var GLOB_TSCONFIG = ["**/tsconfig.json", "**/tsconfig.*.json"];
10704
+ var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
10705
+ var GLOB_TESTS = [
10706
+ `**/__tests__/**/*.${GLOB_SRC_EXT}`,
10707
+ `**/*.spec.${GLOB_SRC_EXT}`,
10708
+ `**/*.test.${GLOB_SRC_EXT}`,
10709
+ `**/*.bench.${GLOB_SRC_EXT}`,
10710
+ `**/*.benchmark.${GLOB_SRC_EXT}`
10711
+ ];
10712
+ var GLOB_ALL_SRC = [
10713
+ GLOB_SRC,
10714
+ GLOB_STYLE,
10715
+ GLOB_JSON,
10716
+ GLOB_JSON5,
10717
+ GLOB_MARKDOWN,
10718
+ GLOB_YAML,
10719
+ GLOB_HTML
10720
+ ];
10721
+ var GLOB_EXCLUDE = [
10722
+ "**/__snapshots__",
10723
+ "**/.cache",
10724
+ "**/.changeset",
10725
+ "**/.history",
10726
+ "**/.idea",
10727
+ "**/.next",
10728
+ "**/.nuxt",
10729
+ "**/.output",
10730
+ "**/.temp",
10731
+ "**/.tmp",
10732
+ "**/.vercel",
10733
+ "**/.vite-inspect",
10734
+ "**/.vitepress/cache",
10735
+ "**/*.bak",
10736
+ "**/*.min.*",
10737
+ "**/.yarn",
10738
+ "**/.pnp.*",
10739
+ "**/auto-import?(s).d.ts",
10740
+ "**/bun.lockb",
10741
+ "**/CHANGELOG*.md",
10742
+ "**/components.d.ts",
10743
+ "**/coverage",
10744
+ "**/dist",
10745
+ "**/LICENSE*",
10746
+ "**/node_modules",
10747
+ "**/out",
10748
+ "**/output",
10749
+ "**/package-lock.json",
10750
+ "**/pnpm-lock.yaml",
10751
+ "**/scratch",
10752
+ "**/temp",
10753
+ "**/tmp",
10754
+ "**/yarn.lock"
10755
+ ];
10756
+
10122
10757
  // src/configs/ignores.ts
10123
10758
  var ignores = async () => {
10124
10759
  return [
@@ -10530,6 +11165,9 @@ var jsonc = async (options) => {
10530
11165
  ];
10531
11166
  };
10532
11167
 
11168
+ // src/configs/markdown.ts
11169
+ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
11170
+
10533
11171
  // src/configs/ts/typescript-rules.ts
10534
11172
  function typescriptRulesTypeAware() {
10535
11173
  return {
@@ -10951,6 +11589,7 @@ function typescriptRules(props) {
10951
11589
  // src/configs/markdown.ts
10952
11590
  var markdown = async (options) => {
10953
11591
  const { componentExts = [], overrides = {} } = options ?? {};
11592
+ const files = [GLOB_MARKDOWN];
10954
11593
  const { pluginMarkdown } = await importPluginMarkdown();
10955
11594
  const tsRulesOff = Object.fromEntries(
10956
11595
  // @ts-expect-error - undefined
@@ -10959,6 +11598,13 @@ var markdown = async (options) => {
10959
11598
  "off"
10960
11599
  ])
10961
11600
  );
11601
+ const processor = mergeProcessors(
11602
+ [
11603
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11604
+ pluginMarkdown.processors.markdown,
11605
+ processorPassThrough
11606
+ ].filter((processor2) => processor2 !== void 0)
11607
+ );
10962
11608
  return [
10963
11609
  {
10964
11610
  name: "jsse/markdown/setup",
@@ -10967,10 +11613,26 @@ var markdown = async (options) => {
10967
11613
  markdown: pluginMarkdown
10968
11614
  }
10969
11615
  },
11616
+ // {
11617
+ // files: [GLOB_MARKDOWN],
11618
+ // name: "jsse/markdown/processor",
11619
+ // processor: "markdown/markdown",
11620
+ // },
10970
11621
  {
10971
- files: [GLOB_MARKDOWN],
11622
+ files,
11623
+ ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
10972
11624
  name: "jsse/markdown/processor",
10973
- processor: "markdown/markdown"
11625
+ // `eslint-plugin-markdown` only creates virtual files for code blocks,
11626
+ // but not the markdown file itself. We use `eslint-merge-processors` to
11627
+ // add a pass-through processor for the markdown file itself.
11628
+ processor
11629
+ },
11630
+ {
11631
+ files,
11632
+ languageOptions: {
11633
+ parser: parserPlain
11634
+ },
11635
+ name: "jsse/markdown/parser"
10974
11636
  },
10975
11637
  {
10976
11638
  files: [
@@ -11009,22 +11671,38 @@ var markdown = async (options) => {
11009
11671
  "@typescript-eslint/restrict-plus-operands": "off",
11010
11672
  "@typescript-eslint/restrict-template-expressions": "off",
11011
11673
  "@typescript-eslint/unbound-method": "off",
11674
+ "n/prefer-global/buffer": "off",
11675
+ "n/prefer-global/process": "off",
11012
11676
  "no-alert": "off",
11013
11677
  "no-console": "off",
11014
11678
  "no-undef": "off",
11015
11679
  "no-unused-expressions": "off",
11016
11680
  "no-unused-vars": "off",
11017
- "node/prefer-global/process": "off",
11018
- // Type aware rules
11019
11681
  "object-curly-newline": "off",
11020
11682
  "style/comma-dangle": "off",
11021
11683
  "style/eol-last": "off",
11022
11684
  "unicode-bom": "off",
11023
11685
  "unused-imports/no-unused-imports": "off",
11024
11686
  "unused-imports/no-unused-vars": "off",
11687
+ // Type aware rules
11025
11688
  ...tsRulesOff,
11026
11689
  ...overrides
11027
11690
  }
11691
+ },
11692
+ {
11693
+ files: ["**/README.md", "**/README.md/**"],
11694
+ languageOptions: {
11695
+ parserOptions: {
11696
+ ecmaFeatures: {
11697
+ impliedStrict: true
11698
+ }
11699
+ }
11700
+ },
11701
+ name: "jsse/markdown/rules/readme",
11702
+ rules: {
11703
+ "unicorn/filename-case": "off",
11704
+ "unicorn/no-null": "off"
11705
+ }
11028
11706
  }
11029
11707
  ];
11030
11708
  };
@@ -11853,25 +12531,33 @@ function tailwindSettings(options) {
11853
12531
  return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
11854
12532
  }
11855
12533
  var tailwind = async (options) => {
11856
- const { pluginTailwind } = await importPluginTailwind();
11857
- return [
11858
- {
11859
- files: [GLOB_SRC],
11860
- name: "jsse/tailwind/rules",
11861
- plugins: {
11862
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11863
- tailwindcss: pluginTailwind
11864
- },
11865
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11866
- rules: {
11867
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11868
- ...pluginTailwind.configs.recommended.rules
11869
- },
11870
- settings: {
11871
- tailwindcss: tailwindSettings(options)
11872
- }
12534
+ const importResult = await safeImportPluginTailwind();
12535
+ return importResult.match(
12536
+ ({ pluginTailwind }) => {
12537
+ return [
12538
+ {
12539
+ files: [GLOB_SRC],
12540
+ name: "jsse/tailwind/rules",
12541
+ plugins: {
12542
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12543
+ tailwindcss: pluginTailwind
12544
+ },
12545
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12546
+ rules: {
12547
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
12548
+ ...pluginTailwind.configs.recommended.rules
12549
+ },
12550
+ settings: {
12551
+ tailwindcss: tailwindSettings(options)
12552
+ }
12553
+ }
12554
+ ];
12555
+ },
12556
+ (error) => {
12557
+ log.error(error.message);
12558
+ return [];
11873
12559
  }
11874
- ];
12560
+ );
11875
12561
  };
11876
12562
 
11877
12563
  // src/configs/ts/parser.ts
@@ -11983,9 +12669,9 @@ var typescript = async (options) => {
11983
12669
  const tsPrefixTo = prefix?.to ?? "@typescript-eslint";
11984
12670
  const tsRules = {
11985
12671
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11986
- ...(default2.configs["eslint-recommended"]?.overrides ?? [])[0]?.rules,
12672
+ ...(default3.configs["eslint-recommended"]?.overrides ?? [])[0]?.rules,
11987
12673
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11988
- ...default2.configs.strict?.rules,
12674
+ ...default3.configs.strict?.rules,
11989
12675
  "no-invalid-this": "off",
11990
12676
  ...typescriptRules({
11991
12677
  typeAware: false
@@ -11998,7 +12684,7 @@ var typescript = async (options) => {
11998
12684
  name: "jsse/typescript/setup",
11999
12685
  plugins: {
12000
12686
  import: pluginImport,
12001
- [tsPrefixTo]: default2
12687
+ [tsPrefixTo]: default3
12002
12688
  }
12003
12689
  },
12004
12690
  ...parserConfigs,
@@ -12270,87 +12956,7 @@ var yml = async (options) => {
12270
12956
  ];
12271
12957
  };
12272
12958
 
12273
- // src/lager.ts
12274
- var levels = {
12275
- trace: 10,
12276
- debug: 20,
12277
- info: 30,
12278
- warn: 40,
12279
- error: 50,
12280
- fatal: 60
12281
- };
12282
- function isLagerLevel(level) {
12283
- return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
12284
- }
12285
- var Lager = class {
12286
- _level = "info";
12287
- id = "lager";
12288
- levelNo = levels[this._level];
12289
- prefix = "";
12290
- constructor(options) {
12291
- const { level, id, prefix } = {
12292
- level: "info",
12293
- id: "lager",
12294
- prefix: "@jsse/eslint-config",
12295
- ...options
12296
- };
12297
- this.id = id;
12298
- this._level = isLagerLevel(level) ? level : "info";
12299
- this.levelNo = levels[this._level];
12300
- this.prefix = prefix;
12301
- this.log = this.log.bind(this);
12302
- this.debug = this.debug.bind(this);
12303
- }
12304
- get level() {
12305
- return this._level;
12306
- }
12307
- set level(level) {
12308
- this._level = level;
12309
- this.levelNo = levels[level];
12310
- }
12311
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12312
- log(...args) {
12313
- console.log(...args);
12314
- }
12315
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12316
- trace(...args) {
12317
- if (this.levelNo > levels.trace) {
12318
- return;
12319
- }
12320
- console.trace(...args);
12321
- }
12322
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12323
- debug(...args) {
12324
- if (this.levelNo > levels.debug) {
12325
- return;
12326
- }
12327
- console.debug(...args);
12328
- }
12329
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12330
- info(...args) {
12331
- if (this.levelNo > levels.info) {
12332
- return;
12333
- }
12334
- console.info("[@jsse/eslint-config]", ...args);
12335
- }
12336
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12337
- warn(...args) {
12338
- if (this.levelNo > levels.warn) {
12339
- return;
12340
- }
12341
- console.warn(...args);
12342
- }
12343
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12344
- error(...args) {
12345
- if (this.levelNo > levels.error) {
12346
- return;
12347
- }
12348
- console.error(...args);
12349
- }
12350
- };
12351
- var log = new Lager();
12352
-
12353
- // src/factory.ts
12959
+ // src/define-config.ts
12354
12960
  var flatConfigProps = [
12355
12961
  "files",
12356
12962
  "ignores",
@@ -12361,7 +12967,9 @@ var flatConfigProps = [
12361
12967
  "rules",
12362
12968
  "settings"
12363
12969
  ];
12364
- var DEBUG = !!(process6.env.DEBUG?.toLowerCase() === "true" || process6.env.DEBUG === "1");
12970
+ var DEBUG = ["1", "true", "t", "on", "yes", "y"].includes(
12971
+ process6.env.DEBUG ?? ""
12972
+ );
12365
12973
  function defaultOptions2() {
12366
12974
  return {
12367
12975
  componentExts: [],
@@ -12552,37 +13160,14 @@ async function jsse(options = {}, ...userConfigs) {
12552
13160
  }
12553
13161
  const combinedConfigs = await combineAsync(...configs, ...userConfigs);
12554
13162
  if (off && off.length > 0) {
12555
- log.debug("Turning off rules", off);
12556
- const currentlyActiveRules = /* @__PURE__ */ new Set();
12557
- for (const config of combinedConfigs) {
12558
- for (const rule of Object.keys(config.rules ?? {}))
12559
- currentlyActiveRules.add(rule);
12560
- }
12561
- for (const rule of off) {
12562
- if (!currentlyActiveRules.has(rule)) {
12563
- log.info(
12564
- `Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
12565
- );
12566
- }
12567
- }
12568
- for (const config of combinedConfigs) {
12569
- for (const cfgRules of [config.rules, config.plugins]) {
12570
- if (cfgRules) {
12571
- for (const rule of off) {
12572
- if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) {
12573
- cfgRules[rule] = "off";
12574
- }
12575
- }
12576
- }
12577
- }
12578
- }
13163
+ turnOffRules(combinedConfigs, off);
12579
13164
  }
12580
13165
  if (normalizedOptions.rootId !== "jsse") {
12581
13166
  for (const config of combinedConfigs) {
12582
13167
  if (config.name && config.name.startsWith("jsse/")) {
12583
13168
  config.name = config.name.replace(
12584
13169
  "jsse/",
12585
- `${normalizedOptions.rootId}:`
13170
+ `${normalizedOptions.rootId}/`
12586
13171
  );
12587
13172
  }
12588
13173
  }
@@ -12622,23 +13207,25 @@ async function jsse(options = {}, ...userConfigs) {
12622
13207
  }
12623
13208
  return combinedConfigs;
12624
13209
  }
13210
+ async function defineConfig(options = {}, ...userConfigs) {
13211
+ return jsse(options, ...userConfigs);
13212
+ }
12625
13213
 
12626
13214
  // src/presets.ts
12627
- function jssestd() {
12628
- return jsse({
12629
- typescript: {
12630
- tsconfig: ["./tsconfig.json", "./tsconfig.eslint.json"]
12631
- }
12632
- });
12633
- }
12634
- function jsseReact() {
12635
- return jsse({
12636
- react: true,
12637
- typescript: {
12638
- tsconfig: ["./tsconfig.json", "./tsconfig.eslint.json"]
12639
- }
12640
- });
12641
- }
13215
+ var jsseReact = (options, ...configs) => {
13216
+ return jsse(
13217
+ {
13218
+ react: true,
13219
+ reactRefresh: true,
13220
+ tailwind: true,
13221
+ typescript: {
13222
+ tsconfig: ["./tsconfig.json", "./tsconfig.eslint.json"]
13223
+ },
13224
+ ...options
13225
+ },
13226
+ ...configs
13227
+ );
13228
+ };
12642
13229
  export {
12643
13230
  GLOB_ALL_SRC,
12644
13231
  GLOB_CSS,
@@ -12654,6 +13241,7 @@ export {
12654
13241
  GLOB_LESS,
12655
13242
  GLOB_MARKDOWN,
12656
13243
  GLOB_MARKDOWN_CODE,
13244
+ GLOB_MARKDOWN_IN_MARKDOWN,
12657
13245
  GLOB_SCSS,
12658
13246
  GLOB_SRC,
12659
13247
  GLOB_SRC_EXT,
@@ -12665,9 +13253,12 @@ export {
12665
13253
  GLOB_TSX,
12666
13254
  GLOB_YAML,
12667
13255
  SLOW_RULES,
13256
+ changeRuleEntrySeverity,
12668
13257
  combine,
12669
13258
  combineAsync,
12670
13259
  jsse as default,
13260
+ defineConfig,
13261
+ error2warn,
12671
13262
  importJsoncLibs,
12672
13263
  importParserJsonc,
12673
13264
  importPluginJsdoc,
@@ -12686,16 +13277,19 @@ export {
12686
13277
  isInEditor,
12687
13278
  jsse,
12688
13279
  jsseReact,
12689
- jssestd,
13280
+ parserPlain,
12690
13281
  parserTs,
12691
- default3 as pluginAntfu,
12692
- default4 as pluginEslintComments,
13282
+ default4 as pluginAntfu,
13283
+ default2 as pluginEslintComments,
12693
13284
  pluginImport,
12694
13285
  default5 as pluginN,
12695
13286
  default6 as pluginPerfectionist,
12696
- default2 as pluginTs,
13287
+ default3 as pluginTs,
12697
13288
  default7 as pluginUnicorn,
12698
13289
  default8 as pluginUnusedImports,
12699
13290
  renameRules,
12700
- uniqueStrings
13291
+ safeImportPluginTailwind,
13292
+ turnOffRules,
13293
+ uniqueStrings,
13294
+ warn2error
12701
13295
  };