@icebreakers/eslint-config 1.3.0 → 1.3.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.cjs +17 -1506
- package/dist/index.js +19 -7
- package/package.json +3 -3
- package/dist/chunk-CPDUQV7O.js +0 -37
- package/dist/lib-DBWFCR2Y.js +0 -1242
package/dist/index.cjs
CHANGED
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __esm = (fn, res) => function __init() {
|
|
9
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
-
};
|
|
11
8
|
var __export = (target, all) => {
|
|
12
9
|
for (var name in all)
|
|
13
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -31,1481 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
28
|
));
|
|
32
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
30
|
|
|
34
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.5.0_postcss@8.5.6_tsx@4.20.3_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/cjs_shims.js
|
|
35
|
-
var getImportMetaUrl, importMetaUrl;
|
|
36
|
-
var init_cjs_shims = __esm({
|
|
37
|
-
"../../node_modules/.pnpm/tsup@8.5.0_jiti@2.5.0_postcss@8.5.6_tsx@4.20.3_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/cjs_shims.js"() {
|
|
38
|
-
"use strict";
|
|
39
|
-
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
40
|
-
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/base.js
|
|
45
|
-
var base;
|
|
46
|
-
var init_base = __esm({
|
|
47
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/base.js"() {
|
|
48
|
-
"use strict";
|
|
49
|
-
init_cjs_shims();
|
|
50
|
-
base = {
|
|
51
|
-
parser: "eslint-mdx",
|
|
52
|
-
parserOptions: {
|
|
53
|
-
sourceType: "module",
|
|
54
|
-
ecmaVersion: "latest"
|
|
55
|
-
},
|
|
56
|
-
plugins: ["mdx"],
|
|
57
|
-
processor: "mdx/remark",
|
|
58
|
-
rules: {
|
|
59
|
-
"mdx/remark": "warn",
|
|
60
|
-
"no-unused-expressions": "error"
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/code-blocks.js
|
|
67
|
-
var codeBlocks;
|
|
68
|
-
var init_code_blocks = __esm({
|
|
69
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/code-blocks.js"() {
|
|
70
|
-
"use strict";
|
|
71
|
-
init_cjs_shims();
|
|
72
|
-
codeBlocks = {
|
|
73
|
-
parserOptions: {
|
|
74
|
-
ecmaFeatures: {
|
|
75
|
-
impliedStrict: true
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
rules: {
|
|
79
|
-
"eol-last": "off",
|
|
80
|
-
"no-undef": "off",
|
|
81
|
-
"no-unused-expressions": "off",
|
|
82
|
-
"no-unused-vars": "off",
|
|
83
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
84
|
-
"padded-blocks": "off",
|
|
85
|
-
strict: "off",
|
|
86
|
-
"unicode-bom": "off"
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
// ../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/helpers.js
|
|
93
|
-
var import_node_fs, import_node_module, import_node_path, arrayify, getPhysicalFilename, getPositionAtFactory, normalizePosition, prevCharOffsetFactory, nextCharOffsetFactory, importMetaUrl2, cjsRequire;
|
|
94
|
-
var init_helpers = __esm({
|
|
95
|
-
"../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/helpers.js"() {
|
|
96
|
-
"use strict";
|
|
97
|
-
init_cjs_shims();
|
|
98
|
-
import_node_fs = __toESM(require("fs"), 1);
|
|
99
|
-
import_node_module = require("module");
|
|
100
|
-
import_node_path = __toESM(require("path"), 1);
|
|
101
|
-
arrayify = (...args) => args.reduce((arr, curr) => {
|
|
102
|
-
arr.push(...Array.isArray(curr) ? curr : curr == null ? [] : [curr]);
|
|
103
|
-
return arr;
|
|
104
|
-
}, []);
|
|
105
|
-
getPhysicalFilename = (filename, child) => {
|
|
106
|
-
try {
|
|
107
|
-
if (import_node_fs.default.statSync(filename).isDirectory()) {
|
|
108
|
-
return child || filename;
|
|
109
|
-
}
|
|
110
|
-
} catch (err) {
|
|
111
|
-
const { code } = err;
|
|
112
|
-
if (code === "ENOTDIR" || code === "ENOENT") {
|
|
113
|
-
return getPhysicalFilename(import_node_path.default.dirname(filename), filename);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return filename;
|
|
117
|
-
};
|
|
118
|
-
getPositionAtFactory = (code) => {
|
|
119
|
-
const lines = code.split("\n");
|
|
120
|
-
return (offset) => {
|
|
121
|
-
let currOffset = 0;
|
|
122
|
-
for (const [index, line_] of lines.entries()) {
|
|
123
|
-
const line = index + 1;
|
|
124
|
-
const nextOffset = currOffset + line_.length;
|
|
125
|
-
if (nextOffset >= offset) {
|
|
126
|
-
return {
|
|
127
|
-
line,
|
|
128
|
-
column: offset - currOffset
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
currOffset = nextOffset + 1;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
normalizePosition = ({ start, end, code }) => {
|
|
136
|
-
const startOffset = start.offset;
|
|
137
|
-
const endOffset = end.offset;
|
|
138
|
-
const range = [startOffset, endOffset];
|
|
139
|
-
const getPositionAt = code == null ? null : getPositionAtFactory(code);
|
|
140
|
-
return {
|
|
141
|
-
start: startOffset,
|
|
142
|
-
end: endOffset,
|
|
143
|
-
loc: {
|
|
144
|
-
start: "line" in start ? start : getPositionAt(startOffset),
|
|
145
|
-
end: "line" in end ? end : getPositionAt(endOffset)
|
|
146
|
-
},
|
|
147
|
-
range
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
prevCharOffsetFactory = (code) => (offset) => {
|
|
151
|
-
for (let i = offset; i >= 0; i--) {
|
|
152
|
-
const char = code[i];
|
|
153
|
-
if (/^\S$/.test(char)) {
|
|
154
|
-
return i;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
nextCharOffsetFactory = (text) => {
|
|
159
|
-
const total = text.length;
|
|
160
|
-
return (offset) => {
|
|
161
|
-
for (let i = offset; i <= total; i++) {
|
|
162
|
-
const char = text[i];
|
|
163
|
-
if (/^\S$/.test(char)) {
|
|
164
|
-
return i;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
importMetaUrl2 = importMetaUrl2;
|
|
170
|
-
cjsRequire = importMetaUrl2 ? (0, import_node_module.createRequire)(importMetaUrl2) : require;
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
// ../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/meta.js
|
|
175
|
-
var pkg, meta;
|
|
176
|
-
var init_meta = __esm({
|
|
177
|
-
"../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/meta.js"() {
|
|
178
|
-
"use strict";
|
|
179
|
-
init_cjs_shims();
|
|
180
|
-
init_helpers();
|
|
181
|
-
pkg = cjsRequire("../package.json");
|
|
182
|
-
meta = { name: pkg.name, version: pkg.version };
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
// ../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/common.js
|
|
187
|
-
var NODE_OPTIONS, hasFlag, parseVersion, compareVersion, NODE_VERSION, compareNodeVersion;
|
|
188
|
-
var init_common = __esm({
|
|
189
|
-
"../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/common.js"() {
|
|
190
|
-
"use strict";
|
|
191
|
-
init_cjs_shims();
|
|
192
|
-
NODE_OPTIONS = process.env.NODE_OPTIONS?.split(/\s+/);
|
|
193
|
-
hasFlag = (flag) => NODE_OPTIONS?.includes(flag) || process.argv.includes(flag);
|
|
194
|
-
parseVersion = (version) => version.split(".").map(Number.parseFloat);
|
|
195
|
-
compareVersion = (version1, version2) => {
|
|
196
|
-
const versions1 = parseVersion(version1);
|
|
197
|
-
const versions2 = parseVersion(version2);
|
|
198
|
-
const length = Math.max(versions1.length, versions2.length);
|
|
199
|
-
for (let i = 0; i < length; i++) {
|
|
200
|
-
const v1 = versions1[i] || 0;
|
|
201
|
-
const v2 = versions2[i] || 0;
|
|
202
|
-
if (v1 > v2) {
|
|
203
|
-
return 1;
|
|
204
|
-
}
|
|
205
|
-
if (v1 < v2) {
|
|
206
|
-
return -1;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
return 0;
|
|
210
|
-
};
|
|
211
|
-
NODE_VERSION = process.versions.node;
|
|
212
|
-
compareNodeVersion = (version) => compareVersion(NODE_VERSION, version);
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
// ../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/constants.js
|
|
217
|
-
var TsRunner, NODE_OPTIONS_, SYNCKIT_EXEC_ARGV, SYNCKIT_GLOBAL_SHIMS, SYNCKIT_TIMEOUT, SYNCKIT_TS_RUNNER, TS_ESM_PARTIAL_SUPPORTED, MTS_SUPPORTED, MODULE_REGISTER_SUPPORTED, STRIP_TYPES_NODE_VERSION, TRANSFORM_TYPES_NODE_VERSION, FEATURE_TYPESCRIPT_NODE_VERSION, DEFAULT_TYPES_NODE_VERSION, STRIP_TYPES_FLAG, TRANSFORM_TYPES_FLAG, NO_STRIP_TYPES_FLAG, NODE_OPTIONS2, NO_STRIP_TYPES, DEFAULT_TIMEOUT, DEFAULT_EXEC_ARGV, DEFAULT_TS_RUNNER, DEFAULT_GLOBAL_SHIMS, DEFAULT_GLOBAL_SHIMS_PRESET, IMPORT_FLAG, REQUIRE_FLAG, REQUIRE_ABBR_FLAG, REQUIRE_FLAGS, LOADER_FLAG, EXPERIMENTAL_LOADER_FLAG, LOADER_FLAGS, IMPORT_FLAG_SUPPORTED, INT32_BYTES;
|
|
218
|
-
var init_constants = __esm({
|
|
219
|
-
"../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/constants.js"() {
|
|
220
|
-
"use strict";
|
|
221
|
-
init_cjs_shims();
|
|
222
|
-
init_common();
|
|
223
|
-
TsRunner = {
|
|
224
|
-
Node: "node",
|
|
225
|
-
Bun: "bun",
|
|
226
|
-
TsNode: "ts-node",
|
|
227
|
-
EsbuildRegister: "esbuild-register",
|
|
228
|
-
EsbuildRunner: "esbuild-runner",
|
|
229
|
-
OXC: "oxc",
|
|
230
|
-
SWC: "swc",
|
|
231
|
-
TSX: "tsx"
|
|
232
|
-
};
|
|
233
|
-
({ NODE_OPTIONS: NODE_OPTIONS_ = "", SYNCKIT_EXEC_ARGV = "", SYNCKIT_GLOBAL_SHIMS, SYNCKIT_TIMEOUT, SYNCKIT_TS_RUNNER } = process.env);
|
|
234
|
-
TS_ESM_PARTIAL_SUPPORTED = compareNodeVersion("16") >= 0 && compareNodeVersion("18.19") < 0;
|
|
235
|
-
MTS_SUPPORTED = compareNodeVersion("20.8") >= 0;
|
|
236
|
-
MODULE_REGISTER_SUPPORTED = MTS_SUPPORTED || compareNodeVersion("18.19") >= 0;
|
|
237
|
-
STRIP_TYPES_NODE_VERSION = "22.6";
|
|
238
|
-
TRANSFORM_TYPES_NODE_VERSION = "22.7";
|
|
239
|
-
FEATURE_TYPESCRIPT_NODE_VERSION = "22.10";
|
|
240
|
-
DEFAULT_TYPES_NODE_VERSION = "23.6";
|
|
241
|
-
STRIP_TYPES_FLAG = "--experimental-strip-types";
|
|
242
|
-
TRANSFORM_TYPES_FLAG = "--experimental-transform-types";
|
|
243
|
-
NO_STRIP_TYPES_FLAG = "--no-experimental-strip-types";
|
|
244
|
-
NODE_OPTIONS2 = NODE_OPTIONS_.split(/\s+/);
|
|
245
|
-
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));
|
|
246
|
-
DEFAULT_TIMEOUT = SYNCKIT_TIMEOUT ? +SYNCKIT_TIMEOUT : void 0;
|
|
247
|
-
DEFAULT_EXEC_ARGV = SYNCKIT_EXEC_ARGV.split(",");
|
|
248
|
-
DEFAULT_TS_RUNNER = SYNCKIT_TS_RUNNER;
|
|
249
|
-
DEFAULT_GLOBAL_SHIMS = ["1", "true"].includes(SYNCKIT_GLOBAL_SHIMS);
|
|
250
|
-
DEFAULT_GLOBAL_SHIMS_PRESET = [
|
|
251
|
-
{
|
|
252
|
-
moduleName: "node-fetch",
|
|
253
|
-
globalName: "fetch"
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
moduleName: "node:perf_hooks",
|
|
257
|
-
globalName: "performance",
|
|
258
|
-
named: "performance"
|
|
259
|
-
}
|
|
260
|
-
];
|
|
261
|
-
IMPORT_FLAG = "--import";
|
|
262
|
-
REQUIRE_FLAG = "--require";
|
|
263
|
-
REQUIRE_ABBR_FLAG = "-r";
|
|
264
|
-
REQUIRE_FLAGS = /* @__PURE__ */ new Set([REQUIRE_FLAG, REQUIRE_ABBR_FLAG]);
|
|
265
|
-
LOADER_FLAG = "--loader";
|
|
266
|
-
EXPERIMENTAL_LOADER_FLAG = "--experimental-loader";
|
|
267
|
-
LOADER_FLAGS = /* @__PURE__ */ new Set([LOADER_FLAG, EXPERIMENTAL_LOADER_FLAG]);
|
|
268
|
-
IMPORT_FLAG_SUPPORTED = compareNodeVersion("20.6") >= 0;
|
|
269
|
-
INT32_BYTES = 4;
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
// ../../node_modules/.pnpm/@pkgr+core@0.2.7/node_modules/@pkgr/core/lib/constants.js
|
|
274
|
-
var import_node_module2, CWD, importMetaUrl3, cjsRequire2, EXTENSIONS;
|
|
275
|
-
var init_constants2 = __esm({
|
|
276
|
-
"../../node_modules/.pnpm/@pkgr+core@0.2.7/node_modules/@pkgr/core/lib/constants.js"() {
|
|
277
|
-
"use strict";
|
|
278
|
-
init_cjs_shims();
|
|
279
|
-
import_node_module2 = require("module");
|
|
280
|
-
CWD = process.cwd();
|
|
281
|
-
importMetaUrl3 = importMetaUrl3;
|
|
282
|
-
cjsRequire2 = importMetaUrl3 ? (0, import_node_module2.createRequire)(importMetaUrl3) : require;
|
|
283
|
-
EXTENSIONS = [".ts", ".tsx", ...Object.keys(cjsRequire2.extensions)];
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
// ../../node_modules/.pnpm/@pkgr+core@0.2.7/node_modules/@pkgr/core/lib/helpers.js
|
|
288
|
-
var import_node_fs2, import_node_path2, tryPkg, isPkgAvailable, tryFile, tryExtensions, findUp;
|
|
289
|
-
var init_helpers2 = __esm({
|
|
290
|
-
"../../node_modules/.pnpm/@pkgr+core@0.2.7/node_modules/@pkgr/core/lib/helpers.js"() {
|
|
291
|
-
"use strict";
|
|
292
|
-
init_cjs_shims();
|
|
293
|
-
import_node_fs2 = __toESM(require("fs"), 1);
|
|
294
|
-
import_node_path2 = __toESM(require("path"), 1);
|
|
295
|
-
init_constants2();
|
|
296
|
-
tryPkg = (pkg3) => {
|
|
297
|
-
try {
|
|
298
|
-
return cjsRequire2.resolve(pkg3);
|
|
299
|
-
} catch {
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
isPkgAvailable = (pkg3) => !!tryPkg(pkg3);
|
|
303
|
-
tryFile = (filename, includeDir = false, base2 = CWD) => {
|
|
304
|
-
if (typeof filename === "string") {
|
|
305
|
-
const filepath = import_node_path2.default.resolve(base2, filename);
|
|
306
|
-
return import_node_fs2.default.existsSync(filepath) && (includeDir || import_node_fs2.default.statSync(filepath).isFile()) ? filepath : "";
|
|
307
|
-
}
|
|
308
|
-
for (const file of filename ?? []) {
|
|
309
|
-
const filepath = tryFile(file, includeDir, base2);
|
|
310
|
-
if (filepath) {
|
|
311
|
-
return filepath;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return "";
|
|
315
|
-
};
|
|
316
|
-
tryExtensions = (filepath, extensions = EXTENSIONS) => {
|
|
317
|
-
const ext = [...extensions, ""].find((ext2) => tryFile(filepath + ext2));
|
|
318
|
-
return ext == null ? "" : filepath + ext;
|
|
319
|
-
};
|
|
320
|
-
findUp = (searchEntry, searchFileOrIncludeDir, includeDir) => {
|
|
321
|
-
const isSearchFile = typeof searchFileOrIncludeDir === "string";
|
|
322
|
-
const searchFile = isSearchFile ? searchFileOrIncludeDir : "package.json";
|
|
323
|
-
let lastSearchEntry;
|
|
324
|
-
do {
|
|
325
|
-
const searched = tryFile(searchFile, isSearchFile && includeDir, searchEntry);
|
|
326
|
-
if (searched) {
|
|
327
|
-
return searched;
|
|
328
|
-
}
|
|
329
|
-
lastSearchEntry = searchEntry;
|
|
330
|
-
searchEntry = import_node_path2.default.dirname(searchEntry);
|
|
331
|
-
} while (!lastSearchEntry || lastSearchEntry !== searchEntry);
|
|
332
|
-
return "";
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
// ../../node_modules/.pnpm/@pkgr+core@0.2.7/node_modules/@pkgr/core/lib/index.js
|
|
338
|
-
var init_lib = __esm({
|
|
339
|
-
"../../node_modules/.pnpm/@pkgr+core@0.2.7/node_modules/@pkgr/core/lib/index.js"() {
|
|
340
|
-
"use strict";
|
|
341
|
-
init_cjs_shims();
|
|
342
|
-
init_constants2();
|
|
343
|
-
init_helpers2();
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
// ../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/helpers.js
|
|
348
|
-
function startWorkerThread(workerPath, { timeout = DEFAULT_TIMEOUT, execArgv = DEFAULT_EXEC_ARGV, tsRunner = DEFAULT_TS_RUNNER, transferList = [], globalShims = DEFAULT_GLOBAL_SHIMS } = {}) {
|
|
349
|
-
const { port1: mainPort, port2: workerPort } = new import_node_worker_threads.MessageChannel();
|
|
350
|
-
const { isTs, ext, jsUseEsm, tsUseEsm, tsRunner: finalTsRunner, workerPath: finalWorkerPath, pnpLoaderPath, execArgv: finalExecArgv } = setupTsRunner(workerPath, { execArgv, tsRunner });
|
|
351
|
-
const workerPathUrl = (0, import_node_url.pathToFileURL)(finalWorkerPath);
|
|
352
|
-
if (/\.[cm]ts$/.test(finalWorkerPath)) {
|
|
353
|
-
const isTsxSupported = !tsUseEsm || TS_ESM_PARTIAL_SUPPORTED;
|
|
354
|
-
if (!finalTsRunner) {
|
|
355
|
-
throw new Error("No ts runner specified, ts worker path is not supported");
|
|
356
|
-
} else if ([
|
|
357
|
-
TsRunner.EsbuildRegister,
|
|
358
|
-
TsRunner.EsbuildRunner,
|
|
359
|
-
...TS_ESM_PARTIAL_SUPPORTED ? [
|
|
360
|
-
TsRunner.OXC,
|
|
361
|
-
TsRunner.SWC
|
|
362
|
-
] : [],
|
|
363
|
-
...isTsxSupported ? [] : [TsRunner.TSX]
|
|
364
|
-
].includes(finalTsRunner)) {
|
|
365
|
-
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" : ""));
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
const finalGlobalShims = (globalShims === true ? DEFAULT_GLOBAL_SHIMS_PRESET : Array.isArray(globalShims) ? globalShims : []).filter(({ moduleName }) => isPkgAvailable(moduleName));
|
|
369
|
-
sharedBufferView ?? (sharedBufferView = new Int32Array(sharedBuffer ?? (sharedBuffer = new SharedArrayBuffer(INT32_BYTES)), 0, 1));
|
|
370
|
-
const useGlobals = finalGlobalShims.length > 0;
|
|
371
|
-
const useEval = isTs ? !tsUseEsm : !jsUseEsm && useGlobals;
|
|
372
|
-
const worker = new import_node_worker_threads.Worker(jsUseEsm && useGlobals || tsUseEsm && finalTsRunner === TsRunner.TsNode ? dataUrl(`${generateGlobals(finalWorkerPath, finalGlobalShims)};import '${String(workerPathUrl)}'`) : useEval ? `${generateGlobals(finalWorkerPath, finalGlobalShims, "require")};${encodeImportModule(finalWorkerPath, "require")}` : workerPathUrl, {
|
|
373
|
-
eval: useEval,
|
|
374
|
-
workerData: { sharedBufferView, workerPort, pnpLoaderPath },
|
|
375
|
-
transferList: [workerPort, ...transferList],
|
|
376
|
-
execArgv: finalExecArgv
|
|
377
|
-
});
|
|
378
|
-
let nextID = 0;
|
|
379
|
-
const receiveMessageWithId = (port, expectedId, waitingTimeout) => {
|
|
380
|
-
const start = Date.now();
|
|
381
|
-
const status = Atomics.wait(sharedBufferView, 0, 0, waitingTimeout);
|
|
382
|
-
Atomics.store(sharedBufferView, 0, 0);
|
|
383
|
-
if (!["ok", "not-equal"].includes(status)) {
|
|
384
|
-
const abortMsg = {
|
|
385
|
-
id: expectedId,
|
|
386
|
-
cmd: "abort"
|
|
387
|
-
};
|
|
388
|
-
port.postMessage(abortMsg);
|
|
389
|
-
throw new Error("Internal error: Atomics.wait() failed: " + status);
|
|
390
|
-
}
|
|
391
|
-
const result = (0, import_node_worker_threads.receiveMessageOnPort)(mainPort);
|
|
392
|
-
const msg = result?.message;
|
|
393
|
-
if (msg?.id == null || msg.id < expectedId) {
|
|
394
|
-
const waitingTime = Date.now() - start;
|
|
395
|
-
return receiveMessageWithId(port, expectedId, waitingTimeout ? waitingTimeout - waitingTime : void 0);
|
|
396
|
-
}
|
|
397
|
-
const { id, ...message } = msg;
|
|
398
|
-
if (expectedId !== id) {
|
|
399
|
-
throw new Error(`Internal error: Expected id ${expectedId} but got id ${id}`);
|
|
400
|
-
}
|
|
401
|
-
return { id, ...message };
|
|
402
|
-
};
|
|
403
|
-
const syncFn = (...args) => {
|
|
404
|
-
const id = nextID++;
|
|
405
|
-
const msg = { id, args };
|
|
406
|
-
worker.postMessage(msg);
|
|
407
|
-
const { result, error, properties, stdio } = receiveMessageWithId(mainPort, id, timeout);
|
|
408
|
-
for (const { type, chunk, encoding } of stdio) {
|
|
409
|
-
process[type].write(chunk, encoding);
|
|
410
|
-
}
|
|
411
|
-
if (error) {
|
|
412
|
-
throw Object.assign(error, properties);
|
|
413
|
-
}
|
|
414
|
-
return result;
|
|
415
|
-
};
|
|
416
|
-
worker.unref();
|
|
417
|
-
return syncFn;
|
|
418
|
-
}
|
|
419
|
-
var import_node_crypto, import_node_fs3, import_node_path3, import_node_url, import_node_worker_threads, isFile, dataUrl, hasRequireFlag, hasImportFlag, hasLoaderFlag, setupTsRunner, md5Hash, encodeImportModule, _generateGlobals, globalsCache, tmpdir, _dirname, generateGlobals, sharedBuffer, sharedBufferView;
|
|
420
|
-
var init_helpers3 = __esm({
|
|
421
|
-
"../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/helpers.js"() {
|
|
422
|
-
"use strict";
|
|
423
|
-
init_cjs_shims();
|
|
424
|
-
import_node_crypto = require("crypto");
|
|
425
|
-
import_node_fs3 = __toESM(require("fs"), 1);
|
|
426
|
-
import_node_path3 = __toESM(require("path"), 1);
|
|
427
|
-
import_node_url = require("url");
|
|
428
|
-
import_node_worker_threads = require("worker_threads");
|
|
429
|
-
init_lib();
|
|
430
|
-
init_common();
|
|
431
|
-
init_constants();
|
|
432
|
-
isFile = (path8) => {
|
|
433
|
-
try {
|
|
434
|
-
return !!import_node_fs3.default.statSync(path8, { throwIfNoEntry: false })?.isFile();
|
|
435
|
-
} catch {
|
|
436
|
-
return false;
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
dataUrl = (code) => new URL(`data:text/javascript,${encodeURIComponent(code)}`);
|
|
440
|
-
hasRequireFlag = (execArgv) => execArgv.some((execArg) => REQUIRE_FLAGS.has(execArg));
|
|
441
|
-
hasImportFlag = (execArgv) => execArgv.includes(IMPORT_FLAG);
|
|
442
|
-
hasLoaderFlag = (execArgv) => execArgv.some((execArg) => LOADER_FLAGS.has(execArg));
|
|
443
|
-
setupTsRunner = (workerPath, { execArgv = DEFAULT_EXEC_ARGV, tsRunner } = {}) => {
|
|
444
|
-
let ext = import_node_path3.default.extname(workerPath);
|
|
445
|
-
if (!/([/\\])node_modules\1/.test(workerPath) && (!ext || /^\.[cm]?js$/.test(ext))) {
|
|
446
|
-
const workPathWithoutExt = ext ? workerPath.slice(0, -ext.length) : workerPath;
|
|
447
|
-
let extensions;
|
|
448
|
-
switch (ext) {
|
|
449
|
-
case ".cjs": {
|
|
450
|
-
extensions = [".cts", ".cjs"];
|
|
451
|
-
break;
|
|
452
|
-
}
|
|
453
|
-
case ".mjs": {
|
|
454
|
-
extensions = [".mts", ".mjs"];
|
|
455
|
-
break;
|
|
456
|
-
}
|
|
457
|
-
default: {
|
|
458
|
-
extensions = [".ts", ".js"];
|
|
459
|
-
break;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
const found = tryExtensions(workPathWithoutExt, extensions);
|
|
463
|
-
let differentExt;
|
|
464
|
-
if (found && (!ext || (differentExt = found !== workPathWithoutExt))) {
|
|
465
|
-
workerPath = found;
|
|
466
|
-
if (differentExt) {
|
|
467
|
-
ext = import_node_path3.default.extname(workerPath);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
const isTs = /\.[cm]?ts$/.test(workerPath);
|
|
472
|
-
let jsUseEsm = ext === ".mjs";
|
|
473
|
-
let tsUseEsm = ext === ".mts";
|
|
474
|
-
if (isTs) {
|
|
475
|
-
if (!tsUseEsm && ext !== ".cts") {
|
|
476
|
-
const pkg3 = findUp(workerPath);
|
|
477
|
-
if (pkg3) {
|
|
478
|
-
tsUseEsm = cjsRequire2(pkg3).type === "module";
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
const stripTypesIndex = execArgv.indexOf(STRIP_TYPES_FLAG);
|
|
482
|
-
const transformTypesIndex = execArgv.indexOf(TRANSFORM_TYPES_FLAG);
|
|
483
|
-
const noStripTypesIndex = execArgv.indexOf(NO_STRIP_TYPES_FLAG);
|
|
484
|
-
const execArgvNoStripTypes = noStripTypesIndex > stripTypesIndex || noStripTypesIndex > transformTypesIndex;
|
|
485
|
-
const noStripTypes = execArgvNoStripTypes || stripTypesIndex === -1 && transformTypesIndex === -1 && NO_STRIP_TYPES;
|
|
486
|
-
if (tsRunner == null) {
|
|
487
|
-
if (process.versions.bun) {
|
|
488
|
-
tsRunner = TsRunner.Bun;
|
|
489
|
-
} else if (!noStripTypes && compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0) {
|
|
490
|
-
tsRunner = TsRunner.Node;
|
|
491
|
-
} else if (isPkgAvailable(TsRunner.TsNode)) {
|
|
492
|
-
tsRunner = TsRunner.TsNode;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
switch (tsRunner) {
|
|
496
|
-
case TsRunner.Bun: {
|
|
497
|
-
break;
|
|
498
|
-
}
|
|
499
|
-
case TsRunner.Node: {
|
|
500
|
-
if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) < 0) {
|
|
501
|
-
throw new Error("type stripping is not supported in this node version");
|
|
502
|
-
}
|
|
503
|
-
if (noStripTypes) {
|
|
504
|
-
throw new Error("type stripping is disabled explicitly");
|
|
505
|
-
}
|
|
506
|
-
if (compareNodeVersion(DEFAULT_TYPES_NODE_VERSION) >= 0) {
|
|
507
|
-
break;
|
|
508
|
-
}
|
|
509
|
-
if (compareNodeVersion(TRANSFORM_TYPES_NODE_VERSION) >= 0 && !execArgv.includes(TRANSFORM_TYPES_FLAG)) {
|
|
510
|
-
execArgv = [TRANSFORM_TYPES_FLAG, ...execArgv];
|
|
511
|
-
} else if (compareNodeVersion(STRIP_TYPES_NODE_VERSION) >= 0 && !execArgv.includes(STRIP_TYPES_FLAG)) {
|
|
512
|
-
execArgv = [STRIP_TYPES_FLAG, ...execArgv];
|
|
513
|
-
}
|
|
514
|
-
break;
|
|
515
|
-
}
|
|
516
|
-
case TsRunner.TsNode: {
|
|
517
|
-
if (tsUseEsm) {
|
|
518
|
-
if (!execArgv.includes(LOADER_FLAG)) {
|
|
519
|
-
execArgv = [LOADER_FLAG, `${TsRunner.TsNode}/esm`, ...execArgv];
|
|
520
|
-
}
|
|
521
|
-
} else if (!hasRequireFlag(execArgv)) {
|
|
522
|
-
execArgv = [
|
|
523
|
-
REQUIRE_ABBR_FLAG,
|
|
524
|
-
`${TsRunner.TsNode}/register`,
|
|
525
|
-
...execArgv
|
|
526
|
-
];
|
|
527
|
-
}
|
|
528
|
-
break;
|
|
529
|
-
}
|
|
530
|
-
case TsRunner.EsbuildRegister: {
|
|
531
|
-
if (tsUseEsm) {
|
|
532
|
-
if (!hasLoaderFlag(execArgv)) {
|
|
533
|
-
execArgv = [
|
|
534
|
-
LOADER_FLAG,
|
|
535
|
-
`${TsRunner.EsbuildRegister}/loader`,
|
|
536
|
-
...execArgv
|
|
537
|
-
];
|
|
538
|
-
}
|
|
539
|
-
} else if (!hasRequireFlag(execArgv)) {
|
|
540
|
-
execArgv = [REQUIRE_ABBR_FLAG, TsRunner.EsbuildRegister, ...execArgv];
|
|
541
|
-
}
|
|
542
|
-
break;
|
|
543
|
-
}
|
|
544
|
-
case TsRunner.EsbuildRunner: {
|
|
545
|
-
if (!hasRequireFlag(execArgv)) {
|
|
546
|
-
execArgv = [
|
|
547
|
-
REQUIRE_ABBR_FLAG,
|
|
548
|
-
`${TsRunner.EsbuildRunner}/register`,
|
|
549
|
-
...execArgv
|
|
550
|
-
];
|
|
551
|
-
}
|
|
552
|
-
break;
|
|
553
|
-
}
|
|
554
|
-
case TsRunner.OXC: {
|
|
555
|
-
if (!execArgv.includes(IMPORT_FLAG)) {
|
|
556
|
-
execArgv = [
|
|
557
|
-
IMPORT_FLAG,
|
|
558
|
-
`@${TsRunner.OXC}-node/core/register`,
|
|
559
|
-
...execArgv
|
|
560
|
-
];
|
|
561
|
-
}
|
|
562
|
-
break;
|
|
563
|
-
}
|
|
564
|
-
case TsRunner.SWC: {
|
|
565
|
-
if (tsUseEsm) {
|
|
566
|
-
if (IMPORT_FLAG_SUPPORTED) {
|
|
567
|
-
if (!hasImportFlag(execArgv)) {
|
|
568
|
-
execArgv = [
|
|
569
|
-
IMPORT_FLAG,
|
|
570
|
-
`@${TsRunner.SWC}-node/register/esm-register`,
|
|
571
|
-
...execArgv
|
|
572
|
-
];
|
|
573
|
-
}
|
|
574
|
-
} else if (!hasLoaderFlag(execArgv)) {
|
|
575
|
-
execArgv = [
|
|
576
|
-
LOADER_FLAG,
|
|
577
|
-
`@${TsRunner.SWC}-node/register/esm`,
|
|
578
|
-
...execArgv
|
|
579
|
-
];
|
|
580
|
-
}
|
|
581
|
-
} else if (!hasRequireFlag(execArgv)) {
|
|
582
|
-
execArgv = [
|
|
583
|
-
REQUIRE_ABBR_FLAG,
|
|
584
|
-
`@${TsRunner.SWC}-node/register`,
|
|
585
|
-
...execArgv
|
|
586
|
-
];
|
|
587
|
-
}
|
|
588
|
-
break;
|
|
589
|
-
}
|
|
590
|
-
case TsRunner.TSX: {
|
|
591
|
-
if (IMPORT_FLAG_SUPPORTED) {
|
|
592
|
-
if (!execArgv.includes(IMPORT_FLAG)) {
|
|
593
|
-
execArgv = [IMPORT_FLAG, TsRunner.TSX, ...execArgv];
|
|
594
|
-
}
|
|
595
|
-
} else if (!execArgv.includes(LOADER_FLAG)) {
|
|
596
|
-
execArgv = [LOADER_FLAG, TsRunner.TSX, ...execArgv];
|
|
597
|
-
}
|
|
598
|
-
break;
|
|
599
|
-
}
|
|
600
|
-
default: {
|
|
601
|
-
throw new Error(`Unknown ts runner: ${String(tsRunner)}`);
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
} else if (!jsUseEsm && ext !== ".cjs") {
|
|
605
|
-
const pkg3 = findUp(workerPath);
|
|
606
|
-
if (pkg3) {
|
|
607
|
-
jsUseEsm = cjsRequire2(pkg3).type === "module";
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
let resolvedPnpLoaderPath;
|
|
611
|
-
if (process.versions.pnp) {
|
|
612
|
-
let pnpApiPath;
|
|
613
|
-
try {
|
|
614
|
-
pnpApiPath = cjsRequire2.resolve("pnpapi");
|
|
615
|
-
} catch {
|
|
616
|
-
}
|
|
617
|
-
if (pnpApiPath && !NODE_OPTIONS2.some((option, index) => REQUIRE_FLAGS.has(option) && pnpApiPath === cjsRequire2.resolve(NODE_OPTIONS2[index + 1])) && !execArgv.includes(pnpApiPath)) {
|
|
618
|
-
execArgv = [REQUIRE_ABBR_FLAG, pnpApiPath, ...execArgv];
|
|
619
|
-
const pnpLoaderPath = import_node_path3.default.resolve(pnpApiPath, "../.pnp.loader.mjs");
|
|
620
|
-
if (isFile(pnpLoaderPath)) {
|
|
621
|
-
resolvedPnpLoaderPath = (0, import_node_url.pathToFileURL)(pnpLoaderPath).href;
|
|
622
|
-
if (!MODULE_REGISTER_SUPPORTED) {
|
|
623
|
-
execArgv = [LOADER_FLAG, resolvedPnpLoaderPath, ...execArgv];
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
return {
|
|
629
|
-
ext,
|
|
630
|
-
isTs,
|
|
631
|
-
jsUseEsm,
|
|
632
|
-
tsRunner,
|
|
633
|
-
tsUseEsm,
|
|
634
|
-
workerPath,
|
|
635
|
-
pnpLoaderPath: resolvedPnpLoaderPath,
|
|
636
|
-
execArgv
|
|
637
|
-
};
|
|
638
|
-
};
|
|
639
|
-
md5Hash = (text) => (0, import_node_crypto.createHash)("md5").update(text).digest("hex");
|
|
640
|
-
encodeImportModule = (moduleNameOrGlobalShim, type = "import") => {
|
|
641
|
-
const { moduleName, globalName, named, conditional } = typeof moduleNameOrGlobalShim === "string" ? { moduleName: moduleNameOrGlobalShim } : moduleNameOrGlobalShim;
|
|
642
|
-
const importStatement = type === "import" ? `import${globalName ? " " + (named === null ? "* as " + globalName : named?.trim() ? `{${named}}` : globalName) + " from" : ""} '${import_node_path3.default.isAbsolute(moduleName) ? String((0, import_node_url.pathToFileURL)(moduleName)) : moduleName}'` : `${globalName ? "const " + (named?.trim() ? `{${named}}` : globalName) + "=" : ""}require('${moduleName.replace(/\\/g, "\\\\")}')`;
|
|
643
|
-
if (!globalName) {
|
|
644
|
-
return importStatement;
|
|
645
|
-
}
|
|
646
|
-
const overrideStatement = `globalThis.${globalName}=${named?.trim() ? named : globalName}`;
|
|
647
|
-
return importStatement + (conditional === false ? `;${overrideStatement}` : `;if(!globalThis.${globalName})${overrideStatement}`);
|
|
648
|
-
};
|
|
649
|
-
_generateGlobals = (globalShims, type) => globalShims.reduce((acc, shim) => `${acc}${acc ? ";" : ""}${encodeImportModule(shim, type)}`, "");
|
|
650
|
-
_dirname = typeof __dirname === "undefined" ? import_node_path3.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl)) : __dirname;
|
|
651
|
-
generateGlobals = (workerPath, globalShims, type = "import") => {
|
|
652
|
-
if (globalShims.length === 0) {
|
|
653
|
-
return "";
|
|
654
|
-
}
|
|
655
|
-
globalsCache ?? (globalsCache = /* @__PURE__ */ new Map());
|
|
656
|
-
const cached = globalsCache.get(workerPath);
|
|
657
|
-
if (cached) {
|
|
658
|
-
const [content2, filepath2] = cached;
|
|
659
|
-
if (type === "require" && !filepath2 || type === "import" && filepath2 && isFile(filepath2)) {
|
|
660
|
-
return content2;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
const globals = _generateGlobals(globalShims, type);
|
|
664
|
-
let content = globals;
|
|
665
|
-
let filepath;
|
|
666
|
-
if (type === "import") {
|
|
667
|
-
if (!tmpdir) {
|
|
668
|
-
tmpdir = import_node_path3.default.resolve(findUp(_dirname), "../node_modules/.synckit");
|
|
669
|
-
}
|
|
670
|
-
import_node_fs3.default.mkdirSync(tmpdir, { recursive: true });
|
|
671
|
-
filepath = import_node_path3.default.resolve(tmpdir, md5Hash(workerPath) + ".mjs");
|
|
672
|
-
content = encodeImportModule(filepath);
|
|
673
|
-
import_node_fs3.default.writeFileSync(filepath, globals);
|
|
674
|
-
}
|
|
675
|
-
globalsCache.set(workerPath, [content, filepath]);
|
|
676
|
-
return content;
|
|
677
|
-
};
|
|
678
|
-
}
|
|
679
|
-
});
|
|
680
|
-
|
|
681
|
-
// ../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/types.js
|
|
682
|
-
var init_types = __esm({
|
|
683
|
-
"../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/types.js"() {
|
|
684
|
-
"use strict";
|
|
685
|
-
init_cjs_shims();
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
|
|
689
|
-
// ../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/index.js
|
|
690
|
-
function createSyncFn(workerPath, timeoutOrOptions) {
|
|
691
|
-
syncFnCache ?? (syncFnCache = /* @__PURE__ */ new Map());
|
|
692
|
-
if (typeof workerPath !== "string" || workerPath.startsWith("file://")) {
|
|
693
|
-
workerPath = (0, import_node_url2.fileURLToPath)(workerPath);
|
|
694
|
-
}
|
|
695
|
-
const cachedSyncFn = syncFnCache.get(workerPath);
|
|
696
|
-
if (cachedSyncFn) {
|
|
697
|
-
return cachedSyncFn;
|
|
698
|
-
}
|
|
699
|
-
if (!import_node_path4.default.isAbsolute(workerPath)) {
|
|
700
|
-
throw new Error("`workerPath` must be absolute");
|
|
701
|
-
}
|
|
702
|
-
const syncFn = startWorkerThread(workerPath, typeof timeoutOrOptions === "number" ? { timeout: timeoutOrOptions } : timeoutOrOptions);
|
|
703
|
-
syncFnCache.set(workerPath, syncFn);
|
|
704
|
-
return syncFn;
|
|
705
|
-
}
|
|
706
|
-
var import_node_module3, import_node_path4, import_node_url2, import_node_worker_threads2, syncFnCache;
|
|
707
|
-
var init_lib2 = __esm({
|
|
708
|
-
"../../node_modules/.pnpm/synckit@0.11.8/node_modules/synckit/lib/index.js"() {
|
|
709
|
-
"use strict";
|
|
710
|
-
init_cjs_shims();
|
|
711
|
-
import_node_module3 = __toESM(require("module"), 1);
|
|
712
|
-
import_node_path4 = __toESM(require("path"), 1);
|
|
713
|
-
import_node_url2 = require("url");
|
|
714
|
-
import_node_worker_threads2 = require("worker_threads");
|
|
715
|
-
init_constants();
|
|
716
|
-
init_helpers3();
|
|
717
|
-
init_common();
|
|
718
|
-
init_constants();
|
|
719
|
-
init_helpers3();
|
|
720
|
-
init_types();
|
|
721
|
-
}
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
// ../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/sync.js
|
|
725
|
-
var performSyncWork;
|
|
726
|
-
var init_sync = __esm({
|
|
727
|
-
"../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/sync.js"() {
|
|
728
|
-
"use strict";
|
|
729
|
-
init_cjs_shims();
|
|
730
|
-
init_lib2();
|
|
731
|
-
init_helpers();
|
|
732
|
-
performSyncWork = createSyncFn(cjsRequire.resolve("./worker.js"));
|
|
733
|
-
}
|
|
734
|
-
});
|
|
735
|
-
|
|
736
|
-
// ../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/parser.js
|
|
737
|
-
var import_node_path5, DEFAULT_EXTENSIONS, MARKDOWN_EXTENSIONS, Parser, parser, parse, parseForESLint;
|
|
738
|
-
var init_parser = __esm({
|
|
739
|
-
"../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/parser.js"() {
|
|
740
|
-
"use strict";
|
|
741
|
-
init_cjs_shims();
|
|
742
|
-
import_node_path5 = __toESM(require("path"), 1);
|
|
743
|
-
init_helpers();
|
|
744
|
-
init_sync();
|
|
745
|
-
DEFAULT_EXTENSIONS = [".mdx"];
|
|
746
|
-
MARKDOWN_EXTENSIONS = [".md"];
|
|
747
|
-
Parser = class {
|
|
748
|
-
constructor() {
|
|
749
|
-
this.parse = this.parse.bind(this);
|
|
750
|
-
this.parseForESLint = this.parseForESLint.bind(this);
|
|
751
|
-
}
|
|
752
|
-
parse(code, options) {
|
|
753
|
-
return this.parseForESLint(code, options).ast;
|
|
754
|
-
}
|
|
755
|
-
parseForESLint(code, { filePath, sourceType, ignoreRemarkConfig, remarkConfigPath, extensions, markdownExtensions }) {
|
|
756
|
-
const extname = import_node_path5.default.extname(filePath);
|
|
757
|
-
const isMdx = [...DEFAULT_EXTENSIONS, ...arrayify(extensions)].includes(extname);
|
|
758
|
-
const isMarkdown = [
|
|
759
|
-
...MARKDOWN_EXTENSIONS,
|
|
760
|
-
...arrayify(markdownExtensions)
|
|
761
|
-
].includes(extname);
|
|
762
|
-
if (!isMdx && !isMarkdown) {
|
|
763
|
-
throw new Error("Unsupported file extension, make sure setting the `extensions` or `markdownExtensions` option correctly.");
|
|
764
|
-
}
|
|
765
|
-
let result;
|
|
766
|
-
try {
|
|
767
|
-
result = performSyncWork({
|
|
768
|
-
filePath: getPhysicalFilename(filePath),
|
|
769
|
-
code,
|
|
770
|
-
isMdx,
|
|
771
|
-
ignoreRemarkConfig,
|
|
772
|
-
remarkConfigPath
|
|
773
|
-
});
|
|
774
|
-
} catch (err) {
|
|
775
|
-
if (process.argv.includes("--debug")) {
|
|
776
|
-
console.error(err);
|
|
777
|
-
}
|
|
778
|
-
const { message, line, column, place } = err;
|
|
779
|
-
const point = place && ("start" in place ? place.start : place);
|
|
780
|
-
throw Object.assign(new SyntaxError(message, {
|
|
781
|
-
cause: err
|
|
782
|
-
}), {
|
|
783
|
-
lineNumber: line,
|
|
784
|
-
column,
|
|
785
|
-
index: point?.offset
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
const { root, body, comments, tokens } = result;
|
|
789
|
-
return {
|
|
790
|
-
ast: {
|
|
791
|
-
...normalizePosition(root.position),
|
|
792
|
-
type: "Program",
|
|
793
|
-
sourceType,
|
|
794
|
-
body,
|
|
795
|
-
comments,
|
|
796
|
-
tokens
|
|
797
|
-
}
|
|
798
|
-
};
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
parser = new Parser();
|
|
802
|
-
({ parse, parseForESLint } = parser);
|
|
803
|
-
}
|
|
804
|
-
});
|
|
805
|
-
|
|
806
|
-
// ../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/index.js
|
|
807
|
-
var lib_exports = {};
|
|
808
|
-
__export(lib_exports, {
|
|
809
|
-
DEFAULT_EXTENSIONS: () => DEFAULT_EXTENSIONS,
|
|
810
|
-
MARKDOWN_EXTENSIONS: () => MARKDOWN_EXTENSIONS,
|
|
811
|
-
Parser: () => Parser,
|
|
812
|
-
arrayify: () => arrayify,
|
|
813
|
-
cjsRequire: () => cjsRequire,
|
|
814
|
-
getPhysicalFilename: () => getPhysicalFilename,
|
|
815
|
-
getPositionAtFactory: () => getPositionAtFactory,
|
|
816
|
-
meta: () => meta,
|
|
817
|
-
nextCharOffsetFactory: () => nextCharOffsetFactory,
|
|
818
|
-
normalizePosition: () => normalizePosition,
|
|
819
|
-
parse: () => parse,
|
|
820
|
-
parseForESLint: () => parseForESLint,
|
|
821
|
-
parser: () => parser,
|
|
822
|
-
performSyncWork: () => performSyncWork,
|
|
823
|
-
prevCharOffsetFactory: () => prevCharOffsetFactory
|
|
824
|
-
});
|
|
825
|
-
var init_lib3 = __esm({
|
|
826
|
-
"../../node_modules/.pnpm/eslint-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-mdx/lib/index.js"() {
|
|
827
|
-
"use strict";
|
|
828
|
-
init_cjs_shims();
|
|
829
|
-
init_helpers();
|
|
830
|
-
init_meta();
|
|
831
|
-
init_parser();
|
|
832
|
-
init_sync();
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
|
|
836
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/helpers.js
|
|
837
|
-
var import_node_module4, getGlobals, importMetaUrl4, cjsRequire3;
|
|
838
|
-
var init_helpers4 = __esm({
|
|
839
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/helpers.js"() {
|
|
840
|
-
"use strict";
|
|
841
|
-
init_cjs_shims();
|
|
842
|
-
import_node_module4 = require("module");
|
|
843
|
-
getGlobals = (sources, initialGlobals = {}) => (Array.isArray(sources) ? sources : Object.keys(sources)).reduce((globals, source) => Object.assign(globals, {
|
|
844
|
-
[source]: false
|
|
845
|
-
}), initialGlobals);
|
|
846
|
-
importMetaUrl4 = importMetaUrl4;
|
|
847
|
-
cjsRequire3 = importMetaUrl4 ? (0, import_node_module4.createRequire)(importMetaUrl4) : require;
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
|
|
851
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/meta.js
|
|
852
|
-
var pkg2, meta2;
|
|
853
|
-
var init_meta2 = __esm({
|
|
854
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/meta.js"() {
|
|
855
|
-
"use strict";
|
|
856
|
-
init_cjs_shims();
|
|
857
|
-
init_helpers4();
|
|
858
|
-
pkg2 = cjsRequire3("../package.json");
|
|
859
|
-
meta2 = { name: pkg2.name, version: pkg2.version };
|
|
860
|
-
}
|
|
861
|
-
});
|
|
862
|
-
|
|
863
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/helpers.js
|
|
864
|
-
function getShortLang(filename, languageMapper) {
|
|
865
|
-
const language = filename.split(".").at(-1);
|
|
866
|
-
if (languageMapper === false) {
|
|
867
|
-
return language;
|
|
868
|
-
}
|
|
869
|
-
languageMapper = languageMapper ? { ...DEFAULT_LANGUAGE_MAPPER, ...languageMapper } : DEFAULT_LANGUAGE_MAPPER;
|
|
870
|
-
const mapped = languageMapper[language];
|
|
871
|
-
if (mapped) {
|
|
872
|
-
return mapped;
|
|
873
|
-
}
|
|
874
|
-
const lang = language.toLowerCase();
|
|
875
|
-
return languageMapper[lang] || lang;
|
|
876
|
-
}
|
|
877
|
-
var DEFAULT_LANGUAGE_MAPPER;
|
|
878
|
-
var init_helpers5 = __esm({
|
|
879
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/helpers.js"() {
|
|
880
|
-
"use strict";
|
|
881
|
-
init_cjs_shims();
|
|
882
|
-
DEFAULT_LANGUAGE_MAPPER = {
|
|
883
|
-
ecmascript: "js",
|
|
884
|
-
javascript: "js",
|
|
885
|
-
javascriptreact: "jsx",
|
|
886
|
-
typescript: "ts",
|
|
887
|
-
typescriptreact: "tsx",
|
|
888
|
-
markdown: "md",
|
|
889
|
-
markdownjsx: "mdx",
|
|
890
|
-
markdownreact: "mdx",
|
|
891
|
-
mdown: "md",
|
|
892
|
-
mkdn: "md"
|
|
893
|
-
};
|
|
894
|
-
}
|
|
895
|
-
});
|
|
896
|
-
|
|
897
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/markdown.js
|
|
898
|
-
function traverse(node, callbacks) {
|
|
899
|
-
if (callbacks[node.type]) {
|
|
900
|
-
callbacks[node.type](node);
|
|
901
|
-
} else {
|
|
902
|
-
callbacks["*"]();
|
|
903
|
-
}
|
|
904
|
-
const parent = node;
|
|
905
|
-
if ("children" in parent) {
|
|
906
|
-
for (const child of parent.children) {
|
|
907
|
-
traverse(child, callbacks);
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
function getComment(value, isMdx = false) {
|
|
912
|
-
const [commentStart, commentEnd] = COMMENTS[+isMdx];
|
|
913
|
-
const commentStartMatched = commentStart.exec(value);
|
|
914
|
-
const commentEndMatched = commentEnd.exec(value);
|
|
915
|
-
if (commentStartMatched == null || commentEndMatched == null) {
|
|
916
|
-
return "";
|
|
917
|
-
}
|
|
918
|
-
const comment = value.slice(commentStartMatched[0].length, -commentEndMatched[0].length).trim();
|
|
919
|
-
if (!eslintCommentRegex.test(comment)) {
|
|
920
|
-
return "";
|
|
921
|
-
}
|
|
922
|
-
return comment;
|
|
923
|
-
}
|
|
924
|
-
function getBeginningOfLineOffset(node) {
|
|
925
|
-
return node.position.start.offset - node.position.start.column + 1;
|
|
926
|
-
}
|
|
927
|
-
function getIndentText(text, node) {
|
|
928
|
-
return leadingWhitespaceRegex.exec(text.slice(getBeginningOfLineOffset(node)))[0];
|
|
929
|
-
}
|
|
930
|
-
function getBlockRangeMap(text, node, comments) {
|
|
931
|
-
const startOffset = getBeginningOfLineOffset(node);
|
|
932
|
-
const code = text.slice(startOffset, node.position.end.offset);
|
|
933
|
-
const lines = code.split("\n");
|
|
934
|
-
const baseIndent = getIndentText(text, node).length;
|
|
935
|
-
const commentLength = comments.reduce((len, comment) => len + comment.length + 1, 0);
|
|
936
|
-
const rangeMap = [
|
|
937
|
-
{
|
|
938
|
-
indent: baseIndent,
|
|
939
|
-
js: 0,
|
|
940
|
-
md: 0
|
|
941
|
-
}
|
|
942
|
-
];
|
|
943
|
-
let jsOffset = commentLength;
|
|
944
|
-
let mdOffset = startOffset + lines[0].length + 1;
|
|
945
|
-
for (let i = 0; i + 1 < lines.length; i++) {
|
|
946
|
-
const line = lines[i + 1];
|
|
947
|
-
const leadingWhitespaceLength = leadingWhitespaceRegex.exec(line)[0].length;
|
|
948
|
-
const trimLength = Math.min(baseIndent, leadingWhitespaceLength);
|
|
949
|
-
rangeMap.push({
|
|
950
|
-
indent: trimLength,
|
|
951
|
-
js: jsOffset,
|
|
952
|
-
md: mdOffset + trimLength - jsOffset
|
|
953
|
-
});
|
|
954
|
-
mdOffset += line.length + 1;
|
|
955
|
-
jsOffset += line.length - trimLength + 1;
|
|
956
|
-
}
|
|
957
|
-
return rangeMap;
|
|
958
|
-
}
|
|
959
|
-
function fileNameFromMeta(block) {
|
|
960
|
-
return codeBlockFileNameRegex.exec(block.meta)?.groups.filename.replaceAll(/\s+/gu, "_");
|
|
961
|
-
}
|
|
962
|
-
function getOnDiskFilepath(filepath) {
|
|
963
|
-
let fallback;
|
|
964
|
-
try {
|
|
965
|
-
if (!import_node_fs4.default.statSync(filepath, { throwIfNoEntry: false })) {
|
|
966
|
-
fallback = true;
|
|
967
|
-
}
|
|
968
|
-
} catch (err) {
|
|
969
|
-
if (err.code === "ENOTDIR") {
|
|
970
|
-
fallback = true;
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
return fallback ? getOnDiskFilepath(import_node_path6.default.dirname(filepath)) : filepath;
|
|
974
|
-
}
|
|
975
|
-
function preprocess(sourceText, filename, syncOptions) {
|
|
976
|
-
const text = sourceText.startsWith(BOM) ? sourceText.slice(1) : sourceText;
|
|
977
|
-
const { root } = performSyncWork({
|
|
978
|
-
filePath: getOnDiskFilepath(filename),
|
|
979
|
-
code: text,
|
|
980
|
-
isMdx: filename.endsWith(".mdx"),
|
|
981
|
-
...syncOptions
|
|
982
|
-
});
|
|
983
|
-
const blocks = [];
|
|
984
|
-
blocksCache.set(filename, blocks);
|
|
985
|
-
let allComments = [];
|
|
986
|
-
function mdxExpression(node) {
|
|
987
|
-
const comment = getComment(node.value, true);
|
|
988
|
-
if (comment) {
|
|
989
|
-
allComments.push(comment);
|
|
990
|
-
} else {
|
|
991
|
-
allComments = [];
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
traverse(root, {
|
|
995
|
-
"*"() {
|
|
996
|
-
allComments = [];
|
|
997
|
-
},
|
|
998
|
-
code(node) {
|
|
999
|
-
if (!node.lang) {
|
|
1000
|
-
return;
|
|
1001
|
-
}
|
|
1002
|
-
const comments = [];
|
|
1003
|
-
for (const comment of allComments) {
|
|
1004
|
-
if (comment === "eslint-skip") {
|
|
1005
|
-
allComments = [];
|
|
1006
|
-
return;
|
|
1007
|
-
}
|
|
1008
|
-
comments.push(`/* ${comment} */`);
|
|
1009
|
-
}
|
|
1010
|
-
allComments = [];
|
|
1011
|
-
blocks.push({
|
|
1012
|
-
...node,
|
|
1013
|
-
baseIndentText: getIndentText(text, node),
|
|
1014
|
-
comments,
|
|
1015
|
-
rangeMap: getBlockRangeMap(text, node, comments)
|
|
1016
|
-
});
|
|
1017
|
-
},
|
|
1018
|
-
html(node) {
|
|
1019
|
-
const comment = getComment(node.value);
|
|
1020
|
-
if (comment) {
|
|
1021
|
-
allComments.push(comment);
|
|
1022
|
-
} else {
|
|
1023
|
-
allComments = [];
|
|
1024
|
-
}
|
|
1025
|
-
},
|
|
1026
|
-
mdxFlowExpression: mdxExpression,
|
|
1027
|
-
mdxTextExpression: mdxExpression
|
|
1028
|
-
});
|
|
1029
|
-
return blocks.map((block, index) => {
|
|
1030
|
-
const [language] = block.lang.trim().split(" ");
|
|
1031
|
-
return {
|
|
1032
|
-
filename: fileNameFromMeta(block) ?? `${index}.${language}`,
|
|
1033
|
-
text: [...block.comments, block.value, ""].join("\n")
|
|
1034
|
-
};
|
|
1035
|
-
});
|
|
1036
|
-
}
|
|
1037
|
-
function adjustFix(block, fix) {
|
|
1038
|
-
return {
|
|
1039
|
-
range: fix.range.map((range) => {
|
|
1040
|
-
let i = 1;
|
|
1041
|
-
while (i < block.rangeMap.length && block.rangeMap[i].js <= range) {
|
|
1042
|
-
i++;
|
|
1043
|
-
}
|
|
1044
|
-
return range + block.rangeMap[i - 1].md;
|
|
1045
|
-
}),
|
|
1046
|
-
text: fix.text.replaceAll("\n", `
|
|
1047
|
-
${block.baseIndentText}`)
|
|
1048
|
-
};
|
|
1049
|
-
}
|
|
1050
|
-
function adjustBlock(block) {
|
|
1051
|
-
const leadingCommentLines = block.comments.reduce((count, comment) => count + comment.split("\n").length, 0);
|
|
1052
|
-
const blockStart = block.position.start.line;
|
|
1053
|
-
return function adjustMessage(message) {
|
|
1054
|
-
if (!Number.isInteger(message.line)) {
|
|
1055
|
-
return {
|
|
1056
|
-
...message,
|
|
1057
|
-
line: blockStart,
|
|
1058
|
-
column: block.position.start.column
|
|
1059
|
-
};
|
|
1060
|
-
}
|
|
1061
|
-
const lineInCode = message.line - leadingCommentLines;
|
|
1062
|
-
if (lineInCode < 1 || lineInCode >= block.rangeMap.length) {
|
|
1063
|
-
return null;
|
|
1064
|
-
}
|
|
1065
|
-
const out = {
|
|
1066
|
-
line: lineInCode + blockStart,
|
|
1067
|
-
column: message.column + block.rangeMap[lineInCode].indent
|
|
1068
|
-
};
|
|
1069
|
-
if (Number.isInteger(message.endLine)) {
|
|
1070
|
-
out.endLine = message.endLine - leadingCommentLines + blockStart;
|
|
1071
|
-
}
|
|
1072
|
-
if (Array.isArray(message.suggestions)) {
|
|
1073
|
-
out.suggestions = message.suggestions.map((suggestion) => ({
|
|
1074
|
-
...suggestion,
|
|
1075
|
-
fix: adjustFix(block, suggestion.fix)
|
|
1076
|
-
}));
|
|
1077
|
-
}
|
|
1078
|
-
const adjustedFix = {};
|
|
1079
|
-
if (message.fix) {
|
|
1080
|
-
adjustedFix.fix = adjustFix(block, message.fix);
|
|
1081
|
-
}
|
|
1082
|
-
return { ...message, ...out, ...adjustedFix };
|
|
1083
|
-
};
|
|
1084
|
-
}
|
|
1085
|
-
function excludeUnsatisfiableRules(message) {
|
|
1086
|
-
return message && !UNSATISFIABLE_RULES.has(message.ruleId);
|
|
1087
|
-
}
|
|
1088
|
-
function postprocess(messages, filename) {
|
|
1089
|
-
const blocks = blocksCache.get(filename);
|
|
1090
|
-
blocksCache.delete(filename);
|
|
1091
|
-
return messages.flatMap((group, i) => {
|
|
1092
|
-
const adjust = adjustBlock(blocks[i]);
|
|
1093
|
-
return group.map(adjust).filter(excludeUnsatisfiableRules);
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
var import_node_fs4, import_node_path6, UNSATISFIABLE_RULES, SUPPORTS_AUTOFIX, BOM, blocksCache, COMMENTS, eslintCommentRegex, leadingWhitespaceRegex, codeBlockFileNameRegex, markdownProcessor;
|
|
1097
|
-
var init_markdown = __esm({
|
|
1098
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/markdown.js"() {
|
|
1099
|
-
"use strict";
|
|
1100
|
-
init_cjs_shims();
|
|
1101
|
-
import_node_fs4 = __toESM(require("fs"), 1);
|
|
1102
|
-
import_node_path6 = __toESM(require("path"), 1);
|
|
1103
|
-
init_lib3();
|
|
1104
|
-
init_meta2();
|
|
1105
|
-
UNSATISFIABLE_RULES = /* @__PURE__ */ new Set([
|
|
1106
|
-
"eol-last",
|
|
1107
|
-
"unicode-bom"
|
|
1108
|
-
]);
|
|
1109
|
-
SUPPORTS_AUTOFIX = true;
|
|
1110
|
-
BOM = "\uFEFF";
|
|
1111
|
-
blocksCache = /* @__PURE__ */ new Map();
|
|
1112
|
-
COMMENTS = [
|
|
1113
|
-
[
|
|
1114
|
-
/^<!-{2,}/,
|
|
1115
|
-
/-{2,}>$/
|
|
1116
|
-
],
|
|
1117
|
-
[
|
|
1118
|
-
/^\/\*+/,
|
|
1119
|
-
/\*+\/$/
|
|
1120
|
-
]
|
|
1121
|
-
];
|
|
1122
|
-
eslintCommentRegex = /^(?:eslint\b|global\s)/u;
|
|
1123
|
-
leadingWhitespaceRegex = /^[>\s]*/u;
|
|
1124
|
-
codeBlockFileNameRegex = /filename=(?<quote>["'])(?<filename>.*?)\k<quote>/u;
|
|
1125
|
-
markdownProcessor = {
|
|
1126
|
-
meta: {
|
|
1127
|
-
name: "mdx/markdown",
|
|
1128
|
-
version: meta2.version
|
|
1129
|
-
},
|
|
1130
|
-
preprocess,
|
|
1131
|
-
postprocess,
|
|
1132
|
-
supportsAutofix: SUPPORTS_AUTOFIX
|
|
1133
|
-
};
|
|
1134
|
-
}
|
|
1135
|
-
});
|
|
1136
|
-
|
|
1137
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/options.js
|
|
1138
|
-
var processorOptions, linterPath, ESLinter, verify;
|
|
1139
|
-
var init_options = __esm({
|
|
1140
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/options.js"() {
|
|
1141
|
-
"use strict";
|
|
1142
|
-
init_cjs_shims();
|
|
1143
|
-
init_helpers4();
|
|
1144
|
-
processorOptions = {};
|
|
1145
|
-
linterPath = Object.keys(cjsRequire3.cache).find((path8) => /([/\\])eslint\1lib(?:\1linter){2}\.js$/.test(path8));
|
|
1146
|
-
if (!linterPath) {
|
|
1147
|
-
throw new Error("Could not find ESLint Linter in require cache");
|
|
1148
|
-
}
|
|
1149
|
-
ESLinter = cjsRequire3(linterPath).Linter;
|
|
1150
|
-
({ verify } = ESLinter.prototype);
|
|
1151
|
-
ESLinter.prototype.verify = function(code, config, options) {
|
|
1152
|
-
const settings = (config.extractConfig?.(typeof options === "undefined" || typeof options === "string" ? options : options.filename) ?? config).settings ?? {};
|
|
1153
|
-
processorOptions.lintCodeBlocks = settings["mdx/code-blocks"];
|
|
1154
|
-
processorOptions.languageMapper = settings["mdx/language-mapper"];
|
|
1155
|
-
processorOptions.ignoreRemarkConfig = settings["mdx/ignore-remark-config"];
|
|
1156
|
-
processorOptions.remarkConfigPath = settings["mdx/remark-config-path"];
|
|
1157
|
-
return verify.call(this, code, config, options);
|
|
1158
|
-
};
|
|
1159
|
-
}
|
|
1160
|
-
});
|
|
1161
|
-
|
|
1162
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/remark.js
|
|
1163
|
-
var createRemarkProcessor, remark;
|
|
1164
|
-
var init_remark = __esm({
|
|
1165
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/remark.js"() {
|
|
1166
|
-
"use strict";
|
|
1167
|
-
init_cjs_shims();
|
|
1168
|
-
init_meta2();
|
|
1169
|
-
init_helpers5();
|
|
1170
|
-
init_markdown();
|
|
1171
|
-
init_options();
|
|
1172
|
-
createRemarkProcessor = ({ languageMapper, lintCodeBlocks, ...syncOptions } = processorOptions) => ({
|
|
1173
|
-
meta: {
|
|
1174
|
-
name: "mdx/remark",
|
|
1175
|
-
version: meta2.version
|
|
1176
|
-
},
|
|
1177
|
-
supportsAutofix: true,
|
|
1178
|
-
preprocess(text, filename) {
|
|
1179
|
-
if (!lintCodeBlocks) {
|
|
1180
|
-
return [text];
|
|
1181
|
-
}
|
|
1182
|
-
return [
|
|
1183
|
-
text,
|
|
1184
|
-
...markdownProcessor.preprocess(text, filename, syncOptions).map(({ text: text2, filename: filename2 }) => ({
|
|
1185
|
-
text: text2,
|
|
1186
|
-
filename: filename2.slice(0, filename2.lastIndexOf(".")) + "." + getShortLang(filename2, languageMapper)
|
|
1187
|
-
}))
|
|
1188
|
-
];
|
|
1189
|
-
},
|
|
1190
|
-
postprocess([mdxMessages, ...markdownMessages], filename) {
|
|
1191
|
-
return [
|
|
1192
|
-
...mdxMessages,
|
|
1193
|
-
...markdownProcessor.postprocess(markdownMessages, filename)
|
|
1194
|
-
].sort((a, b) => a.line - b.line || a.column - b.column).map((lintMessage) => {
|
|
1195
|
-
const { message, ruleId: eslintRuleId, severity: eslintSeverity } = lintMessage;
|
|
1196
|
-
if (eslintRuleId !== "mdx/remark") {
|
|
1197
|
-
return lintMessage;
|
|
1198
|
-
}
|
|
1199
|
-
const { source, ruleId, reason, severity } = JSON.parse(message);
|
|
1200
|
-
return {
|
|
1201
|
-
...lintMessage,
|
|
1202
|
-
ruleId: `${source}-${ruleId}`,
|
|
1203
|
-
message: reason,
|
|
1204
|
-
severity: Math.max(eslintSeverity, severity)
|
|
1205
|
-
};
|
|
1206
|
-
});
|
|
1207
|
-
}
|
|
1208
|
-
});
|
|
1209
|
-
remark = createRemarkProcessor();
|
|
1210
|
-
}
|
|
1211
|
-
});
|
|
1212
|
-
|
|
1213
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/flat.js
|
|
1214
|
-
var flat, parserOptions, restConfig, flatCodeBlocks;
|
|
1215
|
-
var init_flat = __esm({
|
|
1216
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/flat.js"() {
|
|
1217
|
-
"use strict";
|
|
1218
|
-
init_cjs_shims();
|
|
1219
|
-
init_lib3();
|
|
1220
|
-
init_lib4();
|
|
1221
|
-
init_remark();
|
|
1222
|
-
init_code_blocks();
|
|
1223
|
-
flat = {
|
|
1224
|
-
files: ["**/*.{md,mdx}"],
|
|
1225
|
-
languageOptions: {
|
|
1226
|
-
parser: lib_exports,
|
|
1227
|
-
globals: {
|
|
1228
|
-
React: false
|
|
1229
|
-
}
|
|
1230
|
-
},
|
|
1231
|
-
plugins: {
|
|
1232
|
-
mdx: lib_exports2
|
|
1233
|
-
},
|
|
1234
|
-
processor: remark,
|
|
1235
|
-
rules: {
|
|
1236
|
-
"mdx/remark": "warn",
|
|
1237
|
-
"no-unused-expressions": "error",
|
|
1238
|
-
"react/react-in-jsx-scope": "off"
|
|
1239
|
-
}
|
|
1240
|
-
};
|
|
1241
|
-
({ parserOptions, ...restConfig } = codeBlocks);
|
|
1242
|
-
flatCodeBlocks = {
|
|
1243
|
-
files: ["**/*.{md,mdx}/**"],
|
|
1244
|
-
languageOptions: {
|
|
1245
|
-
parserOptions
|
|
1246
|
-
},
|
|
1247
|
-
...restConfig
|
|
1248
|
-
};
|
|
1249
|
-
}
|
|
1250
|
-
});
|
|
1251
|
-
|
|
1252
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/overrides.js
|
|
1253
|
-
var isReactPluginAvailable, overrides;
|
|
1254
|
-
var init_overrides = __esm({
|
|
1255
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/overrides.js"() {
|
|
1256
|
-
"use strict";
|
|
1257
|
-
init_cjs_shims();
|
|
1258
|
-
init_lib3();
|
|
1259
|
-
init_helpers4();
|
|
1260
|
-
init_base();
|
|
1261
|
-
isReactPluginAvailable = false;
|
|
1262
|
-
try {
|
|
1263
|
-
cjsRequire3.resolve("eslint-plugin-react");
|
|
1264
|
-
isReactPluginAvailable = true;
|
|
1265
|
-
} catch {
|
|
1266
|
-
}
|
|
1267
|
-
overrides = {
|
|
1268
|
-
...base,
|
|
1269
|
-
globals: {
|
|
1270
|
-
React: false
|
|
1271
|
-
},
|
|
1272
|
-
plugins: arrayify(base.plugins, isReactPluginAvailable ? "react" : null),
|
|
1273
|
-
rules: {
|
|
1274
|
-
"react/jsx-no-undef": isReactPluginAvailable ? [
|
|
1275
|
-
2,
|
|
1276
|
-
{
|
|
1277
|
-
allowGlobals: true
|
|
1278
|
-
}
|
|
1279
|
-
] : 0,
|
|
1280
|
-
"react/react-in-jsx-scope": 0
|
|
1281
|
-
}
|
|
1282
|
-
};
|
|
1283
|
-
}
|
|
1284
|
-
});
|
|
1285
|
-
|
|
1286
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/recommended.js
|
|
1287
|
-
var overrides2, recommended, addPrettierRules;
|
|
1288
|
-
var init_recommended = __esm({
|
|
1289
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/recommended.js"() {
|
|
1290
|
-
"use strict";
|
|
1291
|
-
init_cjs_shims();
|
|
1292
|
-
init_helpers4();
|
|
1293
|
-
init_base();
|
|
1294
|
-
overrides2 = [
|
|
1295
|
-
{
|
|
1296
|
-
files: ["*.md", "*.mdx"],
|
|
1297
|
-
extends: "plugin:mdx/overrides",
|
|
1298
|
-
...base
|
|
1299
|
-
},
|
|
1300
|
-
{
|
|
1301
|
-
files: "**/*.{md,mdx}/**",
|
|
1302
|
-
extends: "plugin:mdx/code-blocks"
|
|
1303
|
-
}
|
|
1304
|
-
];
|
|
1305
|
-
recommended = {
|
|
1306
|
-
overrides: overrides2
|
|
1307
|
-
};
|
|
1308
|
-
addPrettierRules = () => {
|
|
1309
|
-
try {
|
|
1310
|
-
cjsRequire3.resolve("prettier");
|
|
1311
|
-
const { meta: meta3 } = cjsRequire3("eslint-plugin-prettier");
|
|
1312
|
-
const version = meta3?.version || "";
|
|
1313
|
-
const [major, minor, patch] = version.split(".");
|
|
1314
|
-
if (+major > 5 || +major === 5 && (+minor > 1 || +minor === 1 && Number.parseInt(patch) >= 2)) {
|
|
1315
|
-
return;
|
|
1316
|
-
}
|
|
1317
|
-
overrides2.push({
|
|
1318
|
-
files: "*.md",
|
|
1319
|
-
rules: {
|
|
1320
|
-
"prettier/prettier": [
|
|
1321
|
-
"error",
|
|
1322
|
-
{
|
|
1323
|
-
parser: "markdown"
|
|
1324
|
-
}
|
|
1325
|
-
]
|
|
1326
|
-
}
|
|
1327
|
-
}, {
|
|
1328
|
-
files: "*.mdx",
|
|
1329
|
-
rules: {
|
|
1330
|
-
"prettier/prettier": [
|
|
1331
|
-
"error",
|
|
1332
|
-
{
|
|
1333
|
-
parser: "mdx"
|
|
1334
|
-
}
|
|
1335
|
-
]
|
|
1336
|
-
}
|
|
1337
|
-
});
|
|
1338
|
-
} catch {
|
|
1339
|
-
}
|
|
1340
|
-
};
|
|
1341
|
-
addPrettierRules();
|
|
1342
|
-
}
|
|
1343
|
-
});
|
|
1344
|
-
|
|
1345
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/index.js
|
|
1346
|
-
var configs;
|
|
1347
|
-
var init_configs = __esm({
|
|
1348
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/configs/index.js"() {
|
|
1349
|
-
"use strict";
|
|
1350
|
-
init_cjs_shims();
|
|
1351
|
-
init_base();
|
|
1352
|
-
init_code_blocks();
|
|
1353
|
-
init_flat();
|
|
1354
|
-
init_overrides();
|
|
1355
|
-
init_recommended();
|
|
1356
|
-
configs = {
|
|
1357
|
-
base,
|
|
1358
|
-
"code-blocks": codeBlocks,
|
|
1359
|
-
codeBlocks,
|
|
1360
|
-
flat,
|
|
1361
|
-
flatCodeBlocks,
|
|
1362
|
-
overrides,
|
|
1363
|
-
recommended
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
});
|
|
1367
|
-
|
|
1368
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/index.js
|
|
1369
|
-
var processors;
|
|
1370
|
-
var init_processors = __esm({
|
|
1371
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/processors/index.js"() {
|
|
1372
|
-
"use strict";
|
|
1373
|
-
init_cjs_shims();
|
|
1374
|
-
init_remark();
|
|
1375
|
-
init_helpers5();
|
|
1376
|
-
init_options();
|
|
1377
|
-
init_remark();
|
|
1378
|
-
processors = { remark };
|
|
1379
|
-
}
|
|
1380
|
-
});
|
|
1381
|
-
|
|
1382
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/rules/remark.js
|
|
1383
|
-
var import_node_path7, remark2;
|
|
1384
|
-
var init_remark2 = __esm({
|
|
1385
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/rules/remark.js"() {
|
|
1386
|
-
"use strict";
|
|
1387
|
-
init_cjs_shims();
|
|
1388
|
-
import_node_path7 = __toESM(require("path"), 1);
|
|
1389
|
-
init_lib3();
|
|
1390
|
-
remark2 = {
|
|
1391
|
-
meta: {
|
|
1392
|
-
type: "layout",
|
|
1393
|
-
docs: {
|
|
1394
|
-
description: "Linter integration with remark plugins",
|
|
1395
|
-
category: "Stylistic Issues",
|
|
1396
|
-
recommended: true
|
|
1397
|
-
},
|
|
1398
|
-
fixable: "code"
|
|
1399
|
-
},
|
|
1400
|
-
create(context) {
|
|
1401
|
-
const filename = context.getFilename();
|
|
1402
|
-
const extname = import_node_path7.default.extname(filename);
|
|
1403
|
-
const sourceCode = context.getSourceCode();
|
|
1404
|
-
const { extensions, markdownExtensions, ignoreRemarkConfig, remarkConfigPath } = {
|
|
1405
|
-
...context.parserOptions,
|
|
1406
|
-
...context.languageOptions?.parserOptions
|
|
1407
|
-
};
|
|
1408
|
-
const isMdx = [...DEFAULT_EXTENSIONS, ...extensions || []].includes(extname);
|
|
1409
|
-
const isMarkdown = [
|
|
1410
|
-
...MARKDOWN_EXTENSIONS,
|
|
1411
|
-
...markdownExtensions || []
|
|
1412
|
-
].includes(extname);
|
|
1413
|
-
return {
|
|
1414
|
-
Program(node) {
|
|
1415
|
-
if (!isMdx && !isMarkdown) {
|
|
1416
|
-
return;
|
|
1417
|
-
}
|
|
1418
|
-
const sourceText = sourceCode.getText(node);
|
|
1419
|
-
const { messages, content: fixedText } = performSyncWork({
|
|
1420
|
-
filePath: getPhysicalFilename(filename),
|
|
1421
|
-
code: sourceText,
|
|
1422
|
-
cwd: context.getCwd(),
|
|
1423
|
-
isMdx,
|
|
1424
|
-
process: true,
|
|
1425
|
-
ignoreRemarkConfig,
|
|
1426
|
-
remarkConfigPath
|
|
1427
|
-
});
|
|
1428
|
-
let fixed = 0;
|
|
1429
|
-
for (const { source, reason, ruleId, fatal, line, column, place } of messages) {
|
|
1430
|
-
const severity = fatal ? 2 : fatal == null ? 0 : 1;
|
|
1431
|
-
if (!severity) {
|
|
1432
|
-
continue;
|
|
1433
|
-
}
|
|
1434
|
-
const message = {
|
|
1435
|
-
reason,
|
|
1436
|
-
source,
|
|
1437
|
-
ruleId,
|
|
1438
|
-
severity
|
|
1439
|
-
};
|
|
1440
|
-
const point = {
|
|
1441
|
-
line,
|
|
1442
|
-
column: column - 1
|
|
1443
|
-
};
|
|
1444
|
-
context.report({
|
|
1445
|
-
message: JSON.stringify(message),
|
|
1446
|
-
loc: place && "start" in place ? {
|
|
1447
|
-
...point,
|
|
1448
|
-
start: { ...place.start, column: place.start.column - 1 },
|
|
1449
|
-
end: { ...place.end, column: place.end.column - 1 }
|
|
1450
|
-
} : point,
|
|
1451
|
-
node,
|
|
1452
|
-
fix: fixedText == null || fixedText === sourceText ? null : () => fixed++ ? null : {
|
|
1453
|
-
range: [0, sourceText.length],
|
|
1454
|
-
text: fixedText
|
|
1455
|
-
}
|
|
1456
|
-
});
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
};
|
|
1460
|
-
}
|
|
1461
|
-
};
|
|
1462
|
-
}
|
|
1463
|
-
});
|
|
1464
|
-
|
|
1465
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/rules/index.js
|
|
1466
|
-
var rules;
|
|
1467
|
-
var init_rules = __esm({
|
|
1468
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/rules/index.js"() {
|
|
1469
|
-
"use strict";
|
|
1470
|
-
init_cjs_shims();
|
|
1471
|
-
init_remark2();
|
|
1472
|
-
rules = { remark: remark2 };
|
|
1473
|
-
}
|
|
1474
|
-
});
|
|
1475
|
-
|
|
1476
|
-
// ../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/index.js
|
|
1477
|
-
var lib_exports2 = {};
|
|
1478
|
-
__export(lib_exports2, {
|
|
1479
|
-
DEFAULT_LANGUAGE_MAPPER: () => DEFAULT_LANGUAGE_MAPPER,
|
|
1480
|
-
base: () => base,
|
|
1481
|
-
cjsRequire: () => cjsRequire3,
|
|
1482
|
-
codeBlocks: () => codeBlocks,
|
|
1483
|
-
configs: () => configs,
|
|
1484
|
-
createRemarkProcessor: () => createRemarkProcessor,
|
|
1485
|
-
flat: () => flat,
|
|
1486
|
-
flatCodeBlocks: () => flatCodeBlocks,
|
|
1487
|
-
getGlobals: () => getGlobals,
|
|
1488
|
-
getShortLang: () => getShortLang,
|
|
1489
|
-
meta: () => meta2,
|
|
1490
|
-
overrides: () => overrides,
|
|
1491
|
-
processorOptions: () => processorOptions,
|
|
1492
|
-
processors: () => processors,
|
|
1493
|
-
recommended: () => recommended,
|
|
1494
|
-
remark: () => remark2,
|
|
1495
|
-
rules: () => rules
|
|
1496
|
-
});
|
|
1497
|
-
var init_lib4 = __esm({
|
|
1498
|
-
"../../node_modules/.pnpm/eslint-plugin-mdx@3.6.2_eslint@9.31.0_jiti@2.5.0_/node_modules/eslint-plugin-mdx/lib/index.js"() {
|
|
1499
|
-
"use strict";
|
|
1500
|
-
init_cjs_shims();
|
|
1501
|
-
init_configs();
|
|
1502
|
-
init_helpers4();
|
|
1503
|
-
init_meta2();
|
|
1504
|
-
init_processors();
|
|
1505
|
-
init_rules();
|
|
1506
|
-
}
|
|
1507
|
-
});
|
|
1508
|
-
|
|
1509
31
|
// src/index.ts
|
|
1510
32
|
var index_exports = {};
|
|
1511
33
|
__export(index_exports, {
|
|
@@ -1514,21 +36,12 @@ __export(index_exports, {
|
|
|
1514
36
|
icebreakerLegacy: () => icebreakerLegacy
|
|
1515
37
|
});
|
|
1516
38
|
module.exports = __toCommonJS(index_exports);
|
|
1517
|
-
init_cjs_shims();
|
|
1518
|
-
|
|
1519
|
-
// src/factory.ts
|
|
1520
|
-
init_cjs_shims();
|
|
1521
39
|
|
|
1522
40
|
// src/antfu.ts
|
|
1523
41
|
var antfu_exports = {};
|
|
1524
|
-
init_cjs_shims();
|
|
1525
42
|
__reExport(antfu_exports, require("@antfu/eslint-config"));
|
|
1526
43
|
|
|
1527
|
-
// src/preset.ts
|
|
1528
|
-
init_cjs_shims();
|
|
1529
|
-
|
|
1530
44
|
// ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
|
|
1531
|
-
init_cjs_shims();
|
|
1532
45
|
function isPlainObject(value) {
|
|
1533
46
|
if (value === null || typeof value !== "object") {
|
|
1534
47
|
return false;
|
|
@@ -1596,10 +109,7 @@ var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
|
1596
109
|
}
|
|
1597
110
|
});
|
|
1598
111
|
|
|
1599
|
-
//
|
|
1600
|
-
init_cjs_shims();
|
|
1601
|
-
|
|
1602
|
-
// ../../node_modules/.pnpm/eslint-plugin-vue@10.3.0_@typescript-eslint+parser@8.38.0_eslint@9.31.0_jiti@2.5.0__typ_18f7488c865a5db5b6fc51e3b183982d/node_modules/eslint-plugin-vue/lib/utils/inline-non-void-elements.json
|
|
112
|
+
// ../../node_modules/.pnpm/eslint-plugin-vue@10.3.0_@typescript-eslint+parser@8.38.0_eslint@9.32.0_jiti@2.5.1__typ_adc38c1d6e5abe2d3407348dc76767e2/node_modules/eslint-plugin-vue/lib/utils/inline-non-void-elements.json
|
|
1603
113
|
var inline_non_void_elements_default = [
|
|
1604
114
|
"a",
|
|
1605
115
|
"abbr",
|
|
@@ -1643,7 +153,7 @@ var inline_non_void_elements_default = [
|
|
|
1643
153
|
|
|
1644
154
|
// src/defaults.ts
|
|
1645
155
|
function getDefaultVueOptions(opts) {
|
|
1646
|
-
const
|
|
156
|
+
const overrides = {
|
|
1647
157
|
"vue/attribute-hyphenation": "off",
|
|
1648
158
|
"vue/v-on-event-hyphenation": "off",
|
|
1649
159
|
"vue/custom-event-name-casing": "off",
|
|
@@ -1663,10 +173,10 @@ function getDefaultVueOptions(opts) {
|
|
|
1663
173
|
"vue/no-unused-refs": "warn"
|
|
1664
174
|
};
|
|
1665
175
|
if (opts?.ionic) {
|
|
1666
|
-
|
|
176
|
+
overrides["vue/no-deprecated-slot-attribute"] = "off";
|
|
1667
177
|
}
|
|
1668
178
|
if (opts?.weapp) {
|
|
1669
|
-
|
|
179
|
+
overrides["vue/singleline-html-element-content-newline"] = [
|
|
1670
180
|
"warn",
|
|
1671
181
|
{
|
|
1672
182
|
ignoreWhenNoAttributes: true,
|
|
@@ -1681,12 +191,12 @@ function getDefaultVueOptions(opts) {
|
|
|
1681
191
|
];
|
|
1682
192
|
}
|
|
1683
193
|
const vueOptions = {
|
|
1684
|
-
overrides
|
|
194
|
+
overrides
|
|
1685
195
|
};
|
|
1686
196
|
return vueOptions;
|
|
1687
197
|
}
|
|
1688
198
|
function getDefaultTypescriptOptions(opts) {
|
|
1689
|
-
const
|
|
199
|
+
const overrides = {
|
|
1690
200
|
"ts/no-unused-vars": [
|
|
1691
201
|
"error",
|
|
1692
202
|
{
|
|
@@ -1711,7 +221,7 @@ function getDefaultTypescriptOptions(opts) {
|
|
|
1711
221
|
]
|
|
1712
222
|
};
|
|
1713
223
|
if (opts?.nest) {
|
|
1714
|
-
Object.assign(
|
|
224
|
+
Object.assign(overrides, {
|
|
1715
225
|
"ts/interface-name-prefix": "off",
|
|
1716
226
|
"ts/explicit-function-return-type": "off",
|
|
1717
227
|
"ts/explicit-module-boundary-types": "off",
|
|
@@ -1720,13 +230,12 @@ function getDefaultTypescriptOptions(opts) {
|
|
|
1720
230
|
});
|
|
1721
231
|
}
|
|
1722
232
|
const typescriptOptions = {
|
|
1723
|
-
overrides
|
|
233
|
+
overrides
|
|
1724
234
|
};
|
|
1725
235
|
return typescriptOptions;
|
|
1726
236
|
}
|
|
1727
237
|
|
|
1728
238
|
// src/utils.ts
|
|
1729
|
-
init_cjs_shims();
|
|
1730
239
|
function isObject(o) {
|
|
1731
240
|
return Object.prototype.toString.call(o) === "[object Object]";
|
|
1732
241
|
}
|
|
@@ -1738,11 +247,13 @@ function getPresets(options, mode) {
|
|
|
1738
247
|
javascript: {
|
|
1739
248
|
overrides: {
|
|
1740
249
|
"curly": ["error", "all"],
|
|
1741
|
-
"no-console": ["warn"]
|
|
250
|
+
"no-console": ["warn"]
|
|
1742
251
|
// 问题在于 auto fix 的时候,会直接 remove 整个 import ,而我们想让用户自己去 remove
|
|
1743
252
|
// 'unused-imports/no-unused-imports': 'error',
|
|
1744
253
|
// https://typescript-eslint.io/rules/no-unused-vars/
|
|
1745
|
-
|
|
254
|
+
// https://github.com/antfu/eslint-config/blob/main/src/configs/javascript.ts
|
|
255
|
+
// 'no-unused-vars': 'error',
|
|
256
|
+
// 'no-undef': 'error',
|
|
1746
257
|
// 'prefer-const': 'off',
|
|
1747
258
|
}
|
|
1748
259
|
}
|
|
@@ -1776,16 +287,16 @@ function getPresets(options, mode) {
|
|
|
1776
287
|
}
|
|
1777
288
|
if (enableVue) {
|
|
1778
289
|
if (typeof enableVue === "object") {
|
|
1779
|
-
const
|
|
1780
|
-
if (
|
|
290
|
+
const overrides = enableVue.overrides;
|
|
291
|
+
if (overrides) {
|
|
1781
292
|
if (enableVue.vueVersion === 2) {
|
|
1782
|
-
Object.assign(
|
|
293
|
+
Object.assign(overrides, {
|
|
1783
294
|
"vue/no-v-for-template-key-on-child": "off",
|
|
1784
295
|
"vue/no-v-for-template-key": "error",
|
|
1785
296
|
"vue/no-deprecated-v-bind-sync": "off"
|
|
1786
297
|
});
|
|
1787
298
|
} else {
|
|
1788
|
-
Object.assign(
|
|
299
|
+
Object.assign(overrides, {
|
|
1789
300
|
"vue/no-v-for-template-key-on-child": "error",
|
|
1790
301
|
"vue/no-v-for-template-key": "off"
|
|
1791
302
|
});
|
|
@@ -1814,7 +325,7 @@ function getPresets(options, mode) {
|
|
|
1814
325
|
});
|
|
1815
326
|
}
|
|
1816
327
|
if (enableMDX) {
|
|
1817
|
-
presets.push((0, antfu_exports.interopDefault)(
|
|
328
|
+
presets.push((0, antfu_exports.interopDefault)(import("eslint-plugin-mdx")).then((mdx) => {
|
|
1818
329
|
return [
|
|
1819
330
|
{
|
|
1820
331
|
...mdx.flat,
|