@jsse/eslint-config 0.1.0 → 0.1.2

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
@@ -4,7 +4,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
7
  var __commonJS = (cb, mod) => function __require() {
9
8
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
9
  };
@@ -24,36 +23,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
23
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
24
  mod
26
25
  ));
27
- var __publicField = (obj, key, value) => {
28
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
29
- return value;
30
- };
31
- var __accessCheck = (obj, member, msg) => {
32
- if (!member.has(obj))
33
- throw TypeError("Cannot " + msg);
34
- };
35
- var __privateGet = (obj, member, getter) => {
36
- __accessCheck(obj, member, "read from private field");
37
- return getter ? getter.call(obj) : member.get(obj);
38
- };
39
- var __privateAdd = (obj, member, value) => {
40
- if (member.has(obj))
41
- throw TypeError("Cannot add the same private member more than once");
42
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
43
- };
44
- var __privateSet = (obj, member, value, setter) => {
45
- __accessCheck(obj, member, "write to private field");
46
- setter ? setter.call(obj, value) : member.set(obj, value);
47
- return value;
48
- };
49
- var __privateWrapper = (obj, member, setter, getter) => ({
50
- set _(value) {
51
- __privateSet(obj, member, value, setter);
52
- },
53
- get _() {
54
- return __privateGet(obj, member, getter);
55
- }
56
- });
57
26
 
58
27
  // node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js
59
28
  var require_natural_compare = __commonJS({
@@ -334,9 +303,9 @@ var require_eslint_plugin_sort_keys = __commonJS({
334
303
  }
335
304
  });
336
305
 
337
- // node_modules/.pnpm/globals@13.24.0/node_modules/globals/globals.json
306
+ // node_modules/.pnpm/globals@14.0.0/node_modules/globals/globals.json
338
307
  var require_globals = __commonJS({
339
- "node_modules/.pnpm/globals@13.24.0/node_modules/globals/globals.json"(exports, module) {
308
+ "node_modules/.pnpm/globals@14.0.0/node_modules/globals/globals.json"(exports, module) {
340
309
  module.exports = {
341
310
  builtin: {
342
311
  AggregateError: false,
@@ -2338,9 +2307,9 @@ var require_globals = __commonJS({
2338
2307
  }
2339
2308
  });
2340
2309
 
2341
- // node_modules/.pnpm/globals@13.24.0/node_modules/globals/index.js
2310
+ // node_modules/.pnpm/globals@14.0.0/node_modules/globals/index.js
2342
2311
  var require_globals2 = __commonJS({
2343
- "node_modules/.pnpm/globals@13.24.0/node_modules/globals/index.js"(exports, module) {
2312
+ "node_modules/.pnpm/globals@14.0.0/node_modules/globals/index.js"(exports, module) {
2344
2313
  "use strict";
2345
2314
  module.exports = require_globals();
2346
2315
  }
@@ -2751,8 +2720,7 @@ function javascript(options = {}) {
2751
2720
  }
2752
2721
 
2753
2722
  // src/configs/jsdoc.ts
2754
- function jsdoc(options = {}) {
2755
- const { stylistic: stylistic2 = true } = options;
2723
+ function jsdoc() {
2756
2724
  return [
2757
2725
  {
2758
2726
  name: "jsse:jsdoc",
@@ -2762,11 +2730,13 @@ function jsdoc(options = {}) {
2762
2730
  },
2763
2731
  rules: {
2764
2732
  "jsdoc/check-access": "warn",
2733
+ "jsdoc/check-alignment": "warn",
2765
2734
  "jsdoc/check-param-names": "warn",
2766
2735
  "jsdoc/check-property-names": "warn",
2767
2736
  "jsdoc/check-types": "warn",
2768
2737
  "jsdoc/empty-tags": "warn",
2769
2738
  "jsdoc/implements-on-classes": "warn",
2739
+ "jsdoc/multiline-blocks": "warn",
2770
2740
  "jsdoc/no-defaults": "warn",
2771
2741
  "jsdoc/no-multi-asterisks": "warn",
2772
2742
  "jsdoc/require-param-name": "warn",
@@ -2775,11 +2745,7 @@ function jsdoc(options = {}) {
2775
2745
  "jsdoc/require-property-name": "warn",
2776
2746
  "jsdoc/require-returns-check": "warn",
2777
2747
  "jsdoc/require-returns-description": "warn",
2778
- "jsdoc/require-yields-check": "warn",
2779
- ...stylistic2 ? {
2780
- "jsdoc/check-alignment": "warn",
2781
- "jsdoc/multiline-blocks": "warn"
2782
- } : {}
2748
+ "jsdoc/require-yields-check": "warn"
2783
2749
  }
2784
2750
  }
2785
2751
  ];
@@ -2857,11 +2823,11 @@ function jsonc(options = {}) {
2857
2823
  ];
2858
2824
  }
2859
2825
 
2860
- // src/configs/node.ts
2826
+ // src/configs/n.ts
2861
2827
  function node() {
2862
2828
  return [
2863
2829
  {
2864
- name: "jsse:node",
2830
+ name: "jsse:n",
2865
2831
  plugins: {
2866
2832
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2867
2833
  node: default6
@@ -3541,6 +3507,10 @@ function renameRules(rules, from, to) {
3541
3507
  })
3542
3508
  );
3543
3509
  }
3510
+ async function interopDefault(m) {
3511
+ const resolved = await m;
3512
+ return resolved.default || resolved;
3513
+ }
3544
3514
  function isCI() {
3545
3515
  return !!process3.env.CI;
3546
3516
  }
@@ -4008,7 +3978,7 @@ function typescriptRules(props) {
4008
3978
  }
4009
3979
 
4010
3980
  // src/configs/ts/typescript.ts
4011
- function typescript(options) {
3981
+ async function typescript(options) {
4012
3982
  const {
4013
3983
  componentExts = [],
4014
3984
  overrides = {},
@@ -4041,6 +4011,7 @@ function typescript(options) {
4041
4011
  [tsPrefixTo]: default3
4042
4012
  }
4043
4013
  },
4014
+ // ...tseslint.configs.recommended,
4044
4015
  {
4045
4016
  // use ts parser for js files as well!
4046
4017
  files: [GLOB_SRC, ...componentExts.map((ext) => `**/*.${ext}`)],
@@ -9550,14 +9521,15 @@ Parser.acorn = {
9550
9521
  nonASCIIwhitespace
9551
9522
  };
9552
9523
 
9553
- // node_modules/.pnpm/mlly@1.4.2/node_modules/mlly/dist/index.mjs
9524
+ // node_modules/.pnpm/mlly@1.5.0/node_modules/mlly/dist/index.mjs
9554
9525
  import { builtinModules, createRequire } from "module";
9555
9526
  import fs, { realpathSync, statSync, Stats, promises, existsSync } from "fs";
9556
9527
  import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL } from "url";
9557
9528
 
9558
- // node_modules/.pnpm/ufo@1.3.2/node_modules/ufo/dist/index.mjs
9529
+ // node_modules/.pnpm/ufo@1.4.0/node_modules/ufo/dist/index.mjs
9559
9530
  var r = String.fromCharCode;
9560
9531
  var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
9532
+ var JOIN_LEADING_SLASH_RE = /^\.?\//;
9561
9533
  function hasTrailingSlash(input = "", respectQueryAndFragment) {
9562
9534
  if (!respectQueryAndFragment) {
9563
9535
  return input.endsWith("/");
@@ -9587,7 +9559,6 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
9587
9559
  function isNonEmptyURL(url) {
9588
9560
  return url && url !== "/";
9589
9561
  }
9590
- var JOIN_LEADING_SLASH_RE = /^\.?\//;
9591
9562
  function joinURL(base, ...input) {
9592
9563
  let url = base || "";
9593
9564
  for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {
@@ -9600,6 +9571,7 @@ function joinURL(base, ...input) {
9600
9571
  }
9601
9572
  return url;
9602
9573
  }
9574
+ var protocolRelative = Symbol.for("ufo:protocolRelative");
9603
9575
 
9604
9576
  // node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.mjs
9605
9577
  var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
@@ -9607,7 +9579,7 @@ var isAbsolute = function(p) {
9607
9579
  return _IS_ABSOLUTE_RE.test(p);
9608
9580
  };
9609
9581
 
9610
- // node_modules/.pnpm/mlly@1.4.2/node_modules/mlly/dist/index.mjs
9582
+ // node_modules/.pnpm/mlly@1.5.0/node_modules/mlly/dist/index.mjs
9611
9583
  import assert from "assert";
9612
9584
  import process$1 from "process";
9613
9585
  import path2, { dirname as dirname2 } from "path";
@@ -9617,7 +9589,6 @@ var BUILTIN_MODULES = new Set(builtinModules);
9617
9589
  function normalizeSlash(string_) {
9618
9590
  return string_.replace(/\\/g, "/");
9619
9591
  }
9620
- var isWindows = process$1.platform === "win32";
9621
9592
  var own$1 = {}.hasOwnProperty;
9622
9593
  var classRegExp = /^([A-Z][a-z\d]*)+$/;
9623
9594
  var kTypes = /* @__PURE__ */ new Set([
@@ -9763,10 +9734,10 @@ codes.ERR_MODULE_NOT_FOUND = createError(
9763
9734
  /**
9764
9735
  * @param {string} path
9765
9736
  * @param {string} base
9766
- * @param {string} [type]
9737
+ * @param {boolean} [exactUrl]
9767
9738
  */
9768
- (path4, base, type = "package") => {
9769
- return `Cannot find ${type} '${path4}' imported from ${base}`;
9739
+ (path4, base, exactUrl = false) => {
9740
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path4}' imported from ${base}`;
9770
9741
  },
9771
9742
  Error
9772
9743
  );
@@ -9836,24 +9807,6 @@ codes.ERR_INVALID_ARG_VALUE = createError(
9836
9807
  // Note: extra classes have been shaken out.
9837
9808
  // , RangeError
9838
9809
  );
9839
- codes.ERR_UNSUPPORTED_ESM_URL_SCHEME = createError(
9840
- "ERR_UNSUPPORTED_ESM_URL_SCHEME",
9841
- /**
9842
- * @param {URL} url
9843
- * @param {Array<string>} supported
9844
- */
9845
- (url, supported) => {
9846
- let message = `Only URLs with a scheme in: ${formatList(
9847
- supported
9848
- )} are supported by the default ESM loader`;
9849
- if (isWindows && url.protocol.length === 2) {
9850
- message += ". On Windows, absolute paths must be valid file:// URLs";
9851
- }
9852
- message += `. Received protocol '${url.protocol}'`;
9853
- return message;
9854
- },
9855
- Error
9856
- );
9857
9810
  function createError(sym, value, def) {
9858
9811
  messages.set(sym, value);
9859
9812
  return makeNodeErrorWithCode(def, sym);
@@ -9971,96 +9924,98 @@ function determineSpecificType(value) {
9971
9924
  }
9972
9925
  return `type ${typeof value} (${inspected})`;
9973
9926
  }
9927
+ var hasOwnProperty$1 = {}.hasOwnProperty;
9928
+ var { ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 } = codes;
9929
+ var cache = /* @__PURE__ */ new Map();
9974
9930
  var reader = { read };
9975
9931
  var packageJsonReader = reader;
9976
- function read(jsonPath) {
9977
- try {
9978
- const string = fs.readFileSync(
9979
- path2.toNamespacedPath(path2.join(path2.dirname(jsonPath), "package.json")),
9980
- "utf8"
9981
- );
9982
- return { string };
9983
- } catch (error) {
9984
- const exception = (
9985
- /** @type {ErrnoException} */
9986
- error
9987
- );
9988
- if (exception.code === "ENOENT") {
9989
- return { string: void 0 };
9990
- }
9991
- throw exception;
9992
- }
9993
- }
9994
- var { ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 } = codes;
9995
- var packageJsonCache = /* @__PURE__ */ new Map();
9996
- function getPackageConfig(path4, specifier, base) {
9997
- const existing = packageJsonCache.get(path4);
9998
- if (existing !== void 0) {
9932
+ function read(jsonPath, { base, specifier }) {
9933
+ const existing = cache.get(jsonPath);
9934
+ if (existing) {
9999
9935
  return existing;
10000
9936
  }
10001
- const source = packageJsonReader.read(path4).string;
10002
- if (source === void 0) {
10003
- const packageConfig2 = {
10004
- pjsonPath: path4,
10005
- exists: false,
10006
- main: void 0,
10007
- name: void 0,
10008
- type: "none",
10009
- exports: void 0,
10010
- imports: void 0
10011
- };
10012
- packageJsonCache.set(path4, packageConfig2);
10013
- return packageConfig2;
10014
- }
10015
- let packageJson;
9937
+ let string;
10016
9938
  try {
10017
- packageJson = JSON.parse(source);
9939
+ string = fs.readFileSync(path2.toNamespacedPath(jsonPath), "utf8");
10018
9940
  } catch (error) {
10019
9941
  const exception = (
10020
9942
  /** @type {ErrnoException} */
10021
9943
  error
10022
9944
  );
10023
- throw new ERR_INVALID_PACKAGE_CONFIG$1(
10024
- path4,
10025
- (base ? `"${specifier}" from ` : "") + fileURLToPath$1(base || specifier),
10026
- exception.message
10027
- );
9945
+ if (exception.code !== "ENOENT") {
9946
+ throw exception;
9947
+ }
10028
9948
  }
10029
- const { exports, imports: imports2, main, name, type } = packageJson;
10030
- const packageConfig = {
10031
- pjsonPath: path4,
10032
- exists: true,
10033
- main: typeof main === "string" ? main : void 0,
10034
- name: typeof name === "string" ? name : void 0,
10035
- type: type === "module" || type === "commonjs" ? type : "none",
10036
- // @ts-expect-error Assume `Record<string, unknown>`.
10037
- exports,
10038
- // @ts-expect-error Assume `Record<string, unknown>`.
10039
- imports: imports2 && typeof imports2 === "object" ? imports2 : void 0
9949
+ const result = {
9950
+ exists: false,
9951
+ pjsonPath: jsonPath,
9952
+ main: void 0,
9953
+ name: void 0,
9954
+ type: "none",
9955
+ // Ignore unknown types for forwards compatibility
9956
+ exports: void 0,
9957
+ imports: void 0
10040
9958
  };
10041
- packageJsonCache.set(path4, packageConfig);
10042
- return packageConfig;
9959
+ if (string !== void 0) {
9960
+ let parsed;
9961
+ try {
9962
+ parsed = JSON.parse(string);
9963
+ } catch (error_) {
9964
+ const cause = (
9965
+ /** @type {ErrnoException} */
9966
+ error_
9967
+ );
9968
+ const error = new ERR_INVALID_PACKAGE_CONFIG$1(
9969
+ jsonPath,
9970
+ (base ? `"${specifier}" from ` : "") + fileURLToPath$1(base || specifier),
9971
+ cause.message
9972
+ );
9973
+ error.cause = cause;
9974
+ throw error;
9975
+ }
9976
+ result.exists = true;
9977
+ if (hasOwnProperty$1.call(parsed, "name") && typeof parsed.name === "string") {
9978
+ result.name = parsed.name;
9979
+ }
9980
+ if (hasOwnProperty$1.call(parsed, "main") && typeof parsed.main === "string") {
9981
+ result.main = parsed.main;
9982
+ }
9983
+ if (hasOwnProperty$1.call(parsed, "exports")) {
9984
+ result.exports = parsed.exports;
9985
+ }
9986
+ if (hasOwnProperty$1.call(parsed, "imports")) {
9987
+ result.imports = parsed.imports;
9988
+ }
9989
+ if (hasOwnProperty$1.call(parsed, "type") && (parsed.type === "commonjs" || parsed.type === "module")) {
9990
+ result.type = parsed.type;
9991
+ }
9992
+ }
9993
+ cache.set(jsonPath, result);
9994
+ return result;
10043
9995
  }
10044
9996
  function getPackageScopeConfig(resolved) {
10045
- let packageJsonUrl = new URL$1("package.json", resolved);
9997
+ let packageJSONUrl = new URL$1("package.json", resolved);
10046
9998
  while (true) {
10047
- const packageJsonPath2 = packageJsonUrl.pathname;
10048
- if (packageJsonPath2.endsWith("node_modules/package.json"))
9999
+ const packageJSONPath2 = packageJSONUrl.pathname;
10000
+ if (packageJSONPath2.endsWith("node_modules/package.json")) {
10049
10001
  break;
10050
- const packageConfig2 = getPackageConfig(
10051
- fileURLToPath$1(packageJsonUrl),
10052
- resolved
10002
+ }
10003
+ const packageConfig = packageJsonReader.read(
10004
+ fileURLToPath$1(packageJSONUrl),
10005
+ { specifier: resolved }
10053
10006
  );
10054
- if (packageConfig2.exists)
10055
- return packageConfig2;
10056
- const lastPackageJsonUrl = packageJsonUrl;
10057
- packageJsonUrl = new URL$1("../package.json", packageJsonUrl);
10058
- if (packageJsonUrl.pathname === lastPackageJsonUrl.pathname)
10007
+ if (packageConfig.exists) {
10008
+ return packageConfig;
10009
+ }
10010
+ const lastPackageJSONUrl = packageJSONUrl;
10011
+ packageJSONUrl = new URL$1("../package.json", packageJSONUrl);
10012
+ if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {
10059
10013
  break;
10014
+ }
10060
10015
  }
10061
- const packageJsonPath = fileURLToPath$1(packageJsonUrl);
10062
- const packageConfig = {
10063
- pjsonPath: packageJsonPath,
10016
+ const packageJSONPath = fileURLToPath$1(packageJSONUrl);
10017
+ return {
10018
+ pjsonPath: packageJSONPath,
10064
10019
  exists: false,
10065
10020
  main: void 0,
10066
10021
  name: void 0,
@@ -10068,8 +10023,6 @@ function getPackageScopeConfig(resolved) {
10068
10023
  exports: void 0,
10069
10024
  imports: void 0
10070
10025
  };
10071
- packageJsonCache.set(packageJsonPath, packageConfig);
10072
- return packageConfig;
10073
10026
  }
10074
10027
  function getPackageType(url) {
10075
10028
  const packageConfig = getPackageScopeConfig(url);
@@ -10126,7 +10079,18 @@ function extname2(url) {
10126
10079
  function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
10127
10080
  const ext = extname2(url);
10128
10081
  if (ext === ".js") {
10129
- return getPackageType(url) === "module" ? "module" : "commonjs";
10082
+ const packageType = getPackageType(url);
10083
+ if (packageType !== "none") {
10084
+ return packageType;
10085
+ }
10086
+ return "commonjs";
10087
+ }
10088
+ if (ext === "") {
10089
+ const packageType = getPackageType(url);
10090
+ if (packageType === "none" || packageType === "commonjs") {
10091
+ return "commonjs";
10092
+ }
10093
+ return "module";
10130
10094
  }
10131
10095
  const format3 = extensionFormatMap[ext];
10132
10096
  if (format3)
@@ -10140,10 +10104,11 @@ function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
10140
10104
  function getHttpProtocolModuleFormat() {
10141
10105
  }
10142
10106
  function defaultGetFormatWithoutErrors(url, context) {
10143
- if (!hasOwnProperty2.call(protocolHandlers, url.protocol)) {
10107
+ const protocol = url.protocol;
10108
+ if (!hasOwnProperty2.call(protocolHandlers, protocol)) {
10144
10109
  return null;
10145
10110
  }
10146
- return protocolHandlers[url.protocol](url, context, true) || null;
10111
+ return protocolHandlers[protocol](url, context, true) || null;
10147
10112
  }
10148
10113
  var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
10149
10114
  var {
@@ -10154,8 +10119,7 @@ var {
10154
10119
  ERR_MODULE_NOT_FOUND,
10155
10120
  ERR_PACKAGE_IMPORT_NOT_DEFINED,
10156
10121
  ERR_PACKAGE_PATH_NOT_EXPORTED,
10157
- ERR_UNSUPPORTED_DIR_IMPORT,
10158
- ERR_UNSUPPORTED_ESM_URL_SCHEME
10122
+ ERR_UNSUPPORTED_DIR_IMPORT
10159
10123
  } = codes;
10160
10124
  var own = {}.hasOwnProperty;
10161
10125
  var invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i;
@@ -10166,6 +10130,9 @@ var encodedSepRegEx = /%2f|%5c/i;
10166
10130
  var emittedPackageWarnings = /* @__PURE__ */ new Set();
10167
10131
  var doubleSlashRegEx = /[/\\]{2}/;
10168
10132
  function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) {
10133
+ if (process$1.noDeprecation) {
10134
+ return;
10135
+ }
10169
10136
  const pjsonPath = fileURLToPath$1(packageJsonUrl);
10170
10137
  const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
10171
10138
  process$1.emitWarning(
@@ -10175,30 +10142,34 @@ function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, i
10175
10142
  );
10176
10143
  }
10177
10144
  function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
10145
+ if (process$1.noDeprecation) {
10146
+ return;
10147
+ }
10178
10148
  const format3 = defaultGetFormatWithoutErrors(url, { parentURL: base.href });
10179
10149
  if (format3 !== "module")
10180
10150
  return;
10181
- const path4 = fileURLToPath$1(url.href);
10151
+ const urlPath = fileURLToPath$1(url.href);
10182
10152
  const pkgPath = fileURLToPath$1(new URL$1(".", packageJsonUrl));
10183
10153
  const basePath = fileURLToPath$1(base);
10184
- if (main)
10154
+ if (!main) {
10185
10155
  process$1.emitWarning(
10186
- `Package ${pkgPath} has a "main" field set to ${JSON.stringify(main)}, excluding the full filename and extension to the resolved file at "${path4.slice(
10156
+ `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${urlPath.slice(
10187
10157
  pkgPath.length
10188
10158
  )}", imported from ${basePath}.
10189
- Automatic extension resolution of the "main" field isdeprecated for ES modules.`,
10159
+ Default "index" lookups for the main are deprecated for ES modules.`,
10190
10160
  "DeprecationWarning",
10191
10161
  "DEP0151"
10192
10162
  );
10193
- else
10163
+ } else if (path2.resolve(pkgPath, main) !== urlPath) {
10194
10164
  process$1.emitWarning(
10195
- `No "main" or "exports" field defined in the package.json for ${pkgPath} resolving the main entry point "${path4.slice(
10165
+ `Package ${pkgPath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
10196
10166
  pkgPath.length
10197
10167
  )}", imported from ${basePath}.
10198
- Default "index" lookups for the main are deprecated for ES modules.`,
10168
+ Automatic extension resolution of the "main" field is deprecated for ES modules.`,
10199
10169
  "DeprecationWarning",
10200
10170
  "DEP0151"
10201
10171
  );
10172
+ }
10202
10173
  }
10203
10174
  function tryStatSync(path4) {
10204
10175
  try {
@@ -10261,13 +10232,25 @@ function legacyMainResolve(packageJsonUrl, packageConfig, base) {
10261
10232
  );
10262
10233
  }
10263
10234
  function finalizeResolution(resolved, base, preserveSymlinks) {
10264
- if (encodedSepRegEx.exec(resolved.pathname) !== null)
10235
+ if (encodedSepRegEx.exec(resolved.pathname) !== null) {
10265
10236
  throw new ERR_INVALID_MODULE_SPECIFIER(
10266
10237
  resolved.pathname,
10267
10238
  'must not include encoded "/" or "\\" characters',
10268
10239
  fileURLToPath$1(base)
10269
10240
  );
10270
- const filePath = fileURLToPath$1(resolved);
10241
+ }
10242
+ let filePath;
10243
+ try {
10244
+ filePath = fileURLToPath$1(resolved);
10245
+ } catch (error) {
10246
+ const cause = (
10247
+ /** @type {ErrnoException} */
10248
+ error
10249
+ );
10250
+ Object.defineProperty(cause, "input", { value: String(resolved) });
10251
+ Object.defineProperty(cause, "module", { value: String(base) });
10252
+ throw cause;
10253
+ }
10271
10254
  const stats = tryStatSync(
10272
10255
  filePath.endsWith("/") ? filePath.slice(-1) : filePath
10273
10256
  );
@@ -10277,11 +10260,13 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
10277
10260
  throw error;
10278
10261
  }
10279
10262
  if (!stats.isFile()) {
10280
- throw new ERR_MODULE_NOT_FOUND(
10263
+ const error = new ERR_MODULE_NOT_FOUND(
10281
10264
  filePath || resolved.pathname,
10282
10265
  base && fileURLToPath$1(base),
10283
- "module"
10266
+ true
10284
10267
  );
10268
+ error.url = String(resolved);
10269
+ throw error;
10285
10270
  }
10286
10271
  if (!preserveSymlinks) {
10287
10272
  const real = realpathSync(filePath);
@@ -10549,6 +10534,9 @@ function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
10549
10534
  return isConditionalSugar;
10550
10535
  }
10551
10536
  function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {
10537
+ if (process$1.noDeprecation) {
10538
+ return;
10539
+ }
10552
10540
  const pjsonPath = fileURLToPath$1(pjsonUrl);
10553
10541
  if (emittedPackageWarnings.has(pjsonPath + "|" + match))
10554
10542
  return;
@@ -10780,7 +10768,10 @@ function packageResolve(specifier, base, conditions) {
10780
10768
  packageJsonPath = fileURLToPath$1(packageJsonUrl);
10781
10769
  continue;
10782
10770
  }
10783
- const packageConfig2 = getPackageConfig(packageJsonPath, specifier, base);
10771
+ const packageConfig2 = packageJsonReader.read(packageJsonPath, {
10772
+ base,
10773
+ specifier
10774
+ });
10784
10775
  if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) {
10785
10776
  return packageExportsResolve(
10786
10777
  packageJsonUrl,
@@ -10795,7 +10786,7 @@ function packageResolve(specifier, base, conditions) {
10795
10786
  }
10796
10787
  return new URL$1(packageSubpath, packageJsonUrl);
10797
10788
  } while (packageJsonPath.length !== lastPath.length);
10798
- throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath$1(base));
10789
+ throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath$1(base), false);
10799
10790
  }
10800
10791
  function isRelativeSpecifier(specifier) {
10801
10792
  if (specifier[0] === ".") {
@@ -10944,60 +10935,6 @@ function resolvePathSync(id, options) {
10944
10935
  }
10945
10936
 
10946
10937
  // node_modules/.pnpm/local-pkg@0.5.0/node_modules/local-pkg/dist/index.mjs
10947
- var Node3 = class {
10948
- constructor(value) {
10949
- __publicField(this, "value");
10950
- __publicField(this, "next");
10951
- this.value = value;
10952
- }
10953
- };
10954
- var _head, _tail, _size;
10955
- var Queue = class {
10956
- constructor() {
10957
- __privateAdd(this, _head, void 0);
10958
- __privateAdd(this, _tail, void 0);
10959
- __privateAdd(this, _size, void 0);
10960
- this.clear();
10961
- }
10962
- enqueue(value) {
10963
- const node2 = new Node3(value);
10964
- if (__privateGet(this, _head)) {
10965
- __privateGet(this, _tail).next = node2;
10966
- __privateSet(this, _tail, node2);
10967
- } else {
10968
- __privateSet(this, _head, node2);
10969
- __privateSet(this, _tail, node2);
10970
- }
10971
- __privateWrapper(this, _size)._++;
10972
- }
10973
- dequeue() {
10974
- const current2 = __privateGet(this, _head);
10975
- if (!current2) {
10976
- return;
10977
- }
10978
- __privateSet(this, _head, __privateGet(this, _head).next);
10979
- __privateWrapper(this, _size)._--;
10980
- return current2.value;
10981
- }
10982
- clear() {
10983
- __privateSet(this, _head, void 0);
10984
- __privateSet(this, _tail, void 0);
10985
- __privateSet(this, _size, 0);
10986
- }
10987
- get size() {
10988
- return __privateGet(this, _size);
10989
- }
10990
- *[Symbol.iterator]() {
10991
- let current2 = __privateGet(this, _head);
10992
- while (current2) {
10993
- yield current2.value;
10994
- current2 = current2.next;
10995
- }
10996
- }
10997
- };
10998
- _head = new WeakMap();
10999
- _tail = new WeakMap();
11000
- _size = new WeakMap();
11001
10938
  var findUpStop = Symbol("findUpStop");
11002
10939
  function _resolve2(path4, options = {}) {
11003
10940
  if (options.platform === "auto" || !options.platform)
@@ -11092,6 +11029,119 @@ var slowRules = [
11092
11029
  "@typescript-eslint/no-unsafe-return"
11093
11030
  ];
11094
11031
 
11032
+ // src/configs/md.ts
11033
+ function markdown(options = {}) {
11034
+ const { componentExts = [], overrides = {} } = options;
11035
+ const tsRulesOff = Object.fromEntries(
11036
+ // @ts-expect-error - undefined
11037
+ Object.keys(typescriptRulesTypeAware()).map((key) => [
11038
+ `@typescript-eslint/${key}`,
11039
+ "off"
11040
+ ])
11041
+ );
11042
+ return [
11043
+ {
11044
+ name: "jsse:markdown:setup",
11045
+ plugins: {
11046
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11047
+ markdown: default15
11048
+ }
11049
+ },
11050
+ {
11051
+ files: [GLOB_MARKDOWN],
11052
+ name: "jsse:markdown:processor",
11053
+ processor: "markdown/markdown"
11054
+ },
11055
+ {
11056
+ files: [
11057
+ GLOB_MARKDOWN_CODE,
11058
+ ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
11059
+ ],
11060
+ languageOptions: {
11061
+ parserOptions: {
11062
+ ecmaFeatures: {
11063
+ impliedStrict: true
11064
+ }
11065
+ }
11066
+ },
11067
+ name: "jsse:markdown:rules",
11068
+ rules: {
11069
+ "@typescript-eslint/consistent-type-imports": "off",
11070
+ "@typescript-eslint/no-namespace": "off",
11071
+ "@typescript-eslint/no-redeclare": "off",
11072
+ "@typescript-eslint/no-require-imports": "off",
11073
+ "@typescript-eslint/no-unused-vars": "off",
11074
+ "@typescript-eslint/no-use-before-define": "off",
11075
+ "@typescript-eslint/no-var-requires": "off",
11076
+ "no-alert": "off",
11077
+ "no-console": "off",
11078
+ "no-undef": "off",
11079
+ "no-unused-expressions": "off",
11080
+ "no-unused-vars": "off",
11081
+ "node/prefer-global/process": "off",
11082
+ // Type aware rules
11083
+ "object-curly-newline": "off",
11084
+ "style/comma-dangle": "off",
11085
+ "style/eol-last": "off",
11086
+ "unicode-bom": "off",
11087
+ "unused-imports/no-unused-imports": "off",
11088
+ "unused-imports/no-unused-vars": "off",
11089
+ ...tsRulesOff,
11090
+ ...overrides
11091
+ }
11092
+ }
11093
+ ];
11094
+ }
11095
+
11096
+ // src/configs/yml.ts
11097
+ async function yml(options = {}) {
11098
+ const { files = [GLOB_YAML], overrides = {}, stylistic: stylistic2 = true } = options;
11099
+ const { indent = 2, quotes = "single" } = typeof stylistic2 === "boolean" ? {} : stylistic2;
11100
+ const [pluginYaml, parserYaml] = await Promise.all([
11101
+ interopDefault(import("eslint-plugin-yml")),
11102
+ interopDefault(import("yaml-eslint-parser"))
11103
+ ]);
11104
+ return [
11105
+ {
11106
+ name: "jsse:yaml:setup",
11107
+ plugins: {
11108
+ yaml: pluginYaml
11109
+ }
11110
+ },
11111
+ {
11112
+ files,
11113
+ languageOptions: {
11114
+ parser: parserYaml
11115
+ },
11116
+ name: "antfu:yaml:rules",
11117
+ rules: {
11118
+ "style/spaced-comment": "off",
11119
+ "yaml/block-mapping": "error",
11120
+ "yaml/block-sequence": "error",
11121
+ "yaml/no-empty-key": "error",
11122
+ "yaml/no-empty-sequence-entry": "error",
11123
+ "yaml/no-irregular-whitespace": "error",
11124
+ "yaml/plain-scalar": "error",
11125
+ "yaml/vue-custom-block/no-parsing-error": "error",
11126
+ ...stylistic2 ? {
11127
+ "yaml/block-mapping-question-indicator-newline": "error",
11128
+ "yaml/block-sequence-hyphen-indicator-newline": "error",
11129
+ "yaml/flow-mapping-curly-newline": "error",
11130
+ "yaml/flow-mapping-curly-spacing": "error",
11131
+ "yaml/flow-sequence-bracket-newline": "error",
11132
+ "yaml/flow-sequence-bracket-spacing": "error",
11133
+ "yaml/indent": ["error", indent === "tab" ? 2 : indent],
11134
+ "yaml/key-spacing": "error",
11135
+ "yaml/no-tab-indent": "error",
11136
+ "yaml/quotes": ["error", { avoidEscape: false, prefer: quotes }],
11137
+ "yaml/spaced-comment": "error"
11138
+ } : {},
11139
+ ...overrides
11140
+ }
11141
+ }
11142
+ ];
11143
+ }
11144
+
11095
11145
  // src/factory.ts
11096
11146
  var flatConfigProps = [
11097
11147
  "files",
@@ -11111,6 +11161,7 @@ function defaultOptions2() {
11111
11161
  gitignore: true,
11112
11162
  isInEditor: isInEditor(),
11113
11163
  jsonc: true,
11164
+ markdown: false,
11114
11165
  off: [],
11115
11166
  overrides: {},
11116
11167
  prettier: true,
@@ -11143,7 +11194,7 @@ function normalizeOptions(options = {}) {
11143
11194
  stylistic: stylisticOptions
11144
11195
  };
11145
11196
  }
11146
- function jsse(options = {}, ...userConfigs) {
11197
+ async function jsse(options = {}, ...userConfigs) {
11147
11198
  const normalizedOptions = normalizeOptions(options);
11148
11199
  const {
11149
11200
  componentExts,
@@ -11178,9 +11229,7 @@ function jsse(options = {}, ...userConfigs) {
11178
11229
  }),
11179
11230
  comments(),
11180
11231
  node(),
11181
- jsdoc({
11182
- stylistic: stylisticOptions
11183
- }),
11232
+ jsdoc(),
11184
11233
  imports({
11185
11234
  stylistic: stylisticOptions
11186
11235
  }),
@@ -11188,24 +11237,31 @@ function jsse(options = {}, ...userConfigs) {
11188
11237
  perfectionist()
11189
11238
  );
11190
11239
  if (enableTypeScript) {
11191
- configs.push(
11192
- typescript({
11193
- ...typeof enableTypeScript === "boolean" ? {} : enableTypeScript,
11194
- componentExts,
11195
- overrides: overrides.typescript,
11196
- prefix: {
11197
- from: "@typescript-eslint",
11198
- to: tsPrefix ?? "@typescript-eslint"
11199
- },
11200
- react: enableReact,
11201
- typeAware
11202
- })
11203
- );
11240
+ const tscfg = await typescript({
11241
+ ...typeof enableTypeScript === "boolean" ? {} : enableTypeScript,
11242
+ componentExts,
11243
+ overrides: overrides.typescript,
11244
+ prefix: {
11245
+ from: "@typescript-eslint",
11246
+ to: tsPrefix ?? "@typescript-eslint"
11247
+ },
11248
+ react: enableReact,
11249
+ typeAware
11250
+ });
11251
+ configs.push(tscfg);
11252
+ }
11253
+ if (normalizedOptions.markdown) {
11254
+ configs.push(markdown());
11255
+ }
11256
+ if (normalizedOptions.yaml) {
11257
+ const ymlConfig = await yml();
11258
+ configs.push(ymlConfig);
11204
11259
  }
11205
11260
  if (normalizedOptions.react) {
11206
11261
  configs.push(
11207
11262
  react({
11208
- reactRefresh: options.reactRefresh
11263
+ // use react refresh if not explicitly disabled w/ 'false'
11264
+ reactRefresh: normalizedOptions.reactRefresh !== false
11209
11265
  })
11210
11266
  );
11211
11267
  }
@@ -11301,6 +11357,7 @@ export {
11301
11357
  eslintConfigPrettierRules,
11302
11358
  ignores,
11303
11359
  imports,
11360
+ interopDefault,
11304
11361
  isCI,
11305
11362
  isInEditor,
11306
11363
  javascript,
@@ -11318,8 +11375,8 @@ export {
11318
11375
  default5 as pluginJsdoc,
11319
11376
  pluginJsonc,
11320
11377
  default15 as pluginMarkdown,
11378
+ default6 as pluginN,
11321
11379
  default7 as pluginNoOnlyTests,
11322
- default6 as pluginNode,
11323
11380
  default16 as pluginPerfectionist,
11324
11381
  default8 as pluginReact,
11325
11382
  default9 as pluginReactHooks,