@icebreakers/eslint-config 1.0.4 → 1.1.1

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.
@@ -0,0 +1,1234 @@
1
+ import {
2
+ __dirname,
3
+ __export,
4
+ __require
5
+ } from "./chunk-Q36VO4VV.js";
6
+
7
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/index.js
8
+ var lib_exports2 = {};
9
+ __export(lib_exports2, {
10
+ DEFAULT_LANGUAGE_MAPPER: () => DEFAULT_LANGUAGE_MAPPER,
11
+ base: () => base,
12
+ cjsRequire: () => cjsRequire3,
13
+ codeBlocks: () => codeBlocks,
14
+ configs: () => configs,
15
+ createRemarkProcessor: () => createRemarkProcessor,
16
+ flat: () => flat,
17
+ flatCodeBlocks: () => flatCodeBlocks,
18
+ getGlobals: () => getGlobals,
19
+ getShortLang: () => getShortLang,
20
+ meta: () => meta2,
21
+ overrides: () => overrides,
22
+ processorOptions: () => processorOptions,
23
+ processors: () => processors,
24
+ recommended: () => recommended,
25
+ remark: () => remark2,
26
+ rules: () => rules
27
+ });
28
+
29
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/configs/base.js
30
+ var base = {
31
+ parser: "eslint-mdx",
32
+ parserOptions: {
33
+ sourceType: "module",
34
+ ecmaVersion: "latest"
35
+ },
36
+ plugins: ["mdx"],
37
+ processor: "mdx/remark",
38
+ rules: {
39
+ "mdx/remark": "warn",
40
+ "no-unused-expressions": "error"
41
+ }
42
+ };
43
+
44
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/configs/code-blocks.js
45
+ var codeBlocks = {
46
+ parserOptions: {
47
+ ecmaFeatures: {
48
+ impliedStrict: true
49
+ }
50
+ },
51
+ rules: {
52
+ "eol-last": "off",
53
+ "no-undef": "off",
54
+ "no-unused-expressions": "off",
55
+ "no-unused-vars": "off",
56
+ "@typescript-eslint/no-unused-vars": "off",
57
+ "padded-blocks": "off",
58
+ strict: "off",
59
+ "unicode-bom": "off"
60
+ }
61
+ };
62
+
63
+ // ../../node_modules/.pnpm/eslint-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-mdx/lib/index.js
64
+ var lib_exports = {};
65
+ __export(lib_exports, {
66
+ DEFAULT_EXTENSIONS: () => DEFAULT_EXTENSIONS,
67
+ MARKDOWN_EXTENSIONS: () => MARKDOWN_EXTENSIONS,
68
+ Parser: () => Parser,
69
+ arrayify: () => arrayify,
70
+ cjsRequire: () => cjsRequire,
71
+ getPhysicalFilename: () => getPhysicalFilename,
72
+ getPositionAtFactory: () => getPositionAtFactory,
73
+ meta: () => meta,
74
+ nextCharOffsetFactory: () => nextCharOffsetFactory,
75
+ normalizePosition: () => normalizePosition,
76
+ parse: () => parse,
77
+ parseForESLint: () => parseForESLint,
78
+ parser: () => parser,
79
+ performSyncWork: () => performSyncWork,
80
+ prevCharOffsetFactory: () => prevCharOffsetFactory
81
+ });
82
+
83
+ // ../../node_modules/.pnpm/eslint-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-mdx/lib/helpers.js
84
+ import fs from "node:fs";
85
+ import { createRequire } from "node:module";
86
+ import path from "node:path";
87
+ var arrayify = (...args) => args.reduce((arr, curr) => {
88
+ arr.push(...Array.isArray(curr) ? curr : curr == null ? [] : [curr]);
89
+ return arr;
90
+ }, []);
91
+ var getPhysicalFilename = (filename, child) => {
92
+ try {
93
+ if (fs.statSync(filename).isDirectory()) {
94
+ return child || filename;
95
+ }
96
+ } catch (err) {
97
+ const { code } = err;
98
+ if (code === "ENOTDIR" || code === "ENOENT") {
99
+ return getPhysicalFilename(path.dirname(filename), filename);
100
+ }
101
+ }
102
+ return filename;
103
+ };
104
+ var getPositionAtFactory = (code) => {
105
+ const lines = code.split("\n");
106
+ return (offset) => {
107
+ let currOffset = 0;
108
+ for (const [index, line_] of lines.entries()) {
109
+ const line = index + 1;
110
+ const nextOffset = currOffset + line_.length;
111
+ if (nextOffset >= offset) {
112
+ return {
113
+ line,
114
+ column: offset - currOffset
115
+ };
116
+ }
117
+ currOffset = nextOffset + 1;
118
+ }
119
+ };
120
+ };
121
+ var normalizePosition = ({ start, end, code }) => {
122
+ const startOffset = start.offset;
123
+ const endOffset = end.offset;
124
+ const range = [startOffset, endOffset];
125
+ const getPositionAt = code == null ? null : getPositionAtFactory(code);
126
+ return {
127
+ start: startOffset,
128
+ end: endOffset,
129
+ loc: {
130
+ start: "line" in start ? start : getPositionAt(startOffset),
131
+ end: "line" in end ? end : getPositionAt(endOffset)
132
+ },
133
+ range
134
+ };
135
+ };
136
+ var prevCharOffsetFactory = (code) => (offset) => {
137
+ for (let i = offset; i >= 0; i--) {
138
+ const char = code[i];
139
+ if (/^\S$/.test(char)) {
140
+ return i;
141
+ }
142
+ }
143
+ };
144
+ var nextCharOffsetFactory = (text) => {
145
+ const total = text.length;
146
+ return (offset) => {
147
+ for (let i = offset; i <= total; i++) {
148
+ const char = text[i];
149
+ if (/^\S$/.test(char)) {
150
+ return i;
151
+ }
152
+ }
153
+ };
154
+ };
155
+ var cjsRequire = typeof __require === "undefined" ? createRequire(import.meta.url) : __require;
156
+
157
+ // ../../node_modules/.pnpm/eslint-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-mdx/lib/meta.js
158
+ var pkg = cjsRequire("../package.json");
159
+ var meta = { name: pkg.name, version: pkg.version };
160
+
161
+ // ../../node_modules/.pnpm/eslint-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-mdx/lib/parser.js
162
+ import path5 from "node:path";
163
+
164
+ // ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
165
+ function __rest(s, e) {
166
+ var t = {};
167
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
168
+ t[p] = s[p];
169
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
170
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
171
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
172
+ t[p[i]] = s[p[i]];
173
+ }
174
+ return t;
175
+ }
176
+
177
+ // ../../node_modules/.pnpm/synckit@0.11.3/node_modules/synckit/lib/index.js
178
+ import path4 from "node:path";
179
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
180
+
181
+ // ../../node_modules/.pnpm/synckit@0.11.3/node_modules/synckit/lib/common.js
182
+ var _a;
183
+ var NODE_OPTIONS = (_a = process.env.NODE_OPTIONS) === null || _a === void 0 ? void 0 : _a.split(/\s+/);
184
+ var hasFlag = (flag) => (NODE_OPTIONS === null || NODE_OPTIONS === void 0 ? void 0 : NODE_OPTIONS.includes(flag)) || process.argv.includes(flag);
185
+ var parseVersion = (version) => version.split(".").map(Number.parseFloat);
186
+ var compareVersion = (version1, version2) => {
187
+ const versions1 = parseVersion(version1);
188
+ const versions2 = parseVersion(version2);
189
+ const length = Math.max(versions1.length, versions2.length);
190
+ for (let i = 0; i < length; i++) {
191
+ const v1 = versions1[i] || 0;
192
+ const v2 = versions2[i] || 0;
193
+ if (v1 > v2) {
194
+ return 1;
195
+ }
196
+ if (v1 < v2) {
197
+ return -1;
198
+ }
199
+ }
200
+ return 0;
201
+ };
202
+ var NODE_VERSION = process.versions.node;
203
+ var compareNodeVersion = (version) => compareVersion(NODE_VERSION, version);
204
+
205
+ // ../../node_modules/.pnpm/synckit@0.11.3/node_modules/synckit/lib/constants.js
206
+ var TsRunner = {
207
+ Node: "node",
208
+ Bun: "bun",
209
+ TsNode: "ts-node",
210
+ EsbuildRegister: "esbuild-register",
211
+ EsbuildRunner: "esbuild-runner",
212
+ OXC: "oxc",
213
+ SWC: "swc",
214
+ TSX: "tsx"
215
+ };
216
+ var { NODE_OPTIONS: NODE_OPTIONS_ = "", SYNCKIT_EXEC_ARGV = "", SYNCKIT_GLOBAL_SHIMS, SYNCKIT_TIMEOUT, SYNCKIT_TS_RUNNER } = process.env;
217
+ var TS_ESM_PARTIAL_SUPPORTED = compareNodeVersion("16") >= 0 && compareNodeVersion("18.19") < 0;
218
+ var MTS_SUPPORTED = compareNodeVersion("20.8") >= 0;
219
+ var MODULE_REGISTER_SUPPORTED = MTS_SUPPORTED || compareNodeVersion("18.19") >= 0;
220
+ var STRIP_TYPES_NODE_VERSION = "22.6";
221
+ var TRANSFORM_TYPES_NODE_VERSION = "22.7";
222
+ var FEATURE_TYPESCRIPT_NODE_VERSION = "22.10";
223
+ var DEFAULT_TYPES_NODE_VERSION = "23.6";
224
+ var STRIP_TYPES_FLAG = "--experimental-strip-types";
225
+ var TRANSFORM_TYPES_FLAG = "--experimental-transform-types";
226
+ var NO_STRIP_TYPES_FLAG = "--no-experimental-strip-types";
227
+ var NODE_OPTIONS2 = NODE_OPTIONS_.split(/\s+/);
228
+ var NO_STRIP_TYPES = hasFlag(NO_STRIP_TYPES_FLAG) && (compareNodeVersion(FEATURE_TYPESCRIPT_NODE_VERSION) >= 0 ? process.features.typescript === false : !hasFlag(STRIP_TYPES_FLAG) && !hasFlag(TRANSFORM_TYPES_FLAG));
229
+ var DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : void 0;
230
+ var DEFAULT_EXEC_ARGV = SYNCKIT_EXEC_ARGV.split(",");
231
+ var DEFAULT_TS_RUNNER = SYNCKIT_TS_RUNNER;
232
+ var DEFAULT_GLOBAL_SHIMS = ["1", "true"].includes(SYNCKIT_GLOBAL_SHIMS);
233
+ var DEFAULT_GLOBAL_SHIMS_PRESET = [
234
+ {
235
+ moduleName: "node-fetch",
236
+ globalName: "fetch"
237
+ },
238
+ {
239
+ moduleName: "node:perf_hooks",
240
+ globalName: "performance",
241
+ named: "performance"
242
+ }
243
+ ];
244
+ var IMPORT_FLAG = "--import";
245
+ var REQUIRE_FLAG = "--require";
246
+ var REQUIRE_ABBR_FLAG = "-r";
247
+ var REQUIRE_FLAGS = /* @__PURE__ */ new Set([REQUIRE_FLAG, REQUIRE_ABBR_FLAG]);
248
+ var LOADER_FLAG = "--loader";
249
+ var EXPERIMENTAL_LOADER_FLAG = "--experimental-loader";
250
+ var LOADER_FLAGS = /* @__PURE__ */ new Set([LOADER_FLAG, EXPERIMENTAL_LOADER_FLAG]);
251
+ var IMPORT_FLAG_SUPPORTED = compareNodeVersion("20.6") >= 0;
252
+ var INT32_BYTES = 4;
253
+
254
+ // ../../node_modules/.pnpm/synckit@0.11.3/node_modules/synckit/lib/helpers.js
255
+ import { createHash } from "node:crypto";
256
+ import fs3 from "node:fs";
257
+ import path3 from "node:path";
258
+ import { fileURLToPath, pathToFileURL } from "node:url";
259
+ import { MessageChannel, Worker, receiveMessageOnPort } from "node:worker_threads";
260
+
261
+ // ../../node_modules/.pnpm/@pkgr+core@0.2.2/node_modules/@pkgr/core/lib/constants.js
262
+ import { createRequire as createRequire2 } from "node:module";
263
+ var CWD = process.cwd();
264
+ var cjsRequire2 = typeof __require === "undefined" ? createRequire2(import.meta.url) : __require;
265
+ var EXTENSIONS = [".ts", ".tsx", ...Object.keys(cjsRequire2.extensions)];
266
+
267
+ // ../../node_modules/.pnpm/@pkgr+core@0.2.2/node_modules/@pkgr/core/lib/helpers.js
268
+ import fs2 from "node:fs";
269
+ import path2 from "node:path";
270
+ var tryPkg = (pkg3) => {
271
+ try {
272
+ return cjsRequire2.resolve(pkg3);
273
+ } catch {
274
+ }
275
+ };
276
+ var isPkgAvailable = (pkg3) => !!tryPkg(pkg3);
277
+ var tryFile = (filename, includeDir = false, base2 = CWD) => {
278
+ if (typeof filename === "string") {
279
+ const filepath = path2.resolve(base2, filename);
280
+ return fs2.existsSync(filepath) && (includeDir || fs2.statSync(filepath).isFile()) ? filepath : "";
281
+ }
282
+ for (const file of filename ?? []) {
283
+ const filepath = tryFile(file, includeDir, base2);
284
+ if (filepath) {
285
+ return filepath;
286
+ }
287
+ }
288
+ return "";
289
+ };
290
+ var tryExtensions = (filepath, extensions = EXTENSIONS) => {
291
+ const ext = [...extensions, ""].find((ext2) => tryFile(filepath + ext2));
292
+ return ext == null ? "" : filepath + ext;
293
+ };
294
+ var findUp = (searchEntry, searchFileOrIncludeDir, includeDir) => {
295
+ console.assert(path2.isAbsolute(searchEntry));
296
+ if (!tryFile(searchEntry, true) || searchEntry !== CWD && !searchEntry.startsWith(CWD + path2.sep)) {
297
+ return "";
298
+ }
299
+ searchEntry = path2.resolve(fs2.statSync(searchEntry).isDirectory() ? searchEntry : path2.resolve(searchEntry, ".."));
300
+ const isSearchFile = typeof searchFileOrIncludeDir === "string";
301
+ const searchFile = isSearchFile ? searchFileOrIncludeDir : "package.json";
302
+ do {
303
+ const searched = tryFile(path2.resolve(searchEntry, searchFile), isSearchFile && includeDir);
304
+ if (searched) {
305
+ return searched;
306
+ }
307
+ searchEntry = path2.resolve(searchEntry, "..");
308
+ } while (searchEntry === CWD || searchEntry.startsWith(CWD + path2.sep));
309
+ return "";
310
+ };
311
+
312
+ // ../../node_modules/.pnpm/synckit@0.11.3/node_modules/synckit/lib/helpers.js
313
+ var isFile = (path7) => {
314
+ var _a2;
315
+ try {
316
+ return !!((_a2 = fs3.statSync(path7, { throwIfNoEntry: false })) === null || _a2 === void 0 ? void 0 : _a2.isFile());
317
+ } catch (_b) {
318
+ return false;
319
+ }
320
+ };
321
+ var dataUrl = (code) => new URL(`data:text/javascript,${encodeURIComponent(code)}`);
322
+ var hasRequireFlag = (execArgv) => execArgv.some((execArg) => REQUIRE_FLAGS.has(execArg));
323
+ var hasImportFlag = (execArgv) => execArgv.includes(IMPORT_FLAG);
324
+ var hasLoaderFlag = (execArgv) => execArgv.some((execArg) => LOADER_FLAGS.has(execArg));
325
+ var setupTsRunner = (workerPath, { execArgv = DEFAULT_EXEC_ARGV, tsRunner } = {}) => {
326
+ let ext = path3.extname(workerPath);
327
+ if (!/([/\\])node_modules\1/.test(workerPath) && (!ext || /^\.[cm]?js$/.test(ext))) {
328
+ const workPathWithoutExt = ext ? workerPath.slice(0, -ext.length) : workerPath;
329
+ let extensions;
330
+ switch (ext) {
331
+ case ".cjs": {
332
+ extensions = [".cts", ".cjs"];
333
+ break;
334
+ }
335
+ case ".mjs": {
336
+ extensions = [".mts", ".mjs"];
337
+ break;
338
+ }
339
+ default: {
340
+ extensions = [".ts", ".js"];
341
+ break;
342
+ }
343
+ }
344
+ const found = tryExtensions(workPathWithoutExt, extensions);
345
+ let differentExt;
346
+ if (found && (!ext || (differentExt = found !== workPathWithoutExt))) {
347
+ workerPath = found;
348
+ if (differentExt) {
349
+ ext = path3.extname(workerPath);
350
+ }
351
+ }
352
+ }
353
+ const isTs = /\.[cm]?ts$/.test(workerPath);
354
+ let jsUseEsm = ext === ".mjs";
355
+ let tsUseEsm = ext === ".mts";
356
+ if (isTs) {
357
+ if (!tsUseEsm && ext !== ".cts") {
358
+ const pkg3 = findUp(workerPath);
359
+ if (pkg3) {
360
+ tsUseEsm = cjsRequire2(pkg3).type === "module";
361
+ }
362
+ }
363
+ const stripTypesIndex = execArgv.indexOf(STRIP_TYPES_FLAG);
364
+ const transformTypesIndex = execArgv.indexOf(TRANSFORM_TYPES_FLAG);
365
+ const noStripTypesIndex = execArgv.indexOf(NO_STRIP_TYPES_FLAG);
366
+ const execArgvNoStripTypes = noStripTypesIndex > stripTypesIndex || noStripTypesIndex > transformTypesIndex;
367
+ const noStripTypes = execArgvNoStripTypes || stripTypesIndex === -1 && transformTypesIndex === -1 && NO_STRIP_TYPES;
368
+ if (tsRunner == null) {
369
+ if (process.versions.bun) {
370
+ tsRunner = TsRunner.Bun;
371
+ } else if (!noStripTypes && compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0) {
372
+ tsRunner = TsRunner.Node;
373
+ } else if (isPkgAvailable(TsRunner.TsNode)) {
374
+ tsRunner = TsRunner.TsNode;
375
+ }
376
+ }
377
+ switch (tsRunner) {
378
+ case TsRunner.Bun: {
379
+ break;
380
+ }
381
+ case TsRunner.Node: {
382
+ if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) < 0) {
383
+ throw new Error("type stripping is not supported in this node version");
384
+ }
385
+ if (noStripTypes) {
386
+ throw new Error("type stripping is disabled explicitly");
387
+ }
388
+ if (compareNodeVersion(DEFAULT_TYPES_NODE_VERSION) >= 0) {
389
+ break;
390
+ }
391
+ if (compareNodeVersion(TRANSFORM_TYPES_NODE_VERSION) >= 0 && !execArgv.includes(TRANSFORM_TYPES_FLAG)) {
392
+ execArgv = [TRANSFORM_TYPES_FLAG, ...execArgv];
393
+ } else if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0 && !execArgv.includes(STRIP_TYPES_FLAG)) {
394
+ execArgv = [STRIP_TYPES_FLAG, ...execArgv];
395
+ }
396
+ break;
397
+ }
398
+ case TsRunner.TsNode: {
399
+ if (tsUseEsm) {
400
+ if (!execArgv.includes(LOADER_FLAG)) {
401
+ execArgv = [LOADER_FLAG, `${TsRunner.TsNode}/esm`, ...execArgv];
402
+ }
403
+ } else if (!hasRequireFlag(execArgv)) {
404
+ execArgv = [
405
+ REQUIRE_ABBR_FLAG,
406
+ `${TsRunner.TsNode}/register`,
407
+ ...execArgv
408
+ ];
409
+ }
410
+ break;
411
+ }
412
+ case TsRunner.EsbuildRegister: {
413
+ if (tsUseEsm) {
414
+ if (!hasLoaderFlag(execArgv)) {
415
+ execArgv = [
416
+ LOADER_FLAG,
417
+ `${TsRunner.EsbuildRegister}/loader`,
418
+ ...execArgv
419
+ ];
420
+ }
421
+ } else if (!hasRequireFlag(execArgv)) {
422
+ execArgv = [REQUIRE_ABBR_FLAG, TsRunner.EsbuildRegister, ...execArgv];
423
+ }
424
+ break;
425
+ }
426
+ case TsRunner.EsbuildRunner: {
427
+ if (!hasRequireFlag(execArgv)) {
428
+ execArgv = [
429
+ REQUIRE_ABBR_FLAG,
430
+ `${TsRunner.EsbuildRunner}/register`,
431
+ ...execArgv
432
+ ];
433
+ }
434
+ break;
435
+ }
436
+ case TsRunner.OXC: {
437
+ if (!execArgv.includes(IMPORT_FLAG)) {
438
+ execArgv = [
439
+ IMPORT_FLAG,
440
+ `@${TsRunner.OXC}-node/core/register`,
441
+ ...execArgv
442
+ ];
443
+ }
444
+ break;
445
+ }
446
+ case TsRunner.SWC: {
447
+ if (tsUseEsm) {
448
+ if (IMPORT_FLAG_SUPPORTED) {
449
+ if (!hasImportFlag(execArgv)) {
450
+ execArgv = [
451
+ IMPORT_FLAG,
452
+ `@${TsRunner.SWC}-node/register/esm-register`,
453
+ ...execArgv
454
+ ];
455
+ }
456
+ } else if (!hasLoaderFlag(execArgv)) {
457
+ execArgv = [
458
+ LOADER_FLAG,
459
+ `@${TsRunner.SWC}-node/register/esm`,
460
+ ...execArgv
461
+ ];
462
+ }
463
+ } else if (!hasRequireFlag(execArgv)) {
464
+ execArgv = [
465
+ REQUIRE_ABBR_FLAG,
466
+ `@${TsRunner.SWC}-node/register`,
467
+ ...execArgv
468
+ ];
469
+ }
470
+ break;
471
+ }
472
+ case TsRunner.TSX: {
473
+ if (IMPORT_FLAG_SUPPORTED) {
474
+ if (!execArgv.includes(IMPORT_FLAG)) {
475
+ execArgv = [IMPORT_FLAG, TsRunner.TSX, ...execArgv];
476
+ }
477
+ } else if (!execArgv.includes(LOADER_FLAG)) {
478
+ execArgv = [LOADER_FLAG, TsRunner.TSX, ...execArgv];
479
+ }
480
+ break;
481
+ }
482
+ default: {
483
+ throw new Error(`Unknown ts runner: ${String(tsRunner)}`);
484
+ }
485
+ }
486
+ } else if (!jsUseEsm && ext !== ".cjs") {
487
+ const pkg3 = findUp(workerPath);
488
+ if (pkg3) {
489
+ jsUseEsm = cjsRequire2(pkg3).type === "module";
490
+ }
491
+ }
492
+ let resolvedPnpLoaderPath;
493
+ if (process.versions.pnp) {
494
+ let pnpApiPath;
495
+ try {
496
+ pnpApiPath = cjsRequire2.resolve("pnpapi");
497
+ } catch (_a2) {
498
+ }
499
+ if (pnpApiPath && !NODE_OPTIONS2.some((option, index) => REQUIRE_FLAGS.has(option) && pnpApiPath === cjsRequire2.resolve(NODE_OPTIONS2[index + 1])) && !execArgv.includes(pnpApiPath)) {
500
+ execArgv = [REQUIRE_ABBR_FLAG, pnpApiPath, ...execArgv];
501
+ const pnpLoaderPath = path3.resolve(pnpApiPath, "../.pnp.loader.mjs");
502
+ if (isFile(pnpLoaderPath)) {
503
+ resolvedPnpLoaderPath = pathToFileURL(pnpLoaderPath).href;
504
+ if (!MODULE_REGISTER_SUPPORTED) {
505
+ execArgv = [LOADER_FLAG, resolvedPnpLoaderPath, ...execArgv];
506
+ }
507
+ }
508
+ }
509
+ }
510
+ return {
511
+ ext,
512
+ isTs,
513
+ jsUseEsm,
514
+ tsRunner,
515
+ tsUseEsm,
516
+ workerPath,
517
+ pnpLoaderPath: resolvedPnpLoaderPath,
518
+ execArgv
519
+ };
520
+ };
521
+ var md5Hash = (text) => createHash("md5").update(text).digest("hex");
522
+ var encodeImportModule = (moduleNameOrGlobalShim, type = "import") => {
523
+ const { moduleName, globalName, named, conditional } = typeof moduleNameOrGlobalShim === "string" ? { moduleName: moduleNameOrGlobalShim } : moduleNameOrGlobalShim;
524
+ const importStatement = type === "import" ? `import${globalName ? " " + (named === null ? "* as " + globalName : (named === null || named === void 0 ? void 0 : named.trim()) ? `{${named}}` : globalName) + " from" : ""} '${path3.isAbsolute(moduleName) ? String(pathToFileURL(moduleName)) : moduleName}'` : `${globalName ? "const " + ((named === null || named === void 0 ? void 0 : named.trim()) ? `{${named}}` : globalName) + "=" : ""}require('${moduleName.replace(/\\/g, "\\\\")}')`;
525
+ if (!globalName) {
526
+ return importStatement;
527
+ }
528
+ const overrideStatement = `globalThis.${globalName}=${(named === null || named === void 0 ? void 0 : named.trim()) ? named : globalName}`;
529
+ return importStatement + (conditional === false ? `;${overrideStatement}` : `;if(!globalThis.${globalName})${overrideStatement}`);
530
+ };
531
+ var _generateGlobals = (globalShims, type) => globalShims.reduce((acc, shim) => `${acc}${acc ? ";" : ""}${encodeImportModule(shim, type)}`, "");
532
+ var globalsCache;
533
+ var tmpdir;
534
+ var _dirname = typeof __dirname === "undefined" ? path3.dirname(fileURLToPath(import.meta.url)) : __dirname;
535
+ var generateGlobals = (workerPath, globalShims, type = "import") => {
536
+ if (globalShims.length === 0) {
537
+ return "";
538
+ }
539
+ globalsCache !== null && globalsCache !== void 0 ? globalsCache : globalsCache = /* @__PURE__ */ new Map();
540
+ const cached = globalsCache.get(workerPath);
541
+ if (cached) {
542
+ const [content2, filepath2] = cached;
543
+ if (type === "require" && !filepath2 || type === "import" && filepath2 && isFile(filepath2)) {
544
+ return content2;
545
+ }
546
+ }
547
+ const globals = _generateGlobals(globalShims, type);
548
+ let content = globals;
549
+ let filepath;
550
+ if (type === "import") {
551
+ if (!tmpdir) {
552
+ tmpdir = path3.resolve(findUp(_dirname), "../node_modules/.synckit");
553
+ }
554
+ fs3.mkdirSync(tmpdir, { recursive: true });
555
+ filepath = path3.resolve(tmpdir, md5Hash(workerPath) + ".mjs");
556
+ content = encodeImportModule(filepath);
557
+ fs3.writeFileSync(filepath, globals);
558
+ }
559
+ globalsCache.set(workerPath, [content, filepath]);
560
+ return content;
561
+ };
562
+ var sharedBuffer;
563
+ var sharedBufferView;
564
+ function startWorkerThread(workerPath, { timeout = DEFAULT_TIMEOUT, execArgv = DEFAULT_EXEC_ARGV, tsRunner = DEFAULT_TS_RUNNER, transferList = [], globalShims = DEFAULT_GLOBAL_SHIMS } = {}) {
565
+ const { port1: mainPort, port2: workerPort } = new MessageChannel();
566
+ const { isTs, ext, jsUseEsm, tsUseEsm, tsRunner: finalTsRunner, workerPath: finalWorkerPath, pnpLoaderPath, execArgv: finalExecArgv } = setupTsRunner(workerPath, { execArgv, tsRunner });
567
+ const workerPathUrl = pathToFileURL(finalWorkerPath);
568
+ if (/\.[cm]ts$/.test(finalWorkerPath)) {
569
+ const isTsxSupported = !tsUseEsm || TS_ESM_PARTIAL_SUPPORTED;
570
+ if (!finalTsRunner) {
571
+ throw new Error("No ts runner specified, ts worker path is not supported");
572
+ } else if ([
573
+ TsRunner.EsbuildRegister,
574
+ TsRunner.EsbuildRunner,
575
+ ...TS_ESM_PARTIAL_SUPPORTED ? [
576
+ TsRunner.OXC,
577
+ TsRunner.SWC
578
+ ] : [],
579
+ ...isTsxSupported ? [] : [TsRunner.TSX]
580
+ ].includes(finalTsRunner)) {
581
+ throw new Error(`${finalTsRunner} is not supported for ${ext} files yet` + (isTsxSupported ? ", you can try [tsx](https://github.com/esbuild-kit/tsx) instead" : MTS_SUPPORTED ? ", you can try [oxc](https://github.com/oxc-project/oxc-node) or [swc](https://github.com/swc-project/swc-node/tree/master/packages/register) instead" : ""));
582
+ }
583
+ }
584
+ const finalGlobalShims = (globalShims === true ? DEFAULT_GLOBAL_SHIMS_PRESET : Array.isArray(globalShims) ? globalShims : []).filter(({ moduleName }) => isPkgAvailable(moduleName));
585
+ sharedBufferView !== null && sharedBufferView !== void 0 ? sharedBufferView : sharedBufferView = new Int32Array(sharedBuffer !== null && sharedBuffer !== void 0 ? sharedBuffer : sharedBuffer = new SharedArrayBuffer(INT32_BYTES), 0, 1);
586
+ const useGlobals = finalGlobalShims.length > 0;
587
+ const useEval = isTs ? !tsUseEsm : !jsUseEsm && useGlobals;
588
+ const worker = new Worker(jsUseEsm && useGlobals || tsUseEsm && finalTsRunner === TsRunner.TsNode ? dataUrl(`${generateGlobals(finalWorkerPath, finalGlobalShims)};import '${String(workerPathUrl)}'`) : useEval ? `${generateGlobals(finalWorkerPath, finalGlobalShims, "require")};${encodeImportModule(finalWorkerPath, "require")}` : workerPathUrl, {
589
+ eval: useEval,
590
+ workerData: { sharedBufferView, workerPort, pnpLoaderPath },
591
+ transferList: [workerPort, ...transferList],
592
+ execArgv: finalExecArgv
593
+ });
594
+ let nextID = 0;
595
+ const receiveMessageWithId = (port, expectedId, waitingTimeout) => {
596
+ const start = Date.now();
597
+ const status = Atomics.wait(sharedBufferView, 0, 0, waitingTimeout);
598
+ Atomics.store(sharedBufferView, 0, 0);
599
+ if (!["ok", "not-equal"].includes(status)) {
600
+ const abortMsg = {
601
+ id: expectedId,
602
+ cmd: "abort"
603
+ };
604
+ port.postMessage(abortMsg);
605
+ throw new Error("Internal error: Atomics.wait() failed: " + status);
606
+ }
607
+ const _a2 = receiveMessageOnPort(mainPort).message, { id } = _a2, message = __rest(_a2, ["id"]);
608
+ if (id < expectedId) {
609
+ const waitingTime = Date.now() - start;
610
+ return receiveMessageWithId(port, expectedId, waitingTimeout ? waitingTimeout - waitingTime : void 0);
611
+ }
612
+ if (expectedId !== id) {
613
+ throw new Error(`Internal error: Expected id ${expectedId} but got id ${id}`);
614
+ }
615
+ return Object.assign({ id }, message);
616
+ };
617
+ const syncFn = (...args) => {
618
+ const id = nextID++;
619
+ const msg = { id, args };
620
+ worker.postMessage(msg);
621
+ const { result, error, properties, stdio } = receiveMessageWithId(mainPort, id, timeout);
622
+ for (const { type, chunk, encoding } of stdio) {
623
+ process[type].write(chunk, encoding);
624
+ }
625
+ if (error) {
626
+ throw Object.assign(error, properties);
627
+ }
628
+ return result;
629
+ };
630
+ worker.unref();
631
+ return syncFn;
632
+ }
633
+
634
+ // ../../node_modules/.pnpm/synckit@0.11.3/node_modules/synckit/lib/index.js
635
+ var syncFnCache;
636
+ function createSyncFn(workerPath, timeoutOrOptions) {
637
+ syncFnCache !== null && syncFnCache !== void 0 ? syncFnCache : syncFnCache = /* @__PURE__ */ new Map();
638
+ if (typeof workerPath !== "string" || workerPath.startsWith("file://")) {
639
+ workerPath = fileURLToPath2(workerPath);
640
+ }
641
+ const cachedSyncFn = syncFnCache.get(workerPath);
642
+ if (cachedSyncFn) {
643
+ return cachedSyncFn;
644
+ }
645
+ if (!path4.isAbsolute(workerPath)) {
646
+ throw new Error("`workerPath` must be absolute");
647
+ }
648
+ const syncFn = startWorkerThread(workerPath, typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions);
649
+ syncFnCache.set(workerPath, syncFn);
650
+ return syncFn;
651
+ }
652
+
653
+ // ../../node_modules/.pnpm/eslint-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-mdx/lib/sync.js
654
+ var performSyncWork = createSyncFn(cjsRequire.resolve("./worker.js"));
655
+
656
+ // ../../node_modules/.pnpm/eslint-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-mdx/lib/parser.js
657
+ var DEFAULT_EXTENSIONS = [".mdx"];
658
+ var MARKDOWN_EXTENSIONS = [".md"];
659
+ var Parser = class {
660
+ constructor() {
661
+ this.parse = this.parse.bind(this);
662
+ this.parseForESLint = this.parseForESLint.bind(this);
663
+ }
664
+ parse(code, options) {
665
+ return this.parseForESLint(code, options).ast;
666
+ }
667
+ parseForESLint(code, { filePath, sourceType, ignoreRemarkConfig, extensions, markdownExtensions }) {
668
+ const extname = path5.extname(filePath);
669
+ const isMdx = [...DEFAULT_EXTENSIONS, ...arrayify(extensions)].includes(extname);
670
+ const isMarkdown = [
671
+ ...MARKDOWN_EXTENSIONS,
672
+ ...arrayify(markdownExtensions)
673
+ ].includes(extname);
674
+ if (!isMdx && !isMarkdown) {
675
+ throw new Error("Unsupported file extension, make sure setting the `extensions` or `markdownExtensions` option correctly.");
676
+ }
677
+ let result;
678
+ try {
679
+ result = performSyncWork({
680
+ filePath: getPhysicalFilename(filePath),
681
+ code,
682
+ isMdx,
683
+ ignoreRemarkConfig
684
+ });
685
+ } catch (err) {
686
+ if (process.argv.includes("--debug")) {
687
+ console.error(err);
688
+ }
689
+ const { message, line, column, place } = err;
690
+ const point = place && ("start" in place ? place.start : place);
691
+ throw Object.assign(new SyntaxError(message, {
692
+ cause: err
693
+ }), {
694
+ lineNumber: line,
695
+ column,
696
+ index: point?.offset
697
+ });
698
+ }
699
+ const { root, body, comments, tokens } = result;
700
+ return {
701
+ ast: {
702
+ ...normalizePosition(root.position),
703
+ type: "Program",
704
+ sourceType,
705
+ body,
706
+ comments,
707
+ tokens
708
+ }
709
+ };
710
+ }
711
+ };
712
+ var parser = new Parser();
713
+ var { parse, parseForESLint } = parser;
714
+
715
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/configs/flat.js
716
+ var flat = {
717
+ files: ["**/*.{md,mdx}"],
718
+ languageOptions: {
719
+ sourceType: "module",
720
+ ecmaVersion: "latest",
721
+ parser: lib_exports,
722
+ globals: {
723
+ React: false
724
+ }
725
+ },
726
+ plugins: {
727
+ mdx: lib_exports2
728
+ },
729
+ rules: {
730
+ "mdx/remark": "warn",
731
+ "no-unused-expressions": "error",
732
+ "react/react-in-jsx-scope": "off"
733
+ }
734
+ };
735
+ var { parserOptions, ...restConfig } = codeBlocks;
736
+ var flatCodeBlocks = {
737
+ files: ["**/*.{md,mdx}/**"],
738
+ languageOptions: {
739
+ parserOptions
740
+ },
741
+ ...restConfig
742
+ };
743
+
744
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/helpers.js
745
+ import { createRequire as createRequire3 } from "node:module";
746
+ var getGlobals = (sources, initialGlobals = {}) => (Array.isArray(sources) ? sources : Object.keys(sources)).reduce((globals, source) => Object.assign(globals, {
747
+ [source]: false
748
+ }), initialGlobals);
749
+ var cjsRequire3 = typeof __require === "undefined" ? createRequire3(import.meta.url) : __require;
750
+
751
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/configs/overrides.js
752
+ var isReactPluginAvailable = false;
753
+ try {
754
+ cjsRequire3.resolve("eslint-plugin-react");
755
+ isReactPluginAvailable = true;
756
+ } catch {
757
+ }
758
+ var overrides = {
759
+ ...base,
760
+ globals: {
761
+ React: false
762
+ },
763
+ plugins: arrayify(base.plugins, isReactPluginAvailable ? "react" : null),
764
+ rules: {
765
+ "react/jsx-no-undef": isReactPluginAvailable ? [
766
+ 2,
767
+ {
768
+ allowGlobals: true
769
+ }
770
+ ] : 0,
771
+ "react/react-in-jsx-scope": 0
772
+ }
773
+ };
774
+
775
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/configs/recommended.js
776
+ var overrides2 = [
777
+ {
778
+ files: ["*.md", "*.mdx"],
779
+ extends: "plugin:mdx/overrides",
780
+ ...base
781
+ },
782
+ {
783
+ files: "**/*.{md,mdx}/**",
784
+ extends: "plugin:mdx/code-blocks"
785
+ }
786
+ ];
787
+ var recommended = {
788
+ overrides: overrides2
789
+ };
790
+ var addPrettierRules = () => {
791
+ try {
792
+ cjsRequire3.resolve("prettier");
793
+ const { meta: meta3 } = cjsRequire3("eslint-plugin-prettier");
794
+ const version = meta3?.version || "";
795
+ const [major, minor, patch] = version.split(".");
796
+ if (+major > 5 || +major === 5 && (+minor > 1 || +minor === 1 && Number.parseInt(patch) >= 2)) {
797
+ return;
798
+ }
799
+ overrides2.push({
800
+ files: "*.md",
801
+ rules: {
802
+ "prettier/prettier": [
803
+ "error",
804
+ {
805
+ parser: "markdown"
806
+ }
807
+ ]
808
+ }
809
+ }, {
810
+ files: "*.mdx",
811
+ rules: {
812
+ "prettier/prettier": [
813
+ "error",
814
+ {
815
+ parser: "mdx"
816
+ }
817
+ ]
818
+ }
819
+ });
820
+ } catch {
821
+ }
822
+ };
823
+ addPrettierRules();
824
+
825
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/configs/index.js
826
+ var configs = {
827
+ base,
828
+ "code-blocks": codeBlocks,
829
+ codeBlocks,
830
+ flat,
831
+ flatCodeBlocks,
832
+ overrides,
833
+ recommended
834
+ };
835
+
836
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/meta.js
837
+ var pkg2 = cjsRequire3("../package.json");
838
+ var meta2 = { name: pkg2.name, version: pkg2.version };
839
+
840
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/processors/helpers.js
841
+ var DEFAULT_LANGUAGE_MAPPER = {
842
+ ecmascript: "js",
843
+ javascript: "js",
844
+ javascriptreact: "jsx",
845
+ typescript: "ts",
846
+ typescriptreact: "tsx",
847
+ markdown: "md",
848
+ markdownjsx: "mdx",
849
+ markdownreact: "mdx",
850
+ mdown: "md",
851
+ mkdn: "md"
852
+ };
853
+ function getShortLang(filename, languageMapper) {
854
+ const language = filename.split(".").at(-1);
855
+ if (languageMapper === false) {
856
+ return language;
857
+ }
858
+ languageMapper = languageMapper ? { ...DEFAULT_LANGUAGE_MAPPER, ...languageMapper } : DEFAULT_LANGUAGE_MAPPER;
859
+ const mapped = languageMapper[language];
860
+ if (mapped) {
861
+ return mapped;
862
+ }
863
+ const lang = language.toLowerCase();
864
+ return languageMapper[lang] || lang;
865
+ }
866
+
867
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/from-markdown.js
868
+ var fromMarkdown = createSyncFn(cjsRequire3.resolve("./worker.js"));
869
+
870
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/processors/markdown.js
871
+ var UNSATISFIABLE_RULES = /* @__PURE__ */ new Set([
872
+ "eol-last",
873
+ "unicode-bom"
874
+ ]);
875
+ var SUPPORTS_AUTOFIX = true;
876
+ var BOM = "\uFEFF";
877
+ var blocksCache = /* @__PURE__ */ new Map();
878
+ function traverse(node, callbacks) {
879
+ if (callbacks[node.type]) {
880
+ callbacks[node.type](node);
881
+ } else {
882
+ callbacks["*"]();
883
+ }
884
+ const parent = node;
885
+ if ("children" in parent) {
886
+ for (const child of parent.children) {
887
+ traverse(child, callbacks);
888
+ }
889
+ }
890
+ }
891
+ var COMMENTS = [
892
+ [
893
+ /^<!-{2,}/,
894
+ /-{2,}>$/
895
+ ],
896
+ [
897
+ /^\/\*+/,
898
+ /\*+\/$/
899
+ ]
900
+ ];
901
+ var eslintCommentRegex = /^(?:eslint\b|global\s)/u;
902
+ function getComment(value, isMdx = false) {
903
+ const [commentStart, commentEnd] = COMMENTS[+isMdx];
904
+ const commentStartMatched = commentStart.exec(value);
905
+ const commentEndMatched = commentEnd.exec(value);
906
+ if (commentStartMatched == null || commentEndMatched == null) {
907
+ return "";
908
+ }
909
+ const comment = value.slice(commentStartMatched[0].length, -commentEndMatched[0].length).trim();
910
+ if (!eslintCommentRegex.test(comment)) {
911
+ return "";
912
+ }
913
+ return comment;
914
+ }
915
+ var leadingWhitespaceRegex = /^[>\s]*/u;
916
+ function getBeginningOfLineOffset(node) {
917
+ return node.position.start.offset - node.position.start.column + 1;
918
+ }
919
+ function getIndentText(text, node) {
920
+ return leadingWhitespaceRegex.exec(text.slice(getBeginningOfLineOffset(node)))[0];
921
+ }
922
+ function getBlockRangeMap(text, node, comments) {
923
+ const startOffset = getBeginningOfLineOffset(node);
924
+ const code = text.slice(startOffset, node.position.end.offset);
925
+ const lines = code.split("\n");
926
+ const baseIndent = getIndentText(text, node).length;
927
+ const commentLength = comments.reduce((len, comment) => len + comment.length + 1, 0);
928
+ const rangeMap = [
929
+ {
930
+ indent: baseIndent,
931
+ js: 0,
932
+ md: 0
933
+ }
934
+ ];
935
+ let jsOffset = commentLength;
936
+ let mdOffset = startOffset + lines[0].length + 1;
937
+ for (let i = 0; i + 1 < lines.length; i++) {
938
+ const line = lines[i + 1];
939
+ const leadingWhitespaceLength = leadingWhitespaceRegex.exec(line)[0].length;
940
+ const trimLength = Math.min(baseIndent, leadingWhitespaceLength);
941
+ rangeMap.push({
942
+ indent: trimLength,
943
+ js: jsOffset,
944
+ md: mdOffset + trimLength - jsOffset
945
+ });
946
+ mdOffset += line.length + 1;
947
+ jsOffset += line.length - trimLength + 1;
948
+ }
949
+ return rangeMap;
950
+ }
951
+ var codeBlockFileNameRegex = /filename=(?<quote>["'])(?<filename>.*?)\1/u;
952
+ function fileNameFromMeta(block) {
953
+ return codeBlockFileNameRegex.exec(block.meta)?.groups.filename.replaceAll(/\s+/gu, "_");
954
+ }
955
+ function preprocess(sourceText, filename) {
956
+ const text = sourceText.startsWith(BOM) ? sourceText.slice(1) : sourceText;
957
+ const ast = fromMarkdown(text, filename.endsWith(".mdx"));
958
+ const blocks = [];
959
+ blocksCache.set(filename, blocks);
960
+ let allComments = [];
961
+ function mdxExpression(node) {
962
+ const comment = getComment(node.value, true);
963
+ if (comment) {
964
+ allComments.push(comment);
965
+ } else {
966
+ allComments = [];
967
+ }
968
+ }
969
+ traverse(ast, {
970
+ "*"() {
971
+ allComments = [];
972
+ },
973
+ code(node) {
974
+ if (!node.lang) {
975
+ return;
976
+ }
977
+ const comments = [];
978
+ for (const comment of allComments) {
979
+ if (comment === "eslint-skip") {
980
+ allComments = [];
981
+ return;
982
+ }
983
+ comments.push(`/* ${comment} */`);
984
+ }
985
+ allComments = [];
986
+ blocks.push({
987
+ ...node,
988
+ baseIndentText: getIndentText(text, node),
989
+ comments,
990
+ rangeMap: getBlockRangeMap(text, node, comments)
991
+ });
992
+ },
993
+ html(node) {
994
+ const comment = getComment(node.value);
995
+ if (comment) {
996
+ allComments.push(comment);
997
+ } else {
998
+ allComments = [];
999
+ }
1000
+ },
1001
+ mdxFlowExpression: mdxExpression,
1002
+ mdxTextExpression: mdxExpression
1003
+ });
1004
+ return blocks.map((block, index) => {
1005
+ const [language] = block.lang.trim().split(" ");
1006
+ return {
1007
+ filename: fileNameFromMeta(block) ?? `${index}.${language}`,
1008
+ text: [...block.comments, block.value, ""].join("\n")
1009
+ };
1010
+ });
1011
+ }
1012
+ function adjustFix(block, fix) {
1013
+ return {
1014
+ range: fix.range.map((range) => {
1015
+ let i = 1;
1016
+ while (i < block.rangeMap.length && block.rangeMap[i].js <= range) {
1017
+ i++;
1018
+ }
1019
+ return range + block.rangeMap[i - 1].md;
1020
+ }),
1021
+ text: fix.text.replaceAll("\n", `
1022
+ ${block.baseIndentText}`)
1023
+ };
1024
+ }
1025
+ function adjustBlock(block) {
1026
+ const leadingCommentLines = block.comments.reduce((count, comment) => count + comment.split("\n").length, 0);
1027
+ const blockStart = block.position.start.line;
1028
+ return function adjustMessage(message) {
1029
+ if (!Number.isInteger(message.line)) {
1030
+ return {
1031
+ ...message,
1032
+ line: blockStart,
1033
+ column: block.position.start.column
1034
+ };
1035
+ }
1036
+ const lineInCode = message.line - leadingCommentLines;
1037
+ if (lineInCode < 1 || lineInCode >= block.rangeMap.length) {
1038
+ return null;
1039
+ }
1040
+ const out = {
1041
+ line: lineInCode + blockStart,
1042
+ column: message.column + block.rangeMap[lineInCode].indent
1043
+ };
1044
+ if (Number.isInteger(message.endLine)) {
1045
+ out.endLine = message.endLine - leadingCommentLines + blockStart;
1046
+ }
1047
+ if (Array.isArray(message.suggestions)) {
1048
+ out.suggestions = message.suggestions.map((suggestion) => ({
1049
+ ...suggestion,
1050
+ fix: adjustFix(block, suggestion.fix)
1051
+ }));
1052
+ }
1053
+ const adjustedFix = {};
1054
+ if (message.fix) {
1055
+ adjustedFix.fix = adjustFix(block, message.fix);
1056
+ }
1057
+ return { ...message, ...out, ...adjustedFix };
1058
+ };
1059
+ }
1060
+ function excludeUnsatisfiableRules(message) {
1061
+ return message && !UNSATISFIABLE_RULES.has(message.ruleId);
1062
+ }
1063
+ function postprocess(messages, filename) {
1064
+ const blocks = blocksCache.get(filename);
1065
+ blocksCache.delete(filename);
1066
+ return messages.flatMap((group, i) => {
1067
+ const adjust = adjustBlock(blocks[i]);
1068
+ return group.map(adjust).filter(excludeUnsatisfiableRules);
1069
+ });
1070
+ }
1071
+ var markdownProcessor = {
1072
+ meta: {
1073
+ name: "mdx/markdown",
1074
+ version: meta2.version
1075
+ },
1076
+ preprocess,
1077
+ postprocess,
1078
+ supportsAutofix: SUPPORTS_AUTOFIX
1079
+ };
1080
+
1081
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/processors/options.js
1082
+ var processorOptions = {};
1083
+ var linterPath = Object.keys(cjsRequire3.cache).find((path7) => /([/\\])eslint\1lib(?:\1linter){2}\.js$/.test(path7));
1084
+ if (!linterPath) {
1085
+ throw new Error("Could not find ESLint Linter in require cache");
1086
+ }
1087
+ var ESLinter = cjsRequire3(linterPath).Linter;
1088
+ var { verify } = ESLinter.prototype;
1089
+ ESLinter.prototype.verify = function(code, config, options) {
1090
+ const settings = (config.extractConfig?.(typeof options === "undefined" || typeof options === "string" ? options : options.filename) ?? config).settings ?? {};
1091
+ processorOptions.lintCodeBlocks = settings["mdx/code-blocks"] === true;
1092
+ processorOptions.languageMapper = settings["mdx/language-mapper"];
1093
+ return verify.call(this, code, config, options);
1094
+ };
1095
+
1096
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/processors/remark.js
1097
+ var createRemarkProcessor = (processorOptions2 = processorOptions) => ({
1098
+ meta: {
1099
+ name: "mdx/remark",
1100
+ version: meta2.version
1101
+ },
1102
+ supportsAutofix: true,
1103
+ preprocess(text, filename) {
1104
+ if (!processorOptions2.lintCodeBlocks) {
1105
+ return [text];
1106
+ }
1107
+ return [
1108
+ text,
1109
+ ...markdownProcessor.preprocess(text, filename).map(({ text: text2, filename: filename2 }) => ({
1110
+ text: text2,
1111
+ filename: filename2.slice(0, filename2.lastIndexOf(".")) + "." + getShortLang(filename2, processorOptions2.languageMapper)
1112
+ }))
1113
+ ];
1114
+ },
1115
+ postprocess([mdxMessages, ...markdownMessages], filename) {
1116
+ return [
1117
+ ...mdxMessages,
1118
+ ...markdownProcessor.postprocess(markdownMessages, filename)
1119
+ ].sort((a, b) => a.line - b.line || a.column - b.column).map((lintMessage) => {
1120
+ const { message, ruleId: eslintRuleId, severity: eslintSeverity } = lintMessage;
1121
+ if (eslintRuleId !== "mdx/remark") {
1122
+ return lintMessage;
1123
+ }
1124
+ const { source, ruleId, reason, severity } = JSON.parse(message);
1125
+ return {
1126
+ ...lintMessage,
1127
+ ruleId: `${source}-${ruleId}`,
1128
+ message: reason,
1129
+ severity: Math.max(eslintSeverity, severity)
1130
+ };
1131
+ });
1132
+ }
1133
+ });
1134
+ var remark = createRemarkProcessor();
1135
+
1136
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/processors/index.js
1137
+ var processors = { remark };
1138
+
1139
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/rules/remark.js
1140
+ import path6 from "node:path";
1141
+ var remark2 = {
1142
+ meta: {
1143
+ type: "layout",
1144
+ docs: {
1145
+ description: "Linter integration with remark plugins",
1146
+ category: "Stylistic Issues",
1147
+ recommended: true
1148
+ },
1149
+ fixable: "code"
1150
+ },
1151
+ create(context) {
1152
+ const filename = context.getFilename();
1153
+ const extname = path6.extname(filename);
1154
+ const sourceCode = context.getSourceCode();
1155
+ const options = context.parserOptions;
1156
+ const isMdx = [
1157
+ ...DEFAULT_EXTENSIONS,
1158
+ ...options.extensions || []
1159
+ ].includes(extname);
1160
+ const isMarkdown = [
1161
+ ...MARKDOWN_EXTENSIONS,
1162
+ ...options.markdownExtensions || []
1163
+ ].includes(extname);
1164
+ return {
1165
+ Program(node) {
1166
+ if (!isMdx && !isMarkdown) {
1167
+ return;
1168
+ }
1169
+ const ignoreRemarkConfig = Boolean(options.ignoreRemarkConfig);
1170
+ const sourceText = sourceCode.getText(node);
1171
+ const { messages, content: fixedText } = performSyncWork({
1172
+ filePath: getPhysicalFilename(filename),
1173
+ code: sourceText,
1174
+ cwd: context.getCwd(),
1175
+ isMdx,
1176
+ process: true,
1177
+ ignoreRemarkConfig
1178
+ });
1179
+ let fixed = 0;
1180
+ for (const { source, reason, ruleId, fatal, line, column, place } of messages) {
1181
+ const severity = fatal ? 2 : fatal == null ? 0 : 1;
1182
+ if (!severity) {
1183
+ continue;
1184
+ }
1185
+ const message = {
1186
+ reason,
1187
+ source,
1188
+ ruleId,
1189
+ severity
1190
+ };
1191
+ const point = {
1192
+ line,
1193
+ column: column - 1
1194
+ };
1195
+ context.report({
1196
+ message: JSON.stringify(message),
1197
+ loc: place && "start" in place ? {
1198
+ ...point,
1199
+ start: { ...place.start, column: place.start.column - 1 },
1200
+ end: { ...place.end, column: place.end.column - 1 }
1201
+ } : point,
1202
+ node,
1203
+ fix: fixedText == null || fixedText === sourceText ? null : () => fixed++ ? null : {
1204
+ range: [0, sourceText.length],
1205
+ text: fixedText
1206
+ }
1207
+ });
1208
+ }
1209
+ }
1210
+ };
1211
+ }
1212
+ };
1213
+
1214
+ // ../../node_modules/.pnpm/eslint-plugin-mdx@3.4.0_eslint@9.24.0_jiti@2.4.2_/node_modules/eslint-plugin-mdx/lib/rules/index.js
1215
+ var rules = { remark: remark2 };
1216
+ export {
1217
+ DEFAULT_LANGUAGE_MAPPER,
1218
+ base,
1219
+ cjsRequire3 as cjsRequire,
1220
+ codeBlocks,
1221
+ configs,
1222
+ createRemarkProcessor,
1223
+ flat,
1224
+ flatCodeBlocks,
1225
+ getGlobals,
1226
+ getShortLang,
1227
+ meta2 as meta,
1228
+ overrides,
1229
+ processorOptions,
1230
+ processors,
1231
+ recommended,
1232
+ remark2 as remark,
1233
+ rules
1234
+ };