@borela-tech/eslint-config 2.4.2 → 2.5.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,4738 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
10
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
11
+ var __exportAll = (all, no_symbols) => {
12
+ let target = {};
13
+ for (var name in all) __defProp(target, name, {
14
+ get: all[name],
15
+ enumerable: true
16
+ });
17
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
18
+ return target;
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
22
+ key = keys[i];
23
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
24
+ get: ((k) => from[k]).bind(null, key),
25
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
26
+ });
27
+ }
28
+ return to;
29
+ };
30
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
31
+ value: mod,
32
+ enumerable: true
33
+ }) : target, mod));
34
+ var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
+ //#endregion
36
+ let _eslint_js = require("@eslint/js");
37
+ _eslint_js = __toESM(_eslint_js);
38
+ let eslint_plugin_react = require("eslint-plugin-react");
39
+ eslint_plugin_react = __toESM(eslint_plugin_react);
40
+ let _stylistic_eslint_plugin = require("@stylistic/eslint-plugin");
41
+ _stylistic_eslint_plugin = __toESM(_stylistic_eslint_plugin);
42
+ let typescript_eslint = require("typescript-eslint");
43
+ typescript_eslint = __toESM(typescript_eslint);
44
+ let path = require("path");
45
+ path = __toESM(path);
46
+ let eslint_plugin_perfectionist = require("eslint-plugin-perfectionist");
47
+ eslint_plugin_perfectionist = __toESM(eslint_plugin_perfectionist);
48
+ let eslint_plugin_react_hooks = require("eslint-plugin-react-hooks");
49
+ eslint_plugin_react_hooks = __toESM(eslint_plugin_react_hooks);
50
+ let eslint_plugin_unicorn = require("eslint-plugin-unicorn");
51
+ eslint_plugin_unicorn = __toESM(eslint_plugin_unicorn);
52
+ //#region src/rules/shared/getLineIndent.ts
53
+ function getLineIndent(sourceCode, line) {
54
+ return (sourceCode.getText().split("\n")[line - 1] ?? "").match(/^(\s*)/)?.[1] ?? "";
55
+ }
56
+ //#endregion
57
+ //#region src/rules/arrayItemsLineBreak/buildMultilineFix.ts
58
+ function buildMultilineFix$1(fixer, brackets, elements, sourceCode) {
59
+ const openingLine = brackets.openingBracket.loc.start.line;
60
+ const baseIndent = getLineIndent(sourceCode, openingLine);
61
+ const itemIndent = baseIndent + " ";
62
+ const newText = `\n${elements.filter((el) => el !== null).map((element) => {
63
+ return `${itemIndent}${sourceCode.getText(element)}`;
64
+ }).join(",\n")},\n${baseIndent}`;
65
+ return fixer.replaceTextRange([brackets.openingBracket.range[1], brackets.closingBracket.range[0]], newText);
66
+ }
67
+ //#endregion
68
+ //#region src/rules/arrayItemsLineBreak/defaultOptions.ts
69
+ var defaultOptions$6 = { maxLength: 80 };
70
+ //#endregion
71
+ //#region src/rules/arrayItemsLineBreak/getBrackets.ts
72
+ function getBrackets(sourceCode, node) {
73
+ const elements = node.elements;
74
+ if (elements.length === 0) return null;
75
+ const firstElement = elements.find((el) => el !== null);
76
+ if (!firstElement) return null;
77
+ const lastElement = [...elements].reverse().find((el) => el !== null);
78
+ if (!lastElement) return null;
79
+ const openingBracket = sourceCode.getTokenBefore(firstElement);
80
+ const closingBracket = sourceCode.getTokenAfter(lastElement);
81
+ if (!openingBracket || !closingBracket) return null;
82
+ if (openingBracket.value !== "[" || closingBracket.value !== "]") return null;
83
+ return {
84
+ closingBracket,
85
+ openingBracket
86
+ };
87
+ }
88
+ //#endregion
89
+ //#region src/rules/shared/getLineLength.ts
90
+ function getLineLength(sourceCode, lineNumber) {
91
+ return sourceCode.getLines()[lineNumber - 1]?.length ?? 0;
92
+ }
93
+ //#endregion
94
+ //#region src/rules/arrayItemsLineBreak/checkArray.ts
95
+ function checkArray(sourceCode, context, node) {
96
+ const maxLength = (context.options[0] ?? {}).maxLength ?? defaultOptions$6.maxLength;
97
+ const elements = node.elements;
98
+ if (elements.length <= 1) return;
99
+ const brackets = getBrackets(sourceCode, node);
100
+ if (!brackets) return;
101
+ const firstLine = brackets.openingBracket.loc.start.line;
102
+ if (firstLine !== brackets.closingBracket.loc.end.line) return;
103
+ if (getLineLength(sourceCode, firstLine) <= maxLength) return;
104
+ context.report({
105
+ fix: (fixer) => buildMultilineFix$1(fixer, brackets, elements, sourceCode),
106
+ messageId: "arrayItemsOnNewLine",
107
+ node: elements[0]
108
+ });
109
+ }
110
+ //#endregion
111
+ //#region src/rules/arrayItemsLineBreak/index.ts
112
+ var arrayItemsLineBreak = {
113
+ create(context) {
114
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
115
+ return { ArrayExpression(node) {
116
+ checkArray(sourceCode, context, node);
117
+ } };
118
+ },
119
+ meta: {
120
+ docs: { description: "Enforce each array item to be on its own line when the array expression exceeds a configurable maximum line length." },
121
+ fixable: "code",
122
+ messages: { arrayItemsOnNewLine: "arrayItemsOnNewLine" },
123
+ schema: [{
124
+ additionalProperties: false,
125
+ properties: { maxLength: { type: "number" } },
126
+ type: "object"
127
+ }],
128
+ type: "layout"
129
+ }
130
+ };
131
+ //#endregion
132
+ //#region src/rules/braceStyleControlStatements/getIndentation.ts
133
+ function getIndentation(node, sourceCode) {
134
+ const tokenBeforeBody = sourceCode.getTokenBefore(node);
135
+ if (!tokenBeforeBody) return "";
136
+ const line = sourceCode.getText().split("\n")[tokenBeforeBody.loc.start.line - 1];
137
+ if (!line) return "";
138
+ return line.match(/^(\s*)/)?.[1] ?? "";
139
+ }
140
+ //#endregion
141
+ //#region src/rules/braceStyleControlStatements/createBraceStyleFix.ts
142
+ function createBraceStyleFix(fixer, body, sourceCode) {
143
+ if (body.type === "BlockStatement") {
144
+ const firstToken = sourceCode.getFirstToken(body);
145
+ if (!firstToken) return null;
146
+ return fixer.insertTextBefore(firstToken, "\n");
147
+ }
148
+ const bodyText = sourceCode.getText(body);
149
+ const indentation = getIndentation(body, sourceCode);
150
+ const fixedText = `{\n${indentation} ${bodyText}\n${indentation}}`;
151
+ return fixer.replaceText(body, fixedText);
152
+ }
153
+ //#endregion
154
+ //#region src/rules/braceStyleControlStatements/isOnSameLineAsCondition.ts
155
+ function isOnSameLineAsCondition(node, sourceCode) {
156
+ const tokenBeforeBody = sourceCode.getTokenBefore(node);
157
+ if (!tokenBeforeBody) return false;
158
+ const firstToken = sourceCode.getFirstToken(node);
159
+ if (!firstToken) return false;
160
+ return tokenBeforeBody.loc.end.line === firstToken.loc.start.line;
161
+ }
162
+ //#endregion
163
+ //#region src/rules/shared/isSingleLineStatement.ts
164
+ function isSingleLineStatement(node, sourceCode) {
165
+ const firstToken = sourceCode.getFirstToken(node);
166
+ const lastToken = sourceCode.getLastToken(node);
167
+ if (!firstToken || !lastToken) return false;
168
+ return firstToken.loc.start.line === lastToken.loc.end.line;
169
+ }
170
+ //#endregion
171
+ //#region src/rules/braceStyleControlStatements/reportBodyOnSameLineAsCondition.ts
172
+ function reportBodyOnSameLineAsCondition(context, body) {
173
+ const sourceCode = context.sourceCode;
174
+ if (body.type !== "BlockStatement") {
175
+ if (isOnSameLineAsCondition(body, sourceCode)) context.report({
176
+ fix: (fixer) => createBraceStyleFix(fixer, body, sourceCode),
177
+ messageId: "singleLine",
178
+ node: body
179
+ });
180
+ } else {
181
+ const isOnSameLine = isOnSameLineAsCondition(body, sourceCode);
182
+ const isSingleLine = isSingleLineStatement(body, sourceCode);
183
+ if (isOnSameLine && isSingleLine) context.report({
184
+ fix: (fixer) => createBraceStyleFix(fixer, body, sourceCode),
185
+ messageId: "singleLine",
186
+ node: body
187
+ });
188
+ }
189
+ }
190
+ //#endregion
191
+ //#region src/rules/braceStyleControlStatements/checkDoWhileStatementBraceStyle.ts
192
+ function checkDoWhileStatementBraceStyle(node, context) {
193
+ reportBodyOnSameLineAsCondition(context, node.body);
194
+ }
195
+ //#endregion
196
+ //#region src/rules/braceStyleControlStatements/checkForStatementBraceStyle.ts
197
+ function checkForStatementBraceStyle(node, context) {
198
+ reportBodyOnSameLineAsCondition(context, node.body);
199
+ }
200
+ //#endregion
201
+ //#region src/rules/braceStyleControlStatements/checkIfStatementBraceStyle.ts
202
+ function checkIfStatementBraceStyle(node, context) {
203
+ const sourceCode = context.sourceCode;
204
+ reportBodyOnSameLineAsCondition(context, node.consequent);
205
+ if (!node.alternate) return;
206
+ if (node.alternate.type === "BlockStatement") {
207
+ reportBodyOnSameLineAsCondition(context, node.alternate);
208
+ return;
209
+ }
210
+ if (node.alternate.type !== "IfStatement") {
211
+ const alternate = node.alternate;
212
+ if (isOnSameLineAsCondition(alternate, sourceCode)) context.report({
213
+ fix: (fixer) => createBraceStyleFix(fixer, alternate, sourceCode),
214
+ messageId: "singleLine",
215
+ node: alternate
216
+ });
217
+ }
218
+ }
219
+ //#endregion
220
+ //#region src/rules/braceStyleControlStatements/checkWhileStatementBraceStyle.ts
221
+ function checkWhileStatementBraceStyle(node, context) {
222
+ reportBodyOnSameLineAsCondition(context, node.body);
223
+ }
224
+ //#endregion
225
+ //#region src/rules/braceStyleControlStatements/index.ts
226
+ var braceStyleControlStatements = {
227
+ create(context) {
228
+ return {
229
+ DoWhileStatement: (node) => checkDoWhileStatementBraceStyle(node, context),
230
+ ForStatement: (node) => checkForStatementBraceStyle(node, context),
231
+ IfStatement: (node) => checkIfStatementBraceStyle(node, context),
232
+ WhileStatement: (node) => checkWhileStatementBraceStyle(node, context)
233
+ };
234
+ },
235
+ meta: {
236
+ docs: { description: "Enforce control statements to have multi-line body." },
237
+ fixable: "code",
238
+ messages: { singleLine: "Control statement body must be on a separate line" },
239
+ schema: [],
240
+ type: "layout"
241
+ }
242
+ };
243
+ //#endregion
244
+ //#region src/rules/braceStyleObjectLiteral/checkClosingBrace.ts
245
+ function checkClosingBrace(sourceCode, context, node, closingBrace) {
246
+ const lastProperty = node.properties[node.properties.length - 1];
247
+ const closingLine = closingBrace.loc.end.line;
248
+ if (!(lastProperty.loc.end.line < closingLine)) context.report({
249
+ fix(fixer) {
250
+ return fixer.replaceTextRange([lastProperty.range[1], closingBrace.range[0]], ",\n" + getLineIndent(sourceCode, lastProperty.loc.end.line));
251
+ },
252
+ loc: closingBrace.loc,
253
+ messageId: "braceOnPropertyLine"
254
+ });
255
+ }
256
+ //#endregion
257
+ //#region src/rules/braceStyleObjectLiteral/checkNestedObjects.ts
258
+ function checkNestedObjects(sourceCode, context, node, checkObjectExpression) {
259
+ for (const property of node.properties) if (property.type === "Property" && property.value.type === "ObjectExpression") checkObjectExpression(sourceCode, context, property.value);
260
+ else if (property.type === "SpreadElement" && property.argument.type === "ObjectExpression") checkObjectExpression(sourceCode, context, property.argument);
261
+ }
262
+ //#endregion
263
+ //#region src/rules/braceStyleObjectLiteral/checkOpeningBrace.ts
264
+ function checkOpeningBrace(sourceCode, context, node, openingBrace) {
265
+ const firstProperty = node.properties[0];
266
+ const openingLine = openingBrace.loc.start.line;
267
+ if (!(firstProperty.loc.start.line > openingLine)) context.report({
268
+ fix(fixer) {
269
+ return fixer.replaceTextRange([openingBrace.range[1], firstProperty.range[0]], "\n" + getLineIndent(sourceCode, firstProperty.loc.start.line));
270
+ },
271
+ loc: openingBrace.loc,
272
+ messageId: "braceOnPropertyLine"
273
+ });
274
+ }
275
+ //#endregion
276
+ //#region src/rules/braceStyleObjectLiteral/checkPropertyOnOwnLine.ts
277
+ function checkPropertyOnOwnLine(sourceCode, context, prevPropertyEndLine, property) {
278
+ if (property.loc.start.line === prevPropertyEndLine) context.report({
279
+ fix(fixer) {
280
+ const lastNewLineIndex = sourceCode.getText().lastIndexOf("\n", property.range[0] - 1);
281
+ return fixer.replaceTextRange([lastNewLineIndex, property.range[0]], "\n" + getLineIndent(sourceCode, property.loc.start.line));
282
+ },
283
+ loc: property.loc,
284
+ messageId: "propertiesOnSameLine"
285
+ });
286
+ }
287
+ //#endregion
288
+ //#region src/rules/braceStyleObjectLiteral/checkObjectExpression.ts
289
+ function checkObjectExpression(sourceCode, context, node) {
290
+ if (node.properties.length === 0) return;
291
+ const openingBrace = sourceCode.getFirstToken(node);
292
+ const closingBrace = sourceCode.getLastToken(node);
293
+ if (!openingBrace || !closingBrace) return;
294
+ if (openingBrace.loc.start.line === closingBrace.loc.end.line) return;
295
+ checkOpeningBrace(sourceCode, context, node, openingBrace);
296
+ let prevPropertyEndLine = node.properties[0].loc.start.line;
297
+ for (const property of node.properties) {
298
+ if (property !== node.properties[0]) checkPropertyOnOwnLine(sourceCode, context, prevPropertyEndLine, property);
299
+ prevPropertyEndLine = property.loc.end.line;
300
+ }
301
+ checkClosingBrace(sourceCode, context, node, closingBrace);
302
+ checkNestedObjects(sourceCode, context, node, checkObjectExpression);
303
+ }
304
+ //#endregion
305
+ //#region src/rules/braceStyleObjectLiteral/index.ts
306
+ var braceStyleObjectLiteral = {
307
+ create(context) {
308
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
309
+ return { ObjectExpression(node) {
310
+ checkObjectExpression(sourceCode, context, node);
311
+ } };
312
+ },
313
+ meta: {
314
+ docs: { description: "Enforce consistent brace positioning for object literals." },
315
+ fixable: "code",
316
+ messages: {
317
+ braceOnPropertyLine: "Opening brace should be on its own line",
318
+ propertiesOnSameLine: "Multi-line objects must have each property on its own line"
319
+ },
320
+ schema: [{
321
+ additionalProperties: false,
322
+ properties: {},
323
+ type: "object"
324
+ }],
325
+ type: "layout"
326
+ }
327
+ };
328
+ //#endregion
329
+ //#region src/rules/compactArrayItems/buildCompactFix.ts
330
+ function buildCompactFix(fixer, openingBracket, closingBracket, elements, sourceCode) {
331
+ const newText = `[${elements.filter((el) => el !== null).map((element) => sourceCode.getText(element)).join(", ")}]`;
332
+ return fixer.replaceTextRange([openingBracket.range[0], closingBracket.range[1]], newText);
333
+ }
334
+ //#endregion
335
+ //#region src/rules/compactArrayItems/findBracketByRange.ts
336
+ function findBracketByRange(tokens, range, value) {
337
+ return tokens?.find((t) => t.range[0] === range[0] && t.value === value);
338
+ }
339
+ //#endregion
340
+ //#region src/rules/compactArrayItems/findClosingBracketByRange.ts
341
+ function findClosingBracketByRange(tokens, range) {
342
+ return tokens?.find((t) => t.range[1] === range[1] && t.value === "]");
343
+ }
344
+ //#endregion
345
+ //#region src/rules/compactArrayItems/hasElements.ts
346
+ function hasElements(elements) {
347
+ return elements.filter((el) => el !== null).length >= 1;
348
+ }
349
+ //#endregion
350
+ //#region src/rules/compactArrayItems/hasMultilineItems.ts
351
+ function hasMultilineItems(nonNullElements) {
352
+ return nonNullElements.some((el) => el.loc.start.line !== el.loc.end.line);
353
+ }
354
+ //#endregion
355
+ //#region src/rules/compactArrayItems/isBracketOnOwnLine.ts
356
+ function isBracketOnOwnLine(sourceCode, openingBracket) {
357
+ const nextToken = sourceCode.getTokenAfter(openingBracket, { includeComments: false });
358
+ if (!nextToken) return false;
359
+ const text = sourceCode.getText();
360
+ const openingBracketEndIndex = openingBracket.range[1];
361
+ return text.slice(openingBracketEndIndex, nextToken.range[0]).includes("\n");
362
+ }
363
+ //#endregion
364
+ //#region src/rules/compactArrayItems/index.ts
365
+ var compactArrayItems = {
366
+ create(context) {
367
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
368
+ return { ArrayExpression(node) {
369
+ if (!hasElements(node.elements)) return;
370
+ const tokens = sourceCode.ast.tokens;
371
+ const openingBracket = findBracketByRange(tokens, node.range, "[");
372
+ const closingBracket = findClosingBracketByRange(tokens, node.range);
373
+ if (!openingBracket || !closingBracket) return;
374
+ if (!isBracketOnOwnLine(sourceCode, openingBracket)) return;
375
+ if (!hasMultilineItems(node.elements.filter((el) => el !== null))) return;
376
+ context.report({
377
+ fix: (fixer) => buildCompactFix(fixer, openingBracket, closingBracket, node.elements, sourceCode),
378
+ messageId: "compactItems",
379
+ node
380
+ });
381
+ } };
382
+ },
383
+ meta: {
384
+ docs: { description: "Enforce arrays with multiline items to have a compact, inline bracket style." },
385
+ fixable: "code",
386
+ messages: { compactItems: "Array items should be compact when the array spans multiple lines." },
387
+ schema: [],
388
+ type: "layout"
389
+ }
390
+ };
391
+ //#endregion
392
+ //#region src/rules/exportFilenameMatch/getNameFromDeclaration.ts
393
+ function getNameFromDeclaration(node) {
394
+ const names = [];
395
+ switch (node.type) {
396
+ case "ClassDeclaration":
397
+ if (node.id) names.push(node.id.name);
398
+ break;
399
+ case "FunctionDeclaration":
400
+ if (node.id) names.push(node.id.name);
401
+ break;
402
+ case "TSInterfaceDeclaration":
403
+ names.push(node.id.name);
404
+ break;
405
+ case "TSTypeAliasDeclaration":
406
+ names.push(node.id.name);
407
+ break;
408
+ case "VariableDeclaration":
409
+ for (const d of node.declarations) if (d.id.type === "Identifier") names.push(d.id.name);
410
+ break;
411
+ }
412
+ return names;
413
+ }
414
+ //#endregion
415
+ //#region src/rules/exportFilenameMatch/getNamesFromSpecifiers.ts
416
+ function getNamesFromSpecifiers(node) {
417
+ if (!node.specifiers?.length) return [];
418
+ const names = [];
419
+ for (const specifier of node.specifiers) if (specifier.exported.type === "Identifier") names.push(specifier.exported.name);
420
+ return names;
421
+ }
422
+ //#endregion
423
+ //#region src/rules/exportFilenameMatch/getExportedNames.ts
424
+ function getExportedNames(node) {
425
+ const specifierNames = getNamesFromSpecifiers(node);
426
+ if (!node.declaration) return specifierNames;
427
+ const declarationNames = getNameFromDeclaration(node.declaration);
428
+ return [...specifierNames, ...declarationNames];
429
+ }
430
+ //#endregion
431
+ //#region src/rules/shared/stripExtension.ts
432
+ function stripExtension(filename) {
433
+ return path.basename(filename, path.extname(filename));
434
+ }
435
+ //#endregion
436
+ //#region src/rules/shared/isExempt.ts
437
+ function isExempt$2(filename) {
438
+ const name = stripExtension(filename);
439
+ return name === "index" || name.endsWith(".test") || name.endsWith(".spec") || name.endsWith(".config");
440
+ }
441
+ //#endregion
442
+ //#region src/rules/exportFilenameMatch/index.ts
443
+ var exportFilenameMatch = {
444
+ create(context) {
445
+ const fileName = context.filename;
446
+ const baseName = path.basename(fileName);
447
+ const ext = path.extname(baseName);
448
+ const fileNameWithoutExt = baseName.slice(0, -ext.length);
449
+ if (isExempt$2(fileName)) return {};
450
+ const exportNames = [];
451
+ return {
452
+ ExportNamedDeclaration(node) {
453
+ const names = getExportedNames(node);
454
+ exportNames.push(...names);
455
+ },
456
+ "Program:exit"(programNode) {
457
+ if (exportNames.length === 1) {
458
+ const [exportName] = exportNames;
459
+ if (exportName !== fileNameWithoutExt) context.report({
460
+ data: {
461
+ currentName: `${fileNameWithoutExt}${ext}`,
462
+ expectedName: `${exportName}${ext}`
463
+ },
464
+ messageId: "filenameMismatch",
465
+ node: programNode
466
+ });
467
+ }
468
+ }
469
+ };
470
+ },
471
+ meta: {
472
+ docs: { description: "Enforce filename matches the single named export." },
473
+ messages: { filenameMismatch: "File name must be '{{expectedName}}' instead of '{{currentName}}'." },
474
+ schema: [],
475
+ type: "suggestion"
476
+ }
477
+ };
478
+ //#endregion
479
+ //#region src/rules/shared/findLinesWithMultipleNodes.ts
480
+ function findLinesWithMultipleNodes(nodes) {
481
+ const lines = [];
482
+ for (let i = 0; i < nodes.length; i++) {
483
+ const nodeLine = nodes[i].loc.start.line;
484
+ if (i < nodes.length - 1) {
485
+ if (nodes[i + 1].loc.start.line === nodeLine) lines.push(nodeLine);
486
+ }
487
+ }
488
+ return lines;
489
+ }
490
+ //#endregion
491
+ //#region src/rules/functionCallArgumentLineBreak/formatArgs.ts
492
+ function formatArgs(sourceCode, nodes, indent) {
493
+ return nodes.map((arg, index) => {
494
+ const argText = sourceCode.getText(arg);
495
+ if (index === nodes.length - 1) return argText;
496
+ const comma = sourceCode.getTokenAfter(arg, (token) => token.value === ",");
497
+ if (comma && comma.loc.end.line === arg.loc.end.line) return argText + ",";
498
+ return argText;
499
+ }).map((text, index) => index === 0 ? `${indent}${text}` : `\n${indent}${text}`).join("");
500
+ }
501
+ //#endregion
502
+ //#region src/rules/shared/getLineStartIndex.ts
503
+ function getLineStartIndex(sourceCode, line) {
504
+ return sourceCode.getLines().slice(0, line - 1).reduce((acc, l) => acc + l.length + 1, 0);
505
+ }
506
+ //#endregion
507
+ //#region src/rules/functionCallArgumentLineBreak/checkMultilineArgs.ts
508
+ function checkMultilineArgs(sourceCode, context, args, maxLength) {
509
+ const linesWithMultipleArgs = findLinesWithMultipleNodes(args);
510
+ for (const line of linesWithMultipleArgs) {
511
+ const lineLength = getLineLength(sourceCode, line);
512
+ if (lineLength > maxLength) context.report({
513
+ data: { maxLength },
514
+ fix: (fixer) => {
515
+ const nodesOnLine = args.filter((arg) => arg.loc.start.line <= line && arg.loc.end.line >= line);
516
+ const lastNode = nodesOnLine[nodesOnLine.length - 1];
517
+ const lineStartIndex = getLineStartIndex(sourceCode, line);
518
+ const fixed = formatArgs(sourceCode, nodesOnLine, (sourceCode.getText().match(/^[\t ]*/)?.[0] ?? "") + " ");
519
+ return fixer.replaceTextRange([lineStartIndex, lastNode.range[1]], fixed);
520
+ },
521
+ loc: {
522
+ end: {
523
+ column: lineLength,
524
+ line
525
+ },
526
+ start: {
527
+ column: 0,
528
+ line
529
+ }
530
+ },
531
+ messageId: "multipleOnSameLine"
532
+ });
533
+ }
534
+ }
535
+ //#endregion
536
+ //#region src/rules/functionCallArgumentLineBreak/checkSingleLineArgs.ts
537
+ function checkSingleLineArgs(sourceCode, context, args, parens, maxLength) {
538
+ const { closingParen, openingParen } = parens;
539
+ const lineLength = getLineLength(sourceCode, openingParen.loc.start.line);
540
+ if (lineLength <= maxLength) return;
541
+ if (args.length === 1) {
542
+ context.report({
543
+ data: { maxLength },
544
+ loc: {
545
+ end: {
546
+ column: lineLength,
547
+ line: closingParen.loc.end.line
548
+ },
549
+ start: {
550
+ column: 0,
551
+ line: openingParen.loc.start.line
552
+ }
553
+ },
554
+ messageId: "exceedsMaxLength"
555
+ });
556
+ return;
557
+ }
558
+ context.report({
559
+ data: { maxLength },
560
+ fix: (fixer) => {
561
+ const indent = sourceCode.getText().match(/^[\t ]*/)?.[0] ?? "";
562
+ const fixed = [
563
+ "(\n",
564
+ `${indent} ${args.map((arg) => {
565
+ const argText = sourceCode.getText(arg);
566
+ const comma = sourceCode.getTokenAfter(arg, (token) => token.value === ",");
567
+ if (comma && comma.loc.end.line === arg.loc.end.line) return argText + ",";
568
+ return argText;
569
+ }).join(`\n${indent} `)}\n`,
570
+ `${indent})`
571
+ ].join("");
572
+ return fixer.replaceTextRange([openingParen.range[0], closingParen.range[1]], fixed);
573
+ },
574
+ loc: {
575
+ end: {
576
+ column: lineLength,
577
+ line: closingParen.loc.end.line
578
+ },
579
+ start: {
580
+ column: 0,
581
+ line: openingParen.loc.start.line
582
+ }
583
+ },
584
+ messageId: "multipleOnSameLine"
585
+ });
586
+ }
587
+ //#endregion
588
+ //#region src/rules/functionCallArgumentLineBreak/defaultOptions.ts
589
+ var defaultOptions$5 = { maxLength: 80 };
590
+ //#endregion
591
+ //#region src/rules/shared/getParens.ts
592
+ function getParens$1(sourceCode, nodes) {
593
+ if (nodes.length === 0) return null;
594
+ const firstNode = nodes[0];
595
+ const lastNode = nodes[nodes.length - 1];
596
+ const openingParen = sourceCode.getTokenBefore(firstNode);
597
+ const closingParen = sourceCode.getTokenAfter(lastNode);
598
+ if (!openingParen || !closingParen) return null;
599
+ return {
600
+ closingParen,
601
+ openingParen
602
+ };
603
+ }
604
+ //#endregion
605
+ //#region src/rules/shared/isValidParens.ts
606
+ function isValidParens(parens) {
607
+ if (!parens) return false;
608
+ return parens.openingParen.value === "(" && parens.closingParen.value === ")";
609
+ }
610
+ //#endregion
611
+ //#region src/rules/functionCallArgumentLineBreak/checkCall.ts
612
+ function checkCall(sourceCode, context, node) {
613
+ const maxLength = (context.options[0] ?? {}).maxLength ?? defaultOptions$5.maxLength;
614
+ const args = node.arguments;
615
+ const parens = getParens$1(sourceCode, args);
616
+ if (!isValidParens(parens)) return;
617
+ if (parens.openingParen.loc.start.line === parens.closingParen.loc.end.line) checkSingleLineArgs(sourceCode, context, args, parens, maxLength);
618
+ else checkMultilineArgs(sourceCode, context, args, maxLength);
619
+ }
620
+ //#endregion
621
+ //#region src/rules/functionCallArgumentLineBreak/index.ts
622
+ var functionCallArgumentLineBreak = {
623
+ create(context) {
624
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
625
+ return {
626
+ CallExpression(node) {
627
+ checkCall(sourceCode, context, node);
628
+ },
629
+ OptionalCallExpression(node) {
630
+ checkCall(sourceCode, context, node);
631
+ }
632
+ };
633
+ },
634
+ meta: {
635
+ docs: { description: "Enforce each function call argument to be on its own line when line exceeds max length." },
636
+ fixable: "code",
637
+ messages: {
638
+ exceedsMaxLength: "Refactor this function call as it exceeds {{maxLength}} characters",
639
+ multipleOnSameLine: "Each argument must be on its own line"
640
+ },
641
+ schema: [{
642
+ additionalProperties: false,
643
+ properties: { maxLength: { type: "number" } },
644
+ type: "object"
645
+ }],
646
+ type: "layout"
647
+ }
648
+ };
649
+ //#endregion
650
+ //#region src/rules/functionCognitiveComplexity/isNodeWithType.ts
651
+ function isNodeWithType(value) {
652
+ return value !== null && typeof value === "object" && "type" in value;
653
+ }
654
+ //#endregion
655
+ //#region src/rules/functionCognitiveComplexity/getChildNodes.ts
656
+ var SKIP_KEYS = new Set([
657
+ "loc",
658
+ "parent",
659
+ "range"
660
+ ]);
661
+ function getChildNodes(node) {
662
+ const children = [];
663
+ for (const key of Object.keys(node)) {
664
+ if (SKIP_KEYS.has(key)) continue;
665
+ const value = node[key];
666
+ if (Array.isArray(value)) {
667
+ for (const item of value) if (isNodeWithType(item)) children.push(item);
668
+ } else if (isNodeWithType(value)) children.push(value);
669
+ }
670
+ return children;
671
+ }
672
+ //#endregion
673
+ //#region src/rules/functionCognitiveComplexity/isIncrementableControlFlow.ts
674
+ var INCREMENTABLE_TYPES = new Set([
675
+ "ConditionalExpression",
676
+ "DoWhileStatement",
677
+ "ForInStatement",
678
+ "ForOfStatement",
679
+ "ForStatement",
680
+ "IfStatement",
681
+ "LogicalExpression",
682
+ "SwitchStatement",
683
+ "TryStatement",
684
+ "WhileStatement"
685
+ ]);
686
+ function isIncrementableControlFlow(node) {
687
+ return INCREMENTABLE_TYPES.has(node.type);
688
+ }
689
+ //#endregion
690
+ //#region src/rules/functionCognitiveComplexity/traverse.ts
691
+ function traverse(node, nestingLevel, state) {
692
+ if (isIncrementableControlFlow(node)) {
693
+ state.complexity += 1 + nestingLevel;
694
+ nestingLevel++;
695
+ }
696
+ const children = getChildNodes(node);
697
+ for (const child of children) traverse(child, nestingLevel, state);
698
+ }
699
+ //#endregion
700
+ //#region src/rules/functionCognitiveComplexity/calculateCognitiveComplexity.ts
701
+ function calculateCognitiveComplexity(node) {
702
+ const state = {
703
+ complexity: 0,
704
+ nestingLevel: 0
705
+ };
706
+ const children = getChildNodes(node);
707
+ for (const child of children) traverse(child, 0, state);
708
+ return state.complexity;
709
+ }
710
+ //#endregion
711
+ //#region src/rules/functionCognitiveComplexity/getNameFromCallExpression.ts
712
+ function getNameFromCallExpression(node) {
713
+ if (node?.type === "CallExpression" && node.callee?.type === "Identifier") return `${node.callee.name} callback`;
714
+ return null;
715
+ }
716
+ //#endregion
717
+ //#region src/rules/functionCognitiveComplexity/getNameFromProperty.ts
718
+ function getNameFromProperty(node) {
719
+ if (node?.type === "Property" && node.key?.type === "Identifier") return node.key.name;
720
+ return null;
721
+ }
722
+ //#endregion
723
+ //#region src/rules/functionCognitiveComplexity/getNameFromVariableDeclarator.ts
724
+ function getNameFromVariableDeclarator(node) {
725
+ if (node?.type === "VariableDeclarator" && node.id?.type === "Identifier") return node.id.name;
726
+ return null;
727
+ }
728
+ //#endregion
729
+ //#region src/rules/functionCognitiveComplexity/getArrowFunctionExpressionName.ts
730
+ function getArrowFunctionExpressionName(node) {
731
+ const parent = node.parent;
732
+ const nameFromVar = getNameFromVariableDeclarator(parent);
733
+ if (nameFromVar) return nameFromVar;
734
+ const nameFromProp = getNameFromProperty(parent);
735
+ if (nameFromProp) return nameFromProp;
736
+ const nameFromCall = getNameFromCallExpression(parent);
737
+ if (nameFromCall) return nameFromCall;
738
+ return null;
739
+ }
740
+ //#endregion
741
+ //#region src/rules/functionCognitiveComplexity/getNameFromMethodDefinition.ts
742
+ function getNameFromMethodDefinition(node) {
743
+ if (node?.type === "MethodDefinition" && node.key?.type === "Identifier") return node.key.name;
744
+ return null;
745
+ }
746
+ //#endregion
747
+ //#region src/rules/functionCognitiveComplexity/getFunctionExpressionName.ts
748
+ function getFunctionExpressionName(node) {
749
+ const parent = node.parent;
750
+ const nameFromVar = getNameFromVariableDeclarator(parent);
751
+ if (nameFromVar) return nameFromVar;
752
+ const nameFromProp = getNameFromProperty(parent);
753
+ if (nameFromProp) return nameFromProp;
754
+ const nameFromMethod = getNameFromMethodDefinition(parent);
755
+ if (nameFromMethod) return nameFromMethod;
756
+ return null;
757
+ }
758
+ //#endregion
759
+ //#region src/rules/functionCognitiveComplexity/getFunctionName.ts
760
+ function getFunctionName$1(node) {
761
+ if (node.type === "FunctionDeclaration" && node.id?.name) return node.id.name;
762
+ if (node.type === "FunctionExpression") return getFunctionExpressionName(node);
763
+ if (node.type === "ArrowFunctionExpression") return getArrowFunctionExpressionName(node);
764
+ return null;
765
+ }
766
+ //#endregion
767
+ //#region src/rules/functionCognitiveComplexity/messageIds.ts
768
+ var messageIds$8 = {
769
+ tooHighCognitiveComplexity: "Function '{{name}}' has cognitive complexity of {{actual}} (max: {{max}}). Consider extracting sub-functions.",
770
+ tooHighCognitiveComplexityAnonymous: "Anonymous function has cognitive complexity of {{actual}} (max: {{max}}). Consider extracting sub-functions."
771
+ };
772
+ //#endregion
773
+ //#region src/rules/functionCognitiveComplexity/index.ts
774
+ var DEFAULT_MAX_COGNITIVE_COMPLEXITY = 15;
775
+ var functionCognitiveComplexity = {
776
+ create(context) {
777
+ const maxCognitiveComplexity = (context.options[0] ?? {}).maxCognitiveComplexity ?? DEFAULT_MAX_COGNITIVE_COMPLEXITY;
778
+ function checkFunction(node) {
779
+ const complexity = calculateCognitiveComplexity(node);
780
+ if (complexity > maxCognitiveComplexity) {
781
+ const name = getFunctionName$1(node);
782
+ if (name) context.report({
783
+ data: {
784
+ actual: complexity,
785
+ max: maxCognitiveComplexity,
786
+ name
787
+ },
788
+ messageId: "tooHighCognitiveComplexity",
789
+ node
790
+ });
791
+ else context.report({
792
+ data: {
793
+ actual: complexity,
794
+ max: maxCognitiveComplexity
795
+ },
796
+ messageId: "tooHighCognitiveComplexityAnonymous",
797
+ node
798
+ });
799
+ }
800
+ }
801
+ return {
802
+ ArrowFunctionExpression(node) {
803
+ checkFunction(node);
804
+ },
805
+ FunctionDeclaration(node) {
806
+ checkFunction(node);
807
+ },
808
+ FunctionExpression(node) {
809
+ checkFunction(node);
810
+ }
811
+ };
812
+ },
813
+ meta: {
814
+ docs: { description: "Enforce cognitive complexity threshold for functions." },
815
+ messages: messageIds$8,
816
+ schema: [{
817
+ additionalProperties: false,
818
+ properties: { maxCognitiveComplexity: { type: "number" } },
819
+ type: "object"
820
+ }],
821
+ type: "suggestion"
822
+ }
823
+ };
824
+ //#endregion
825
+ //#region src/rules/functionParameterLineBreak/formatParams.ts
826
+ function formatParams(sourceCode, nodes, indent) {
827
+ return nodes.map((param, index) => {
828
+ const paramText = sourceCode.getText(param);
829
+ if (index === nodes.length - 1) return paramText;
830
+ const comma = sourceCode.getTokenAfter(param, (token) => token.value === ",");
831
+ if (comma && comma.loc.end.line === param.loc.end.line) return paramText + ",";
832
+ return paramText;
833
+ }).map((text, index) => index === 0 ? `${indent}${text}` : `\n${indent}${text}`).join("");
834
+ }
835
+ //#endregion
836
+ //#region src/rules/functionParameterLineBreak/checkMultilineParams.ts
837
+ function checkMultilineParams(sourceCode, context, params, parens, maxLength) {
838
+ const linesWithMultipleParams = findLinesWithMultipleNodes(params);
839
+ for (const line of linesWithMultipleParams) {
840
+ const lineLength = getLineLength(sourceCode, line);
841
+ if (lineLength > maxLength) context.report({
842
+ data: { maxLength },
843
+ fix: (fixer) => {
844
+ const nodesOnLine = params.filter((param) => param.loc.start.line <= line && param.loc.end.line >= line);
845
+ const lastNode = nodesOnLine[nodesOnLine.length - 1];
846
+ const lineStartIndex = getLineStartIndex(sourceCode, line);
847
+ const fixed = formatParams(sourceCode, nodesOnLine, (sourceCode.getText().match(/^[\t ]*/)?.[0] ?? "") + " ");
848
+ return fixer.replaceTextRange([lineStartIndex, lastNode.range[1]], fixed);
849
+ },
850
+ loc: {
851
+ end: {
852
+ column: lineLength,
853
+ line
854
+ },
855
+ start: {
856
+ column: 0,
857
+ line
858
+ }
859
+ },
860
+ messageId: "multipleOnSameLine"
861
+ });
862
+ }
863
+ }
864
+ //#endregion
865
+ //#region src/rules/functionParameterLineBreak/checkSingleLineParams.ts
866
+ function checkSingleLineParams(sourceCode, context, params, parens, maxLength) {
867
+ const { closingParen, openingParen } = parens;
868
+ const lineLength = getLineLength(sourceCode, openingParen.loc.start.line);
869
+ if (lineLength <= maxLength) return;
870
+ if (params.length === 1) {
871
+ context.report({
872
+ data: { maxLength },
873
+ loc: {
874
+ end: {
875
+ column: lineLength,
876
+ line: closingParen.loc.end.line
877
+ },
878
+ start: {
879
+ column: 0,
880
+ line: openingParen.loc.start.line
881
+ }
882
+ },
883
+ messageId: "exceedsMaxLength"
884
+ });
885
+ return;
886
+ }
887
+ context.report({
888
+ data: { maxLength },
889
+ fix: (fixer) => {
890
+ const indent = sourceCode.getText().match(/^[\t ]*/)?.[0] ?? "";
891
+ const fixed = [
892
+ "(\n",
893
+ `${indent} ${params.map((param) => {
894
+ const paramText = sourceCode.getText(param);
895
+ const comma = sourceCode.getTokenAfter(param, (token) => token.value === ",");
896
+ if (comma && comma.loc.end.line === param.loc.end.line) return paramText + ",";
897
+ return paramText;
898
+ }).join(`\n${indent} `)}\n`,
899
+ `${indent})`
900
+ ].join("");
901
+ return fixer.replaceTextRange([openingParen.range[0], closingParen.range[1]], fixed);
902
+ },
903
+ loc: {
904
+ end: {
905
+ column: lineLength,
906
+ line: closingParen.loc.end.line
907
+ },
908
+ start: {
909
+ column: 0,
910
+ line: openingParen.loc.start.line
911
+ }
912
+ },
913
+ messageId: "multipleOnSameLine"
914
+ });
915
+ }
916
+ //#endregion
917
+ //#region src/rules/functionParameterLineBreak/defaultOptions.ts
918
+ var defaultOptions$4 = { maxLength: 80 };
919
+ //#endregion
920
+ //#region src/rules/functionParameterLineBreak/checkFunction.ts
921
+ function checkFunction$1(sourceCode, context, node) {
922
+ const maxLength = (context.options[0] ?? {}).maxLength ?? defaultOptions$4.maxLength;
923
+ const params = node.params;
924
+ if (params.length === 0) return;
925
+ const parens = getParens$1(sourceCode, params);
926
+ if (!isValidParens(parens)) return;
927
+ if (parens.openingParen.loc.start.line === parens.closingParen.loc.end.line) checkSingleLineParams(sourceCode, context, params, parens, maxLength);
928
+ else checkMultilineParams(sourceCode, context, params, parens, maxLength);
929
+ }
930
+ //#endregion
931
+ //#region src/rules/functionParameterLineBreak/index.ts
932
+ var functionParameterLineBreak = {
933
+ create(context) {
934
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
935
+ return {
936
+ ArrowFunctionExpression(node) {
937
+ if (node.expression) return;
938
+ checkFunction$1(sourceCode, context, node);
939
+ },
940
+ FunctionDeclaration(node) {
941
+ checkFunction$1(sourceCode, context, node);
942
+ },
943
+ FunctionExpression(node) {
944
+ checkFunction$1(sourceCode, context, node);
945
+ },
946
+ TSCallSignatureDeclaration(node) {
947
+ checkFunction$1(sourceCode, context, node);
948
+ },
949
+ TSFunctionType(node) {
950
+ checkFunction$1(sourceCode, context, node);
951
+ },
952
+ TSMethodSignature(node) {
953
+ checkFunction$1(sourceCode, context, node);
954
+ }
955
+ };
956
+ },
957
+ meta: {
958
+ docs: { description: "Enforce each function parameter to be on its own line when line exceeds max length." },
959
+ fixable: "code",
960
+ messages: {
961
+ exceedsMaxLength: "Refactor this function signature as it exceeds {{maxLength}} characters",
962
+ multipleOnSameLine: "Each parameter must be on its own line"
963
+ },
964
+ schema: [{
965
+ additionalProperties: false,
966
+ properties: { maxLength: { type: "number" } },
967
+ type: "object"
968
+ }],
969
+ type: "layout"
970
+ }
971
+ };
972
+ //#endregion
973
+ //#region src/rules/importsAndReExportsAtTop/getStatementType.ts
974
+ function getStatementType(statement) {
975
+ if (statement.type === "ImportDeclaration") return "import";
976
+ if (statement.type === "ExportAllDeclaration") return "re-export";
977
+ if (statement.type === "ExportNamedDeclaration") {
978
+ if (statement.source !== null) return "re-export";
979
+ }
980
+ return "other";
981
+ }
982
+ //#endregion
983
+ //#region src/rules/importsAndReExportsAtTop/isImportDeclaration.ts
984
+ function isImportDeclaration(statement) {
985
+ return statement.type === "ImportDeclaration";
986
+ }
987
+ //#endregion
988
+ //#region src/rules/importsAndReExportsAtTop/isReExport.ts
989
+ function isReExport(statement) {
990
+ if (statement.type === "ExportAllDeclaration") return true;
991
+ if (statement.type === "ExportNamedDeclaration") return statement.source !== null;
992
+ return false;
993
+ }
994
+ //#endregion
995
+ //#region src/rules/importsAndReExportsAtTop/categorizeStatements.ts
996
+ function categorizeStatements(statements) {
997
+ const result = {
998
+ imports: [],
999
+ other: [],
1000
+ reExports: []
1001
+ };
1002
+ for (const statement of statements) {
1003
+ const type = getStatementType(statement);
1004
+ if (type === "import" && isImportDeclaration(statement)) result.imports.push(statement);
1005
+ else if (type === "re-export" && isReExport(statement)) result.reExports.push(statement);
1006
+ else result.other.push(statement);
1007
+ }
1008
+ return result;
1009
+ }
1010
+ //#endregion
1011
+ //#region src/rules/importsAndReExportsAtTop/findStatementIndices.ts
1012
+ function findStatementIndices(statements) {
1013
+ let firstRegularStatement = -1;
1014
+ let lastImport = -1;
1015
+ let lastReExport = -1;
1016
+ for (let i = 0; i < statements.length; i++) {
1017
+ const type = getStatementType(statements[i]);
1018
+ if (type === "import") lastImport = i;
1019
+ else if (type === "re-export") lastReExport = i;
1020
+ else if (type === "other" && firstRegularStatement === -1) firstRegularStatement = i;
1021
+ }
1022
+ return {
1023
+ firstRegularStatement,
1024
+ lastImport,
1025
+ lastReExport
1026
+ };
1027
+ }
1028
+ //#endregion
1029
+ //#region src/rules/importsAndReExportsAtTop/generateSortedText.ts
1030
+ function generateSortedText(context, categories) {
1031
+ return [
1032
+ ...categories.imports,
1033
+ ...categories.reExports,
1034
+ ...categories.other
1035
+ ].map((node) => context.sourceCode.getText(node)).join("\n");
1036
+ }
1037
+ //#endregion
1038
+ //#region src/rules/importsAndReExportsAtTop/hasImportOrderViolation.ts
1039
+ function hasImportOrderViolation(indices, categories) {
1040
+ const { firstRegularStatement, lastImport, lastReExport } = indices;
1041
+ if (categories.imports.length === 0 && categories.reExports.length === 0) return false;
1042
+ const hasImportAfterRegularStatement = categories.imports.length > 0 && firstRegularStatement !== -1 && lastImport > firstRegularStatement;
1043
+ const hasReExportAfterRegularStatement = categories.reExports.length > 0 && firstRegularStatement !== -1 && lastReExport > firstRegularStatement;
1044
+ return hasImportAfterRegularStatement || hasReExportAfterRegularStatement;
1045
+ }
1046
+ //#endregion
1047
+ //#region src/rules/importsAndReExportsAtTop/index.ts
1048
+ var importsAndReExportsAtTop = {
1049
+ create(context) {
1050
+ return { Program(node) {
1051
+ const statements = node.body;
1052
+ const categories = categorizeStatements(statements);
1053
+ if (!hasImportOrderViolation(findStatementIndices(statements), categories)) return;
1054
+ context.report({
1055
+ fix(fixer) {
1056
+ const sortedText = generateSortedText(context, categories);
1057
+ return fixer.replaceText(node, sortedText);
1058
+ },
1059
+ messageId: "importsAndReExportsAtTop",
1060
+ node
1061
+ });
1062
+ } };
1063
+ },
1064
+ meta: {
1065
+ docs: { description: "Enforce imports and re-exports at the top of the file." },
1066
+ fixable: "code",
1067
+ messages: { importsAndReExportsAtTop: "Imports and re-exports should be at the top of the file." },
1068
+ schema: [],
1069
+ type: "suggestion"
1070
+ }
1071
+ };
1072
+ //#endregion
1073
+ //#region src/rules/individualImports/index.ts
1074
+ var individualImports = {
1075
+ create(context) {
1076
+ return { ImportDeclaration(node) {
1077
+ if (node.specifiers.length <= 1) return;
1078
+ context.report({
1079
+ fix(fixer) {
1080
+ const source = node.source.raw;
1081
+ const specifiers = node.specifiers.filter((s) => s.type === "ImportSpecifier").map((s) => `import {${s.local.name}} from ${source}`).join("\n");
1082
+ return fixer.replaceText(node, specifiers);
1083
+ },
1084
+ messageId: "individualImports",
1085
+ node
1086
+ });
1087
+ } };
1088
+ },
1089
+ meta: {
1090
+ docs: { description: "Enforce individual imports instead of grouped imports." },
1091
+ fixable: "code",
1092
+ messages: { individualImports: "Use individual imports instead of grouped imports." },
1093
+ schema: [],
1094
+ type: "suggestion"
1095
+ }
1096
+ };
1097
+ //#endregion
1098
+ //#region src/rules/individualReExports/index.ts
1099
+ var individualReExports = {
1100
+ create(context) {
1101
+ return { ExportNamedDeclaration(node) {
1102
+ if (!node.source || node.specifiers.length <= 1) return;
1103
+ context.report({
1104
+ fix(fixer) {
1105
+ const source = node.source.value;
1106
+ const typeKeyword = node.exportKind === "type" ? "type " : "";
1107
+ const specifiers = node.specifiers.map((s) => {
1108
+ const localName = s.local.type === "Identifier" ? s.local.name : s.local.value;
1109
+ const exportedName = s.exported.type === "Identifier" ? s.exported.name : s.exported.value;
1110
+ return `export ${typeKeyword}{${localName === exportedName ? localName : `${localName} as ${exportedName}`}} from '${source}'`;
1111
+ }).join("\n");
1112
+ return fixer.replaceText(node, specifiers);
1113
+ },
1114
+ messageId: "individualReExports",
1115
+ node
1116
+ });
1117
+ } };
1118
+ },
1119
+ meta: {
1120
+ docs: { description: "Enforce individual exports instead of grouped exports." },
1121
+ fixable: "code",
1122
+ messages: { individualReExports: "Use individual exports instead of grouped exports." },
1123
+ schema: [],
1124
+ type: "suggestion"
1125
+ }
1126
+ };
1127
+ //#endregion
1128
+ //#region src/rules/interfacePropertyLineBreak/formatTypeLiteral.ts
1129
+ function formatTypeLiteral(sourceCode, typeLiteral, baseIndent) {
1130
+ const members = typeLiteral.members;
1131
+ if (members.length === 0) return "{}";
1132
+ const memberTexts = members.map((member) => {
1133
+ if (member.type === "TSPropertySignature") return sourceCode.getText(member).replace(/,\s*$/, "");
1134
+ return sourceCode.getText(member).replace(/,\s*$/, "");
1135
+ });
1136
+ const innerIndent = baseIndent + " ";
1137
+ return [
1138
+ "{",
1139
+ innerIndent + memberTexts.join(`\n${innerIndent}`),
1140
+ `${baseIndent}}`
1141
+ ].join("\n");
1142
+ }
1143
+ //#endregion
1144
+ //#region src/rules/interfacePropertyLineBreak/checkMultilineMembers.ts
1145
+ function checkMultilineMembers(sourceCode, context, members, maxLength) {
1146
+ for (const member of members) {
1147
+ const memberLine = member.loc.start.line;
1148
+ const lineLength = getLineLength(sourceCode, memberLine);
1149
+ if (lineLength > maxLength) {
1150
+ let fix;
1151
+ if (member.type === "TSPropertySignature" && member.typeAnnotation && member.typeAnnotation.typeAnnotation.type === "TSTypeLiteral") {
1152
+ const typeLiteral = member.typeAnnotation.typeAnnotation;
1153
+ fix = (fixer) => {
1154
+ const formatted = formatTypeLiteral(sourceCode, typeLiteral, getLineIndent(sourceCode, memberLine));
1155
+ return fixer.replaceText(typeLiteral, formatted);
1156
+ };
1157
+ }
1158
+ context.report({
1159
+ data: { maxLength },
1160
+ fix,
1161
+ loc: {
1162
+ end: {
1163
+ column: lineLength,
1164
+ line: memberLine
1165
+ },
1166
+ start: {
1167
+ column: 0,
1168
+ line: memberLine
1169
+ }
1170
+ },
1171
+ messageId: "exceedsMaxLength"
1172
+ });
1173
+ }
1174
+ }
1175
+ }
1176
+ //#endregion
1177
+ //#region src/rules/interfacePropertyLineBreak/checkSingleLineMembers.ts
1178
+ function checkSingleLineMembers(sourceCode, context, members, parens, maxLength) {
1179
+ const { closingBrace, openingBrace } = parens;
1180
+ const lineLength = getLineLength(sourceCode, openingBrace.loc.start.line);
1181
+ if (lineLength <= maxLength) return;
1182
+ if (members.length === 1) {
1183
+ context.report({
1184
+ data: { maxLength },
1185
+ loc: {
1186
+ end: {
1187
+ column: lineLength,
1188
+ line: closingBrace.loc.end.line
1189
+ },
1190
+ start: {
1191
+ column: 0,
1192
+ line: openingBrace.loc.start.line
1193
+ }
1194
+ },
1195
+ messageId: "exceedsMaxLength"
1196
+ });
1197
+ return;
1198
+ }
1199
+ context.report({
1200
+ data: { maxLength },
1201
+ fix: (fixer) => {
1202
+ const indent = sourceCode.getText().match(/^[\t ]*/)?.[0] ?? "";
1203
+ const fixed = [
1204
+ "{\n",
1205
+ `${indent} ${members.map((member, index) => {
1206
+ const memberText = sourceCode.getText(member).replace(/,\s*$/, "");
1207
+ if (!(index === members.length - 1)) return memberText + ",";
1208
+ return memberText;
1209
+ }).join(`\n${indent} `)}\n`,
1210
+ `${indent}}`
1211
+ ].join("");
1212
+ return fixer.replaceTextRange([openingBrace.range[0], closingBrace.range[1]], fixed);
1213
+ },
1214
+ loc: {
1215
+ end: {
1216
+ column: lineLength,
1217
+ line: closingBrace.loc.end.line
1218
+ },
1219
+ start: {
1220
+ column: 0,
1221
+ line: openingBrace.loc.start.line
1222
+ }
1223
+ },
1224
+ messageId: "multipleOnSameLine"
1225
+ });
1226
+ }
1227
+ //#endregion
1228
+ //#region src/rules/interfacePropertyLineBreak/defaultOptions.ts
1229
+ var defaultOptions$3 = { maxLength: 80 };
1230
+ //#endregion
1231
+ //#region src/rules/interfacePropertyLineBreak/getBraces.ts
1232
+ function getBraces$1(sourceCode, body) {
1233
+ const openingBrace = sourceCode.getTokenBefore(body.body[0]);
1234
+ const closingBrace = sourceCode.getTokenAfter(body.body[body.body.length - 1]);
1235
+ if (!openingBrace || !closingBrace) return null;
1236
+ return {
1237
+ closingBrace,
1238
+ openingBrace
1239
+ };
1240
+ }
1241
+ //#endregion
1242
+ //#region src/rules/interfacePropertyLineBreak/checkInterface.ts
1243
+ function checkInterface(sourceCode, context, node) {
1244
+ const maxLength = (context.options[0] ?? {}).maxLength ?? defaultOptions$3.maxLength;
1245
+ const body = node.body;
1246
+ if (!body || body.body.length === 0) return;
1247
+ const braces = getBraces$1(sourceCode, body);
1248
+ if (!braces) return;
1249
+ if (braces.openingBrace.loc.start.line === braces.closingBrace.loc.end.line) checkSingleLineMembers(sourceCode, context, body.body, braces, maxLength);
1250
+ else checkMultilineMembers(sourceCode, context, body.body, maxLength);
1251
+ }
1252
+ //#endregion
1253
+ //#region src/rules/interfacePropertyLineBreak/index.ts
1254
+ var interfacePropertyLineBreak = {
1255
+ create(context) {
1256
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
1257
+ return { TSInterfaceDeclaration(node) {
1258
+ checkInterface(sourceCode, context, node);
1259
+ } };
1260
+ },
1261
+ meta: {
1262
+ docs: { description: "Enforce each interface member to be on its own line when line exceeds max length." },
1263
+ fixable: "code",
1264
+ messages: {
1265
+ exceedsMaxLength: "Interface line exceeds {{maxLength}} characters",
1266
+ multipleOnSameLine: "Interface members should each be on their own line when line exceeds {{maxLength}} characters"
1267
+ },
1268
+ schema: [{
1269
+ additionalProperties: false,
1270
+ properties: { maxLength: { type: "number" } },
1271
+ type: "object"
1272
+ }],
1273
+ type: "layout"
1274
+ }
1275
+ };
1276
+ //#endregion
1277
+ //#region src/rules/maxDeclarationsPerFile/collectVariableDeclarators.ts
1278
+ function collectVariableDeclarators(node, types) {
1279
+ for (const declarator of node.declarations) if (declarator.id.type === "Identifier" && declarator.id.name) types.add(declarator.id.name);
1280
+ }
1281
+ //#endregion
1282
+ //#region src/rules/maxDeclarationsPerFile/isTopLevel.ts
1283
+ function isTopLevel(node) {
1284
+ if (node.parent?.type === "Program") return true;
1285
+ if (node.parent?.type === "ExportNamedDeclaration" && node.parent.parent?.type === "Program") return true;
1286
+ return false;
1287
+ }
1288
+ //#endregion
1289
+ //#region src/rules/maxDeclarationsPerFile/handleClassDeclaration.ts
1290
+ function handleClassDeclaration(node, functions) {
1291
+ if (isTopLevel(node) && node.id?.name) functions.add(node.id.name);
1292
+ }
1293
+ //#endregion
1294
+ //#region src/rules/maxDeclarationsPerFile/handleFunctionDeclaration.ts
1295
+ function handleFunctionDeclaration(node, functions) {
1296
+ if (isTopLevel(node) && node.id?.name) functions.add(node.id.name);
1297
+ }
1298
+ //#endregion
1299
+ //#region src/rules/maxDeclarationsPerFile/handleTSDeclareFunction.ts
1300
+ function handleTSDeclareFunction(node, functions) {
1301
+ if (isTopLevel(node) && node.id?.name) functions.add(node.id.name);
1302
+ }
1303
+ //#endregion
1304
+ //#region src/rules/maxDeclarationsPerFile/handleTSEnumDeclaration.ts
1305
+ function handleTSEnumDeclaration(node, types) {
1306
+ if (isTopLevel(node) && node.id?.name) types.add(node.id.name);
1307
+ }
1308
+ //#endregion
1309
+ //#region src/rules/maxDeclarationsPerFile/handleTSInterfaceDeclaration.ts
1310
+ function handleTSInterfaceDeclaration(node, types) {
1311
+ if (isTopLevel(node) && node.id?.name) types.add(node.id.name);
1312
+ }
1313
+ //#endregion
1314
+ //#region src/rules/maxDeclarationsPerFile/handleTSTypeAliasDeclaration.ts
1315
+ function handleTSTypeAliasDeclaration(node, types) {
1316
+ if (isTopLevel(node) && node.id?.name) types.add(node.id.name);
1317
+ }
1318
+ //#endregion
1319
+ //#region src/rules/maxDeclarationsPerFile/isExempt.ts
1320
+ function isExempt$1(filename) {
1321
+ const name = path.basename(filename, path.extname(filename));
1322
+ const isTest = name.endsWith(".test");
1323
+ const isSpec = name.endsWith(".spec");
1324
+ const isConfig = name.endsWith(".config");
1325
+ return isTest || isSpec || isConfig;
1326
+ }
1327
+ //#endregion
1328
+ //#region src/rules/maxDeclarationsPerFile/isExportedDeclaration.ts
1329
+ function isExportedDeclaration(parent) {
1330
+ return parent?.type === "ExportNamedDeclaration";
1331
+ }
1332
+ //#endregion
1333
+ //#region src/rules/maxDeclarationsPerFile/index.ts
1334
+ var maxDeclarationsPerFile = {
1335
+ create(context) {
1336
+ const filename = context.filename;
1337
+ if (isExempt$1(filename)) return {};
1338
+ const functions = /* @__PURE__ */ new Set();
1339
+ const types = /* @__PURE__ */ new Set();
1340
+ return {
1341
+ ClassDeclaration(node) {
1342
+ handleClassDeclaration(node, functions);
1343
+ },
1344
+ FunctionDeclaration(node) {
1345
+ handleFunctionDeclaration(node, functions);
1346
+ },
1347
+ "Program:exit"(_programNode) {
1348
+ const totalDeclarations = functions.size + types.size;
1349
+ if (totalDeclarations > 1) context.report({
1350
+ data: {
1351
+ count: totalDeclarations,
1352
+ functions: functions.size,
1353
+ types: types.size
1354
+ },
1355
+ messageId: "tooManyDeclarations",
1356
+ node: _programNode
1357
+ });
1358
+ },
1359
+ TSDeclareFunction(node) {
1360
+ handleTSDeclareFunction(node, functions);
1361
+ },
1362
+ TSEnumDeclaration(node) {
1363
+ handleTSEnumDeclaration(node, types);
1364
+ },
1365
+ TSInterfaceDeclaration(node) {
1366
+ handleTSInterfaceDeclaration(node, types);
1367
+ },
1368
+ TSTypeAliasDeclaration(node) {
1369
+ handleTSTypeAliasDeclaration(node, types);
1370
+ },
1371
+ VariableDeclaration(node) {
1372
+ if (!isTopLevel(node)) return;
1373
+ const parent = node.parent;
1374
+ if (!isExportedDeclaration(parent) && !node.declare) return;
1375
+ collectVariableDeclarators(node, types);
1376
+ },
1377
+ "VariableDeclaration > VariableDeclarator > ArrowFunctionExpression"(_node) {
1378
+ if (!isTopLevel(_node.parent?.parent)) return;
1379
+ const declarator = _node.parent;
1380
+ if (declarator.id.type === "Identifier" && declarator.id.name) functions.add(declarator.id.name);
1381
+ }
1382
+ };
1383
+ },
1384
+ meta: {
1385
+ docs: { description: "Enforce single top-level declaration per file." },
1386
+ messages: { tooManyDeclarations: "File has {{count}} declarations. Put each function/class/const/type declaration in its own file." },
1387
+ schema: [],
1388
+ type: "suggestion"
1389
+ }
1390
+ };
1391
+ //#endregion
1392
+ //#region src/rules/multilineUnionTypeAliases/createFix.ts
1393
+ function createFix(fixer, node, sourceCode) {
1394
+ const result = `\n${node.types.map((t) => sourceCode.getText(t)).map((t) => ` | ${t}`).join("\n")}`;
1395
+ return fixer.replaceText(node, result);
1396
+ }
1397
+ //#endregion
1398
+ //#region src/rules/multilineUnionTypeAliases/isMultiline.ts
1399
+ function isMultiline(unionType) {
1400
+ const { end, start } = unionType.loc ?? {};
1401
+ return start?.line !== end?.line;
1402
+ }
1403
+ //#endregion
1404
+ //#region src/rules/multilineUnionTypeAliases/index.ts
1405
+ var multilineUnionTypeAliases = {
1406
+ create(context) {
1407
+ return { TSUnionType(node) {
1408
+ if (node.types.length < 2) return;
1409
+ const parent = node.parent;
1410
+ if (!parent || parent.type !== "TSTypeAliasDeclaration") return;
1411
+ const sourceCode = context.sourceCode;
1412
+ if (sourceCode.getText(node).trim().startsWith("|")) return;
1413
+ if (!isMultiline(node)) {
1414
+ context.report({
1415
+ fix: (fixer) => createFix(fixer, node, sourceCode),
1416
+ messageId: "singleLine",
1417
+ node
1418
+ });
1419
+ return;
1420
+ }
1421
+ context.report({
1422
+ fix: (fixer) => createFix(fixer, node, sourceCode),
1423
+ messageId: "missingPipes",
1424
+ node
1425
+ });
1426
+ } };
1427
+ },
1428
+ meta: {
1429
+ docs: { description: "Enforce union type aliases with multiple members to be on multiple lines." },
1430
+ fixable: "code",
1431
+ messages: {
1432
+ missingPipes: "Multiline union type aliases should have leading pipes on each member",
1433
+ singleLine: "Union type aliases with multiple members should be on multiple lines"
1434
+ },
1435
+ schema: [],
1436
+ type: "layout"
1437
+ }
1438
+ };
1439
+ //#endregion
1440
+ //#region src/rules/namingConvention/isExempt.ts
1441
+ function isExempt(name) {
1442
+ return name.startsWith("_");
1443
+ }
1444
+ //#endregion
1445
+ //#region src/rules/namingConvention/isPascalCase.ts
1446
+ function isPascalCase(name) {
1447
+ if (!/^[A-Z]/.test(name)) return false;
1448
+ return /^[A-Z][\dA-Za-z]*$/.test(name);
1449
+ }
1450
+ //#endregion
1451
+ //#region src/rules/namingConvention/isSeparator.ts
1452
+ function isSeparator(char) {
1453
+ return char === "_" || char === "-" || char === " ";
1454
+ }
1455
+ //#endregion
1456
+ //#region src/rules/namingConvention/isWordBoundary.ts
1457
+ function isWordBoundary(char, currentWord, prevChar, nextChar) {
1458
+ if (!currentWord) return false;
1459
+ const isUpper = /[A-Z]/.test(char);
1460
+ const prevIsUpper = /[A-Z]/.test(prevChar);
1461
+ const nextIsLower = /[a-z]/.test(nextChar);
1462
+ if (isUpper) return !prevIsUpper || prevIsUpper && nextIsLower;
1463
+ return false;
1464
+ }
1465
+ //#endregion
1466
+ //#region src/rules/namingConvention/capitalize.ts
1467
+ function capitalize(word) {
1468
+ return word.charAt(0).toUpperCase() + word.slice(1);
1469
+ }
1470
+ //#endregion
1471
+ //#region src/rules/namingConvention/wordsToCamelCase.ts
1472
+ function wordsToCamelCase(words) {
1473
+ if (words.length === 0) return "";
1474
+ if (words.length === 1) return words[0].toLowerCase();
1475
+ return words[0].toLowerCase() + words.slice(1).map(capitalize).join("");
1476
+ }
1477
+ //#endregion
1478
+ //#region src/rules/namingConvention/toCamelCase.ts
1479
+ function toCamelCase(name) {
1480
+ const words = [];
1481
+ let currentWord = "";
1482
+ for (let i = 0; i < name.length; i++) {
1483
+ const char = name[i];
1484
+ const prevChar = i > 0 ? name[i - 1] : "";
1485
+ const nextChar = i < name.length - 1 ? name[i + 1] : "";
1486
+ if (isSeparator(char)) {
1487
+ if (currentWord) {
1488
+ words.push(currentWord.toLowerCase());
1489
+ currentWord = "";
1490
+ }
1491
+ continue;
1492
+ }
1493
+ if (isWordBoundary(char, currentWord, prevChar, nextChar)) {
1494
+ words.push(currentWord.toLowerCase());
1495
+ currentWord = char;
1496
+ continue;
1497
+ }
1498
+ currentWord += char;
1499
+ }
1500
+ if (currentWord) words.push(currentWord.toLowerCase());
1501
+ return wordsToCamelCase(words);
1502
+ }
1503
+ //#endregion
1504
+ //#region src/rules/namingConvention/toPascalCase.ts
1505
+ function toPascalCase$1(name) {
1506
+ const camelCase = toCamelCase(name);
1507
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
1508
+ }
1509
+ //#endregion
1510
+ //#region src/rules/namingConvention/checkClass.ts
1511
+ function checkClass(id, context) {
1512
+ if (!id) return;
1513
+ const name = id.name;
1514
+ if (isExempt(name)) return;
1515
+ if (!isPascalCase(name)) context.report({
1516
+ data: {
1517
+ name,
1518
+ type: "Class"
1519
+ },
1520
+ fix(fixer) {
1521
+ return fixer.replaceText(id, toPascalCase$1(name));
1522
+ },
1523
+ messageId: "notPascalCase",
1524
+ node: id
1525
+ });
1526
+ }
1527
+ //#endregion
1528
+ //#region src/rules/namingConvention/checkNamedEntity.ts
1529
+ function checkNamedEntity(name, node, type, context) {
1530
+ if (isExempt(name)) return;
1531
+ if (!isPascalCase(name)) context.report({
1532
+ data: {
1533
+ name,
1534
+ type
1535
+ },
1536
+ fix(fixer) {
1537
+ return fixer.replaceText(node, toPascalCase$1(name));
1538
+ },
1539
+ messageId: "notPascalCase",
1540
+ node
1541
+ });
1542
+ }
1543
+ //#endregion
1544
+ //#region src/rules/namingConvention/isCamelCase.ts
1545
+ function isCamelCase(name) {
1546
+ if (!/^[a-z]/.test(name)) return false;
1547
+ return /^[a-z][\dA-Za-z]*$/.test(name);
1548
+ }
1549
+ //#endregion
1550
+ //#region src/rules/namingConvention/isUpperCase.ts
1551
+ function isUpperCase(name) {
1552
+ return /^[A-Z][\dA-Z_]*$/.test(name);
1553
+ }
1554
+ //#endregion
1555
+ //#region src/rules/namingConvention/checkConstant.ts
1556
+ function checkConstant(name, node, context) {
1557
+ if (!isCamelCase(name) && !isUpperCase(name)) context.report({
1558
+ data: { name },
1559
+ messageId: "notUpperCase",
1560
+ node
1561
+ });
1562
+ }
1563
+ //#endregion
1564
+ //#region src/rules/namingConvention/checkVariable.ts
1565
+ function checkVariable(name, node, context) {
1566
+ if (!isCamelCase(name)) context.report({
1567
+ data: { name },
1568
+ fix(fixer) {
1569
+ return fixer.replaceText(node, toCamelCase(name));
1570
+ },
1571
+ messageId: "notCamelCase",
1572
+ node
1573
+ });
1574
+ }
1575
+ //#endregion
1576
+ //#region src/rules/namingConvention/isFunction.ts
1577
+ function isFunction(init) {
1578
+ if (!init) return false;
1579
+ return init.type === "FunctionExpression" || init.type === "ArrowFunctionExpression";
1580
+ }
1581
+ //#endregion
1582
+ //#region src/rules/namingConvention/checkVariableDeclarator.ts
1583
+ function checkVariableDeclarator(node, context) {
1584
+ const id = node.id;
1585
+ const name = id.name;
1586
+ if (isExempt(name)) return;
1587
+ if (isFunction(node.init)) return;
1588
+ const parent = node.parent;
1589
+ if (parent?.type !== "VariableDeclaration") return;
1590
+ if (parent.kind === "const") checkConstant(name, id, context);
1591
+ else checkVariable(name, id, context);
1592
+ }
1593
+ //#endregion
1594
+ //#region src/rules/namingConvention/getFunctionName.ts
1595
+ function getFunctionName(node, parent) {
1596
+ if (node.type === "FunctionDeclaration" && node.id) return node.id.name;
1597
+ if ((node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") && parent?.type === "VariableDeclarator" && parent.id.type === "Identifier") return parent.id.name;
1598
+ return null;
1599
+ }
1600
+ //#endregion
1601
+ //#region src/rules/namingConvention/getReturnTypeText.ts
1602
+ function getReturnTypeText(sourceCode, node) {
1603
+ if (!node.returnType) return void 0;
1604
+ return sourceCode.getText(node.returnType.typeAnnotation);
1605
+ }
1606
+ //#endregion
1607
+ //#region src/rules/namingConvention/isReactComponent.ts
1608
+ function isReactComponent(returnTypeText) {
1609
+ if (!returnTypeText) return false;
1610
+ return [
1611
+ "JSX.Element",
1612
+ "React.JSX.Element",
1613
+ "ReactElement",
1614
+ "ReactNode"
1615
+ ].some((pattern) => returnTypeText.includes(pattern));
1616
+ }
1617
+ //#endregion
1618
+ //#region src/rules/namingConvention/messageIds.ts
1619
+ var messageIds$4 = {
1620
+ notCamelCase: "Function \"{{name}}\" should use camelCase",
1621
+ notPascalCase: "{{type}} \"{{name}}\" should use PascalCase",
1622
+ notUpperCase: "Constant \"{{name}}\" should use UPPER_CASE"
1623
+ };
1624
+ //#endregion
1625
+ //#region src/rules/namingConvention/getFunctionIdentifierNodeForFixer.ts
1626
+ function getFunctionIdentifierNodeForFixer(node, parent) {
1627
+ if (node.type === "FunctionDeclaration") return node.id;
1628
+ if (parent?.type === "VariableDeclarator") return parent.id;
1629
+ return null;
1630
+ }
1631
+ //#endregion
1632
+ //#region src/rules/namingConvention/getFunctionNameForFixer.ts
1633
+ function getFunctionNameForFixer(node, parent) {
1634
+ if (node.type === "FunctionDeclaration" && node.id) return node.id.name;
1635
+ if (parent?.type === "VariableDeclarator" && parent.id.type === "Identifier") return parent.id.name;
1636
+ return "";
1637
+ }
1638
+ //#endregion
1639
+ //#region src/rules/namingConvention/createFunctionFixer.ts
1640
+ function createFunctionFixer(node, parent, convert) {
1641
+ return (fixer) => {
1642
+ const fixedName = convert(getFunctionNameForFixer(node, parent));
1643
+ const identifierNode = getFunctionIdentifierNodeForFixer(node, parent);
1644
+ if (identifierNode) return fixer.replaceText(identifierNode, fixedName);
1645
+ return null;
1646
+ };
1647
+ }
1648
+ //#endregion
1649
+ //#region src/rules/namingConvention/getFunctionReportNode.ts
1650
+ function getFunctionReportNode(node, parent) {
1651
+ if (node.type === "FunctionDeclaration") return node;
1652
+ return parent ?? node;
1653
+ }
1654
+ //#endregion
1655
+ //#region src/rules/namingConvention/reportComponentViolation.ts
1656
+ function reportComponentViolation(node, parent, name, context) {
1657
+ if (isPascalCase(name)) return;
1658
+ context.report({
1659
+ data: {
1660
+ name,
1661
+ type: "React component"
1662
+ },
1663
+ fix: createFunctionFixer(node, parent, toPascalCase$1),
1664
+ messageId: "notPascalCase",
1665
+ node: getFunctionReportNode(node, parent)
1666
+ });
1667
+ }
1668
+ //#endregion
1669
+ //#region src/rules/namingConvention/reportFunctionViolation.ts
1670
+ function reportFunctionViolation(node, parent, name, context) {
1671
+ if (isCamelCase(name)) return;
1672
+ context.report({
1673
+ data: { name },
1674
+ fix: createFunctionFixer(node, parent, toCamelCase),
1675
+ messageId: "notCamelCase",
1676
+ node: getFunctionReportNode(node, parent)
1677
+ });
1678
+ }
1679
+ //#endregion
1680
+ //#region src/rules/namingConvention/index.ts
1681
+ var namingConvention = {
1682
+ create(context) {
1683
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
1684
+ return {
1685
+ ArrowFunctionExpression(node) {
1686
+ checkFunction(node, node.parent);
1687
+ },
1688
+ ClassDeclaration(node) {
1689
+ checkClass(node.id, context);
1690
+ },
1691
+ ClassExpression(node) {
1692
+ checkClass(node.id, context);
1693
+ },
1694
+ FunctionDeclaration(node) {
1695
+ checkFunction(node);
1696
+ },
1697
+ FunctionExpression(node) {
1698
+ checkFunction(node, node.parent);
1699
+ },
1700
+ TSEnumDeclaration(node) {
1701
+ checkNamedEntity(node.id.name, node.id, "Enum", context);
1702
+ },
1703
+ TSInterfaceDeclaration(node) {
1704
+ checkNamedEntity(node.id.name, node.id, "Interface", context);
1705
+ },
1706
+ TSTypeAliasDeclaration(node) {
1707
+ if (node.id.type !== "Identifier") return;
1708
+ checkNamedEntity(node.id.name, node.id, "Type", context);
1709
+ },
1710
+ VariableDeclarator(node) {
1711
+ if (node.id.type !== "Identifier") return;
1712
+ checkVariableDeclarator(node, context);
1713
+ }
1714
+ };
1715
+ function checkFunction(node, parent) {
1716
+ const name = getFunctionName(node, parent);
1717
+ if (!name || isExempt(name)) return;
1718
+ if (isReactComponent(getReturnTypeText(sourceCode, node))) reportComponentViolation(node, parent, name, context);
1719
+ else reportFunctionViolation(node, parent, name, context);
1720
+ }
1721
+ },
1722
+ meta: {
1723
+ docs: { description: "Enforce consistent naming conventions." },
1724
+ fixable: "code",
1725
+ messages: messageIds$4,
1726
+ schema: [],
1727
+ type: "suggestion"
1728
+ }
1729
+ };
1730
+ //#endregion
1731
+ //#region src/rules/noInlineObjectTypes/checkTypeParameters.ts
1732
+ function checkTypeParameters(node, containsInline) {
1733
+ if (!("typeParameters" in node) || !node.typeParameters) return null;
1734
+ for (const param of node.typeParameters.params) {
1735
+ const result = containsInline(param);
1736
+ if (result) return result;
1737
+ }
1738
+ return null;
1739
+ }
1740
+ //#endregion
1741
+ //#region src/rules/noInlineObjectTypes/checkUnionOrIntersectionTypes.ts
1742
+ function checkUnionOrIntersectionTypes(node, containsInline) {
1743
+ for (const type of node.types) {
1744
+ const result = containsInline(type);
1745
+ if (result) return result;
1746
+ }
1747
+ return null;
1748
+ }
1749
+ //#endregion
1750
+ //#region src/rules/noInlineObjectTypes/isInlineObjectType.ts
1751
+ function isInlineObjectType(node) {
1752
+ return node.type === "TSTypeLiteral";
1753
+ }
1754
+ //#endregion
1755
+ //#region src/rules/noInlineObjectTypes/containsInlineObjectType.ts
1756
+ function containsInlineObjectType(node) {
1757
+ if (isInlineObjectType(node)) return node;
1758
+ if (node.type === "TSIntersectionType" || node.type === "TSUnionType") {
1759
+ const result = checkUnionOrIntersectionTypes(node, containsInlineObjectType);
1760
+ if (result) return result;
1761
+ }
1762
+ if (node.type === "TSArrayType") return containsInlineObjectType(node.elementType);
1763
+ const typeParamResult = checkTypeParameters(node, containsInlineObjectType);
1764
+ if (typeParamResult) return typeParamResult;
1765
+ if (node.type === "TSTypeAnnotation") return containsInlineObjectType(node.typeAnnotation);
1766
+ return null;
1767
+ }
1768
+ //#endregion
1769
+ //#region src/rules/noInlineObjectTypes/toPascalCase.ts
1770
+ function toPascalCase(str) {
1771
+ return str.charAt(0).toUpperCase() + str.slice(1);
1772
+ }
1773
+ //#endregion
1774
+ //#region src/rules/noInlineObjectTypes/getInlineTypeName.ts
1775
+ function getInlineTypeName(usedNames, _existingInterfaces, parameterName) {
1776
+ const baseName = parameterName ? toPascalCase(parameterName) : "InlineType";
1777
+ if (!usedNames.has(baseName)) {
1778
+ usedNames.add(baseName);
1779
+ return baseName;
1780
+ }
1781
+ let counter = 2;
1782
+ while (usedNames.has(`${baseName}${counter}`)) counter++;
1783
+ const name = `${baseName}${counter}`;
1784
+ usedNames.add(name);
1785
+ return name;
1786
+ }
1787
+ //#endregion
1788
+ //#region src/rules/noInlineObjectTypes/getParameterNameFromFunction.ts
1789
+ function getParameterNameFromFunction(parent) {
1790
+ if (parent.type === "ArrowFunctionExpression" || parent.type === "FunctionDeclaration" || parent.type === "FunctionExpression") return parent.id?.name;
1791
+ }
1792
+ //#endregion
1793
+ //#region src/rules/noInlineObjectTypes/getParameterNameFromIdentifier.ts
1794
+ function getParameterNameFromIdentifier(parent) {
1795
+ const grandParent = parent.parent;
1796
+ if (grandParent?.type === "ArrowFunctionExpression" || grandParent?.type === "FunctionDeclaration" || grandParent?.type === "FunctionExpression") return parent.name;
1797
+ }
1798
+ //#endregion
1799
+ //#region src/rules/noInlineObjectTypes/getParameterNameFromObjectPattern.ts
1800
+ function getParameterNameFromObjectPattern(parent) {
1801
+ const grandParent = parent.parent;
1802
+ if (grandParent?.type === "ArrowFunctionExpression" || grandParent?.type === "FunctionDeclaration" || grandParent?.type === "FunctionExpression") return "Options";
1803
+ }
1804
+ //#endregion
1805
+ //#region src/rules/noInlineObjectTypes/getTopLevelDeclaration.ts
1806
+ function getTopLevelDeclaration(node) {
1807
+ let current = node;
1808
+ const topLevelTypes = new Set([
1809
+ "ArrowFunctionExpression",
1810
+ "FunctionDeclaration",
1811
+ "FunctionExpression",
1812
+ "TSInterfaceDeclaration",
1813
+ "TSTypeAliasDeclaration",
1814
+ "VariableDeclaration"
1815
+ ]);
1816
+ while (current) {
1817
+ if (topLevelTypes.has(current.type)) {
1818
+ const parent = current.parent;
1819
+ if (parent?.type === "ExportNamedDeclaration" && parent) return {
1820
+ insertLocation: parent,
1821
+ isExported: true,
1822
+ node: current
1823
+ };
1824
+ return {
1825
+ insertLocation: current,
1826
+ isExported: false,
1827
+ node: current
1828
+ };
1829
+ }
1830
+ current = current.parent;
1831
+ }
1832
+ }
1833
+ //#endregion
1834
+ //#region src/rules/noInlineObjectTypes/handleInlineType.ts
1835
+ function handleInlineType(node, typeLiteral, inlineTypes) {
1836
+ const result = getTopLevelDeclaration(node);
1837
+ if (!result) return;
1838
+ let parameterName;
1839
+ const parent = node.parent;
1840
+ if (parent?.type === "Identifier") parameterName = getParameterNameFromIdentifier(parent);
1841
+ else if (parent?.type === "ObjectPattern") parameterName = getParameterNameFromObjectPattern(parent);
1842
+ else parameterName = getParameterNameFromFunction(parent);
1843
+ inlineTypes.push({
1844
+ annotationNode: node,
1845
+ insertLocation: result.insertLocation,
1846
+ isExported: result.isExported,
1847
+ location: result.node,
1848
+ parameterName,
1849
+ typeLiteral
1850
+ });
1851
+ }
1852
+ //#endregion
1853
+ //#region src/rules/noInlineObjectTypes/isIdentifierInFunction.ts
1854
+ function isIdentifierInFunction(parent) {
1855
+ return parent?.type === "Identifier" && (parent.parent?.type === "FunctionDeclaration" || parent.parent?.type === "FunctionExpression" || parent.parent?.type === "ArrowFunctionExpression");
1856
+ }
1857
+ //#endregion
1858
+ //#region src/rules/noInlineObjectTypes/isPropertySignatureInTypeLiteral.ts
1859
+ function isPropertySignatureInTypeLiteral(parent) {
1860
+ return parent?.type === "TSPropertySignature" && (parent.parent?.type === "TSTypeLiteral" || parent.parent?.type === "TSInterfaceBody");
1861
+ }
1862
+ //#endregion
1863
+ //#region src/rules/noInlineObjectTypes/traverseUpForTypeLiteral.ts
1864
+ function traverseUpForTypeLiteral(current) {
1865
+ const skipTypes = new Set([
1866
+ "TSArrayType",
1867
+ "TSIntersectionType",
1868
+ "TSPropertySignature",
1869
+ "TSTypeReference",
1870
+ "TSUnionType"
1871
+ ]);
1872
+ while (current) {
1873
+ if (current.type === "TSTypeLiteral") return true;
1874
+ if (skipTypes.has(current.type)) {
1875
+ current = current.parent;
1876
+ continue;
1877
+ }
1878
+ break;
1879
+ }
1880
+ return false;
1881
+ }
1882
+ //#endregion
1883
+ //#region src/rules/noInlineObjectTypes/isNestedTypeAnnotation.ts
1884
+ function isNestedTypeAnnotation(node) {
1885
+ const parent = node.parent;
1886
+ if (isPropertySignatureInTypeLiteral(parent)) return true;
1887
+ if (isIdentifierInFunction(parent)) return false;
1888
+ if (parent?.type === "ArrowFunctionExpression" || parent?.type === "FunctionDeclaration" || parent?.type === "FunctionExpression") return false;
1889
+ return traverseUpForTypeLiteral(parent);
1890
+ }
1891
+ //#endregion
1892
+ //#region src/rules/noInlineObjectTypes/prepareFix.ts
1893
+ function prepareFix(sourceCode, inlineTypes) {
1894
+ const interfaceBlock = inlineTypes.map(({ name, typeLiteral }) => {
1895
+ return `interface ${name} ${sourceCode.getText(typeLiteral)}`;
1896
+ }).join("\n");
1897
+ const replacements = inlineTypes.map(({ name, typeLiteral }) => ({
1898
+ name,
1899
+ typeLiteral
1900
+ }));
1901
+ return {
1902
+ firstUsageLocation: inlineTypes[0].typeLiteral,
1903
+ interfaceBlock,
1904
+ replacements
1905
+ };
1906
+ }
1907
+ //#endregion
1908
+ //#region src/rules/noInlineObjectTypes/index.ts
1909
+ var noInlineObjectTypes = {
1910
+ create(context) {
1911
+ const sourceCode = context.sourceCode;
1912
+ const inlineTypes = [];
1913
+ return {
1914
+ TSTypeAnnotation(node) {
1915
+ if (isNestedTypeAnnotation(node)) return;
1916
+ const typeLiteral = containsInlineObjectType(node);
1917
+ if (!typeLiteral) return;
1918
+ handleInlineType(node, typeLiteral, inlineTypes);
1919
+ },
1920
+ "Program:exit"() {
1921
+ if (inlineTypes.length === 0) return;
1922
+ const usedNames = /* @__PURE__ */ new Set();
1923
+ const locations = [...new Set(inlineTypes.map((t) => t.insertLocation))];
1924
+ for (const loc of locations) {
1925
+ const typesAtLocation = inlineTypes.filter((t) => t.insertLocation === loc);
1926
+ const fixResult = prepareFix(sourceCode, typesAtLocation.map((entry) => {
1927
+ return {
1928
+ name: getInlineTypeName(usedNames, [], entry.parameterName),
1929
+ parameterName: entry.parameterName,
1930
+ typeLiteral: entry.typeLiteral
1931
+ };
1932
+ }));
1933
+ context.report({
1934
+ fix(fixer) {
1935
+ const fixes = [];
1936
+ for (const replacement of fixResult.replacements) fixes.push(fixer.replaceText(replacement.typeLiteral, replacement.name));
1937
+ if (typesAtLocation[0].isExported && typesAtLocation[0].insertLocation.type === "ExportNamedDeclaration") fixes.push(fixer.insertTextAfter(typesAtLocation[0].insertLocation, `\n${fixResult.interfaceBlock}`));
1938
+ else fixes.push(fixer.insertTextBefore(loc, `${fixResult.interfaceBlock}\n`));
1939
+ return fixes;
1940
+ },
1941
+ messageId: "inlineObjectType",
1942
+ node: typesAtLocation[0].annotationNode
1943
+ });
1944
+ }
1945
+ }
1946
+ };
1947
+ },
1948
+ meta: {
1949
+ docs: { description: "Disallow inline object type literals in type annotations." },
1950
+ fixable: "code",
1951
+ messages: { inlineObjectType: "Inline object types are not allowed. Use a named interface or type instead." },
1952
+ schema: [],
1953
+ type: "suggestion"
1954
+ }
1955
+ };
1956
+ //#endregion
1957
+ //#region src/rules/noUnnecessaryBraces/getReplacementText.ts
1958
+ function getReplacementText(statementText, baseIndent, hasElseAfter) {
1959
+ const statementIndent = `${baseIndent} `;
1960
+ if (hasElseAfter) return `\n${statementIndent}${statementText}\n${baseIndent}`;
1961
+ return `\n${statementIndent}${statementText}`;
1962
+ }
1963
+ //#endregion
1964
+ //#region src/rules/noUnnecessaryBraces/checkBlockStatement.ts
1965
+ function checkBlockStatement(node, context) {
1966
+ if (node.body.length !== 1) return;
1967
+ const statement = node.body[0];
1968
+ const sourceCode = context.getSourceCode();
1969
+ if (isSingleLineStatement(statement, sourceCode)) context.report({
1970
+ fix(fixer) {
1971
+ const statementText = sourceCode.getText(statement);
1972
+ const tokenBefore = sourceCode.getTokenBefore(node);
1973
+ const baseIndent = getLineIndent(sourceCode, tokenBefore?.loc?.start?.line ?? node.loc?.start?.line ?? 1);
1974
+ const range = [tokenBefore ? tokenBefore.range[1] : node.range[0], node.range[1]];
1975
+ const tokenAfter = sourceCode.getTokenAfter(node);
1976
+ const replacementText = getReplacementText(statementText, baseIndent, tokenAfter && tokenAfter.value === "else");
1977
+ return fixer.replaceTextRange(range, replacementText);
1978
+ },
1979
+ messageId: "unnecessaryBraces",
1980
+ node
1981
+ });
1982
+ }
1983
+ //#endregion
1984
+ //#region src/rules/shared/detectIndentStep.ts
1985
+ function detectIndentStep(sourceCode) {
1986
+ const lines = sourceCode.getText().split("\n");
1987
+ const indentCounts = /* @__PURE__ */ new Map();
1988
+ for (const line of lines) {
1989
+ const match = line.match(/^( *)/);
1990
+ if (match) {
1991
+ const spaces = match[1].length;
1992
+ if (spaces > 0) indentCounts.set(spaces, (indentCounts.get(spaces) ?? 0) + 1);
1993
+ }
1994
+ }
1995
+ const sortedIndents = Array.from(indentCounts.entries()).filter(([spaces]) => spaces > 0).sort((a, b) => a[0] - b[0]);
1996
+ if (sortedIndents.length === 0) return 2;
1997
+ const minIndent = sortedIndents[0][0];
1998
+ for (const step of [2, 4]) if (sortedIndents.every(([n]) => n % step === 0)) return step;
1999
+ return minIndent;
2000
+ }
2001
+ //#endregion
2002
+ //#region src/rules/shared/reindentText.ts
2003
+ function reindentText(text, newBaseIndent, indentStep) {
2004
+ const lines = text.split("\n");
2005
+ let minIndent = Infinity;
2006
+ for (let i = 1; i < lines.length; i++) {
2007
+ const line = lines[i];
2008
+ if (line.trim() === "") continue;
2009
+ const match = line.match(/^( *)/);
2010
+ if (match) minIndent = Math.min(minIndent, match[1].length);
2011
+ }
2012
+ if (minIndent === Infinity) return lines.map((line) => {
2013
+ if (line.trim() === "") return "";
2014
+ return newBaseIndent + indentStep + line.trimStart();
2015
+ }).join("\n");
2016
+ return lines.map((line, index) => {
2017
+ if (line.trim() === "") return "";
2018
+ if (index === 0) return newBaseIndent + indentStep + line.trimStart();
2019
+ const relativeIndent = line.slice(minIndent);
2020
+ return newBaseIndent + indentStep + relativeIndent;
2021
+ }).join("\n");
2022
+ }
2023
+ //#endregion
2024
+ //#region src/rules/noUnnecessaryBraces/checkNonBlockStatement.ts
2025
+ function checkNonBlockStatement(node, context) {
2026
+ if (node.type === "BlockStatement") return;
2027
+ const sourceCode = context.getSourceCode();
2028
+ if (!isSingleLineStatement(node, sourceCode)) context.report({
2029
+ fix(fixer) {
2030
+ const statementText = sourceCode.getText(node);
2031
+ const baseIndent = getLineIndent(sourceCode, node.parent?.loc?.start?.line ?? node.loc?.start?.line ?? 1);
2032
+ const indentStepSize = detectIndentStep(sourceCode);
2033
+ const fixed = `{\n${reindentText(statementText, baseIndent, " ".repeat(indentStepSize))}\n${baseIndent}}`;
2034
+ return [fixer.replaceText(node, fixed)];
2035
+ },
2036
+ messageId: "missingBraces",
2037
+ node
2038
+ });
2039
+ }
2040
+ //#endregion
2041
+ //#region src/rules/noUnnecessaryBraces/checkDoWhileStatement.ts
2042
+ function checkDoWhileStatement(node, context) {
2043
+ if (node.body.type === "BlockStatement") checkBlockStatement(node.body, context);
2044
+ else checkNonBlockStatement(node.body, context);
2045
+ }
2046
+ //#endregion
2047
+ //#region src/rules/noUnnecessaryBraces/checkForInStatement.ts
2048
+ function checkForInStatement(node, context) {
2049
+ if (node.body.type === "BlockStatement") checkBlockStatement(node.body, context);
2050
+ else checkNonBlockStatement(node.body, context);
2051
+ }
2052
+ //#endregion
2053
+ //#region src/rules/noUnnecessaryBraces/checkForOfStatement.ts
2054
+ function checkForOfStatement(node, context) {
2055
+ if (node.body.type === "BlockStatement") checkBlockStatement(node.body, context);
2056
+ else checkNonBlockStatement(node.body, context);
2057
+ }
2058
+ //#endregion
2059
+ //#region src/rules/noUnnecessaryBraces/checkForStatement.ts
2060
+ function checkForStatement(node, context) {
2061
+ if (node.body.type === "BlockStatement") checkBlockStatement(node.body, context);
2062
+ else checkNonBlockStatement(node.body, context);
2063
+ }
2064
+ //#endregion
2065
+ //#region src/rules/noUnnecessaryBraces/checkIfStatement.ts
2066
+ function checkIfStatement(node, context) {
2067
+ if (node.consequent.type === "BlockStatement") checkBlockStatement(node.consequent, context);
2068
+ else checkNonBlockStatement(node.consequent, context);
2069
+ if (!node.alternate) return;
2070
+ if (node.alternate.type === "IfStatement") return;
2071
+ if (node.alternate.type === "BlockStatement") checkBlockStatement(node.alternate, context);
2072
+ else checkNonBlockStatement(node.alternate, context);
2073
+ }
2074
+ //#endregion
2075
+ //#region src/rules/noUnnecessaryBraces/checkWhileStatement.ts
2076
+ function checkWhileStatement(node, context) {
2077
+ if (node.body.type === "BlockStatement") checkBlockStatement(node.body, context);
2078
+ else checkNonBlockStatement(node.body, context);
2079
+ }
2080
+ //#endregion
2081
+ //#region src/rules/noUnnecessaryBraces/index.ts
2082
+ var noUnnecessaryBraces = {
2083
+ create(context) {
2084
+ return {
2085
+ DoWhileStatement: (node) => checkDoWhileStatement(node, context),
2086
+ ForInStatement: (node) => checkForInStatement(node, context),
2087
+ ForOfStatement: (node) => checkForOfStatement(node, context),
2088
+ ForStatement: (node) => checkForStatement(node, context),
2089
+ IfStatement: (node) => checkIfStatement(node, context),
2090
+ WhileStatement: (node) => checkWhileStatement(node, context)
2091
+ };
2092
+ },
2093
+ meta: {
2094
+ docs: { description: "Enforce consistent brace usage for single-statement control bodies." },
2095
+ fixable: "code",
2096
+ messages: {
2097
+ missingBraces: "Multi-line statement must be wrapped in braces",
2098
+ unnecessaryBraces: "Unnecessary braces around single-line statement"
2099
+ },
2100
+ schema: [],
2101
+ type: "suggestion"
2102
+ }
2103
+ };
2104
+ //#endregion
2105
+ //#region src/rules/objectPropertyLineBreak/isShorthandProperty.ts
2106
+ function isShorthandProperty(property) {
2107
+ return property.shorthand;
2108
+ }
2109
+ //#endregion
2110
+ //#region src/rules/objectPropertyLineBreak/areAllShorthand.ts
2111
+ function areAllShorthand(properties) {
2112
+ return properties.every(isShorthandProperty);
2113
+ }
2114
+ //#endregion
2115
+ //#region src/rules/objectPropertyLineBreak/getPropertyText.ts
2116
+ function getPropertyText(sourceCode, property) {
2117
+ return sourceCode.getText(property);
2118
+ }
2119
+ //#endregion
2120
+ //#region src/rules/objectPropertyLineBreak/getInlineObjectLength.ts
2121
+ function getInlineObjectLength(sourceCode, properties) {
2122
+ if (properties.length === 0) return 2;
2123
+ const propsTotal = properties.map((p) => getPropertyText(sourceCode, p).length).reduce((a, b) => a + b, 0);
2124
+ const commas = Math.max(0, properties.length - 1);
2125
+ return 2 + propsTotal + commas;
2126
+ }
2127
+ //#endregion
2128
+ //#region src/rules/objectPropertyLineBreak/checkMultiline.ts
2129
+ function checkMultiline(sourceCode, context, node, braces, maxLength) {
2130
+ const properties = node.properties;
2131
+ if (!areAllShorthand(properties)) return;
2132
+ if (getInlineObjectLength(sourceCode, properties) > maxLength) return;
2133
+ context.report({
2134
+ fix(fixer) {
2135
+ const names = [];
2136
+ for (const prop of properties) if (prop.key.type === "Identifier") names.push(prop.key.name);
2137
+ else names.push(sourceCode.getText(prop));
2138
+ return fixer.replaceText(node, `{${names.join(", ")}}`);
2139
+ },
2140
+ messageId: "multilineCanBeSingleLine",
2141
+ node: properties[0]
2142
+ });
2143
+ }
2144
+ //#endregion
2145
+ //#region src/rules/objectPropertyLineBreak/buildMultilineFix.ts
2146
+ function buildMultilineFix(fixer, braces, properties, sourceCode) {
2147
+ const indentStep = detectIndentStep(sourceCode);
2148
+ const lineIndent = sourceCode.getLines()[braces.openingBrace.loc.start.line - 1].match(/^\s*/)?.[0] ?? "";
2149
+ const indent = lineIndent + " ".repeat(indentStep);
2150
+ const lines = ["{"];
2151
+ for (const prop of properties) {
2152
+ const propText = sourceCode.getText(prop);
2153
+ lines.push(`${indent}${propText},`);
2154
+ }
2155
+ lines.push(`${lineIndent}}`);
2156
+ return fixer.replaceTextRange([braces.openingBrace.range[0], braces.closingBrace.range[1]], lines.join("\n"));
2157
+ }
2158
+ //#endregion
2159
+ //#region src/rules/objectPropertyLineBreak/getPropertyName.ts
2160
+ function getPropertyName(sourceCode, prop) {
2161
+ if (prop.key.type === "Identifier") return prop.key.name;
2162
+ return sourceCode.getText(prop);
2163
+ }
2164
+ //#endregion
2165
+ //#region src/rules/objectPropertyLineBreak/buildShorthandFix.ts
2166
+ function buildShorthandFix(fixer, braces, properties, sourceCode) {
2167
+ const names = properties.map((p) => getPropertyName(sourceCode, p));
2168
+ return fixer.replaceTextRange([braces.openingBrace.range[0], braces.closingBrace.range[1]], `{${names.join(", ")}}`);
2169
+ }
2170
+ //#endregion
2171
+ //#region src/rules/objectPropertyLineBreak/canConvertToShorthand.ts
2172
+ function canConvertToShorthand(property) {
2173
+ if (property.shorthand) return true;
2174
+ if (property.kind !== "init") return false;
2175
+ if (property.key.type !== "Identifier") return false;
2176
+ if (property.value.type !== "Identifier") return false;
2177
+ return property.key.name === property.value.name;
2178
+ }
2179
+ //#endregion
2180
+ //#region src/rules/objectPropertyLineBreak/shouldCollapseToShorthand.ts
2181
+ function shouldCollapseToShorthand(properties, sourceCode, maxLength) {
2182
+ const anyShorthand = properties.some((p) => p.shorthand);
2183
+ const allCanConvert = properties.every(canConvertToShorthand);
2184
+ const shorthandLength = allCanConvert ? getInlineObjectLength(sourceCode, properties) : Infinity;
2185
+ return !anyShorthand && allCanConvert && shorthandLength <= maxLength;
2186
+ }
2187
+ //#endregion
2188
+ //#region src/rules/objectPropertyLineBreak/checkSingleLine.ts
2189
+ function checkSingleLine(sourceCode, context, properties, braces, maxLength) {
2190
+ if (properties.length === 1) return;
2191
+ const allShorthand = areAllShorthand(properties);
2192
+ const inlineLength = getInlineObjectLength(sourceCode, properties);
2193
+ if (allShorthand && inlineLength <= maxLength) return;
2194
+ if (!allShorthand) {
2195
+ if (shouldCollapseToShorthand(properties, sourceCode, maxLength)) {
2196
+ context.report({
2197
+ fix: (fixer) => buildShorthandFix(fixer, braces, properties, sourceCode),
2198
+ messageId: "mixedPropertiesNotAllowed",
2199
+ node: properties[0]
2200
+ });
2201
+ return;
2202
+ }
2203
+ context.report({
2204
+ fix: (fixer) => buildMultilineFix(fixer, braces, properties, sourceCode),
2205
+ messageId: "mixedPropertiesNotAllowed",
2206
+ node: properties[0]
2207
+ });
2208
+ return;
2209
+ }
2210
+ context.report({
2211
+ fix: (fixer) => buildMultilineFix(fixer, braces, properties, sourceCode),
2212
+ messageId: "singleLineExceedsMaxLength",
2213
+ node: properties[0]
2214
+ });
2215
+ }
2216
+ //#endregion
2217
+ //#region src/rules/objectPropertyLineBreak/defaultOptions.ts
2218
+ var defaultOptions$2 = { maxLength: 80 };
2219
+ //#endregion
2220
+ //#region src/rules/objectPropertyLineBreak/getBraces.ts
2221
+ function getBraces(sourceCode, node) {
2222
+ const properties = node.properties;
2223
+ if (properties.length === 0) return null;
2224
+ const firstProp = properties[0];
2225
+ const lastProp = properties[properties.length - 1];
2226
+ const openingBrace = sourceCode.getTokenBefore(firstProp);
2227
+ const closingBrace = sourceCode.getTokenAfter(lastProp);
2228
+ if (!openingBrace || !closingBrace) return null;
2229
+ return {
2230
+ closingBrace,
2231
+ openingBrace
2232
+ };
2233
+ }
2234
+ //#endregion
2235
+ //#region src/rules/objectPropertyLineBreak/checkObject.ts
2236
+ function checkObject(sourceCode, context, node) {
2237
+ const maxLength = (context.options[0] ?? {}).maxLength ?? defaultOptions$2.maxLength;
2238
+ const properties = node.properties;
2239
+ if (properties.length === 0) return;
2240
+ const braces = getBraces(sourceCode, node);
2241
+ if (!braces) return;
2242
+ if (braces.openingBrace.loc.start.line === braces.closingBrace.loc.end.line) checkSingleLine(sourceCode, context, properties, braces, maxLength);
2243
+ else checkMultiline(sourceCode, context, node, braces, maxLength);
2244
+ }
2245
+ //#endregion
2246
+ //#region src/rules/objectPropertyLineBreak/index.ts
2247
+ var objectPropertyLineBreak = {
2248
+ create(context) {
2249
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
2250
+ return { ObjectExpression(node) {
2251
+ checkObject(sourceCode, context, node);
2252
+ } };
2253
+ },
2254
+ meta: {
2255
+ docs: { description: "Enforce object literal formatting based on complexity and line length." },
2256
+ fixable: "code",
2257
+ messages: {
2258
+ mixedPropertiesNotAllowed: "mixedPropertiesNotAllowed",
2259
+ multilineCanBeSingleLine: "multilineCanBeSingleLine",
2260
+ singleLineExceedsMaxLength: "singleLineExceedsMaxLength"
2261
+ },
2262
+ schema: [{
2263
+ additionalProperties: false,
2264
+ properties: { maxLength: { type: "number" } },
2265
+ type: "object"
2266
+ }],
2267
+ type: "layout"
2268
+ }
2269
+ };
2270
+ //#endregion
2271
+ //#region src/rules/oneExportPerFile/index.ts
2272
+ var oneExportPerFile = {
2273
+ create(context) {
2274
+ const filename = context.filename;
2275
+ if (isExempt$2(filename)) return {};
2276
+ let exportCount = 0;
2277
+ return {
2278
+ ExportDefaultDeclaration(_node) {
2279
+ exportCount++;
2280
+ },
2281
+ ExportNamedDeclaration(_node) {
2282
+ exportCount++;
2283
+ },
2284
+ "Program:exit"(programNode) {
2285
+ if (exportCount > 1) context.report({
2286
+ data: { count: exportCount },
2287
+ messageId: "tooManyExports",
2288
+ node: programNode
2289
+ });
2290
+ }
2291
+ };
2292
+ },
2293
+ meta: {
2294
+ docs: { description: "Enforce single export per file." },
2295
+ messages: { tooManyExports: "Only one export is allowed per file. Found {{count}} exports." },
2296
+ schema: [],
2297
+ type: "suggestion"
2298
+ }
2299
+ };
2300
+ //#endregion
2301
+ //#region src/rules/preferInlineExport/isValidExportSpecifier.ts
2302
+ function isValidExportSpecifier(specifier, localDeclarations) {
2303
+ if (specifier.local.type !== "Identifier") return false;
2304
+ if (specifier.exported.type !== "Identifier") return false;
2305
+ if (specifier.local.name !== specifier.exported.name) return false;
2306
+ return localDeclarations.has(specifier.local.name);
2307
+ }
2308
+ //#endregion
2309
+ //#region src/rules/preferInlineExport/canInlineSpecifiers.ts
2310
+ function canInlineSpecifiers(specifiers, localDeclarations) {
2311
+ return specifiers.every((spec) => isValidExportSpecifier(spec, localDeclarations));
2312
+ }
2313
+ //#endregion
2314
+ //#region src/rules/preferInlineExport/getDeclarationName.ts
2315
+ function getDeclarationName(node) {
2316
+ if (node.type !== "VariableDeclaration") return node.id?.name ?? null;
2317
+ const declarations = node.declarations;
2318
+ if (declarations.length === 1) {
2319
+ const id = declarations[0].id;
2320
+ if (id.type === "Identifier") return id.name;
2321
+ }
2322
+ return null;
2323
+ }
2324
+ //#endregion
2325
+ //#region src/rules/preferInlineExport/isExportableDeclaration.ts
2326
+ function isExportableDeclaration(node) {
2327
+ const type = node.type;
2328
+ return type === "TSInterfaceDeclaration" || type === "TSTypeAliasDeclaration" || type === "ClassDeclaration" || type === "FunctionDeclaration" || type === "VariableDeclaration";
2329
+ }
2330
+ //#endregion
2331
+ //#region src/rules/preferInlineExport/index.ts
2332
+ var preferInlineExport = {
2333
+ create(context) {
2334
+ const localDeclarations = /* @__PURE__ */ new Map();
2335
+ function visitDeclaration(node) {
2336
+ if (!isExportableDeclaration(node)) return;
2337
+ const name = getDeclarationName(node);
2338
+ if (name) localDeclarations.set(name, {
2339
+ name,
2340
+ node
2341
+ });
2342
+ }
2343
+ return {
2344
+ ClassDeclaration: visitDeclaration,
2345
+ ExportNamedDeclaration(node) {
2346
+ if (node.source) return;
2347
+ if (!node.specifiers || node.specifiers.length === 0) return;
2348
+ if (!canInlineSpecifiers(node.specifiers, localDeclarations)) return;
2349
+ context.report({
2350
+ fix(fixer) {
2351
+ const fixes = [];
2352
+ for (const specifier of node.specifiers) {
2353
+ const name = specifier.local.name;
2354
+ const decl = localDeclarations.get(name);
2355
+ if (decl) fixes.push(fixer.insertTextBefore(decl.node, "export "));
2356
+ }
2357
+ fixes.push(fixer.remove(node));
2358
+ return fixes;
2359
+ },
2360
+ messageId: "preferInline",
2361
+ node
2362
+ });
2363
+ },
2364
+ FunctionDeclaration: visitDeclaration,
2365
+ TSInterfaceDeclaration: visitDeclaration,
2366
+ TSTypeAliasDeclaration: visitDeclaration,
2367
+ VariableDeclaration: visitDeclaration
2368
+ };
2369
+ },
2370
+ meta: {
2371
+ docs: { description: "Enforce using inline export syntax instead of separate export statements." },
2372
+ fixable: "code",
2373
+ messages: { preferInline: "Use inline export instead of separate export statement" },
2374
+ schema: [],
2375
+ type: "suggestion"
2376
+ }
2377
+ };
2378
+ //#endregion
2379
+ //#region src/rules/singleLineArrowFunctionParameters/buildCollapsedParams.ts
2380
+ function buildCollapsedParams(sourceCode, params) {
2381
+ return `(${params.map((param, index) => {
2382
+ const text = sourceCode.getText(param);
2383
+ return index === params.length - 1 ? text : text + ",";
2384
+ }).join(" ")})`;
2385
+ }
2386
+ //#endregion
2387
+ //#region src/rules/singleLineArrowFunctionParameters/calculateCollapsedLength.ts
2388
+ function calculateCollapsedLength(sourceCode, openingParen, collapsedParams, returnType) {
2389
+ let returnTypeText = "";
2390
+ if (returnType) returnTypeText = sourceCode.getText(returnType);
2391
+ const textAfterClosingParen = sourceCode.getText().split("\n")[openingParen.loc.start.line - 1].slice(openingParen.loc.start.column);
2392
+ return openingParen.loc.start.column + collapsedParams.length + returnTypeText.length + textAfterClosingParen.length;
2393
+ }
2394
+ //#endregion
2395
+ //#region src/rules/singleLineArrowFunctionParameters/defaultOptions.ts
2396
+ var defaultOptions$1 = { maxLength: 80 };
2397
+ //#endregion
2398
+ //#region src/rules/singleLineArrowFunctionParameters/getArrowFunctionParens.ts
2399
+ function getArrowFunctionParens(sourceCode, params) {
2400
+ if (params.length === 0) return null;
2401
+ const firstParam = params[0];
2402
+ const lastParam = params[params.length - 1];
2403
+ const openingParen = sourceCode.getTokenBefore(firstParam);
2404
+ let closingParen = sourceCode.getTokenAfter(lastParam);
2405
+ while (closingParen && closingParen.value === ",") closingParen = sourceCode.getTokenAfter(closingParen);
2406
+ if (!openingParen || !closingParen) return null;
2407
+ if (openingParen.value !== "(" || closingParen.value !== ")") return null;
2408
+ return {
2409
+ closingParen,
2410
+ openingParen
2411
+ };
2412
+ }
2413
+ //#endregion
2414
+ //#region src/rules/singleLineArrowFunctionParameters/isShorthand.ts
2415
+ function isShorthand(sourceCode, node) {
2416
+ if (node.params.length !== 1) return false;
2417
+ const firstParam = node.params[0];
2418
+ const tokenBefore = sourceCode.getTokenBefore(firstParam);
2419
+ return !tokenBefore || tokenBefore.value !== "(";
2420
+ }
2421
+ //#endregion
2422
+ //#region src/rules/singleLineArrowFunctionParameters/reportViolation.ts
2423
+ function reportViolation(context, node, collapsedParams, returnTypeText, arrowToken, openingParen) {
2424
+ context.report({
2425
+ fix: (fixer) => fixer.replaceTextRange([openingParen.range[0], arrowToken.range[1]], collapsedParams + returnTypeText + " =>"),
2426
+ messageId: "singleLine",
2427
+ node
2428
+ });
2429
+ }
2430
+ //#endregion
2431
+ //#region src/rules/singleLineArrowFunctionParameters/checkArrowFunction.ts
2432
+ function checkArrowFunction(sourceCode, context, node) {
2433
+ const maxLength = (context.options[0] ?? {}).maxLength ?? defaultOptions$1.maxLength;
2434
+ if (isShorthand(sourceCode, node)) return;
2435
+ const parens = getArrowFunctionParens(sourceCode, node.params);
2436
+ if (!parens) return;
2437
+ const { closingParen, openingParen } = parens;
2438
+ if (openingParen.loc.start.line === closingParen.loc.end.line) return;
2439
+ const arrowToken = sourceCode.getTokenAfter(closingParen, (token) => token.value === "=>");
2440
+ if (!arrowToken) return;
2441
+ const collapsedParams = buildCollapsedParams(sourceCode, node.params);
2442
+ if (calculateCollapsedLength(sourceCode, openingParen, collapsedParams, node.returnType) <= maxLength) reportViolation(context, node, collapsedParams, node.returnType ? sourceCode.getText(node.returnType) : "", arrowToken, openingParen);
2443
+ }
2444
+ //#endregion
2445
+ //#region src/rules/singleLineArrowFunctionParameters/index.ts
2446
+ var singleLineArrowFunctionParameters = {
2447
+ create(context) {
2448
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
2449
+ return { ArrowFunctionExpression(node) {
2450
+ if (node.params.length === 0) return;
2451
+ checkArrowFunction(sourceCode, context, node);
2452
+ } };
2453
+ },
2454
+ meta: {
2455
+ docs: { description: "Enforce arrow function parameters to be on a single line when they fit." },
2456
+ fixable: "code",
2457
+ messages: { singleLine: "Arrow function parameters can be on a single line" },
2458
+ schema: [{
2459
+ additionalProperties: false,
2460
+ properties: { maxLength: { type: "number" } },
2461
+ type: "object"
2462
+ }],
2463
+ type: "layout"
2464
+ }
2465
+ };
2466
+ //#endregion
2467
+ //#region src/rules/singleLineFunctionParameters/defaultOptions.ts
2468
+ var defaultOptions = { maxLength: 80 };
2469
+ //#endregion
2470
+ //#region src/rules/singleLineFunctionParameters/getParens.ts
2471
+ function getParens(sourceCode, nodes) {
2472
+ if (nodes.length === 0) return null;
2473
+ const firstNode = nodes[0];
2474
+ const lastNode = nodes[nodes.length - 1];
2475
+ const openingParen = sourceCode.getTokenBefore(firstNode, (token) => token.value === "(");
2476
+ const closingParen = sourceCode.getTokenAfter(lastNode, (token) => token.value === ")");
2477
+ if (!openingParen || !closingParen) return null;
2478
+ return {
2479
+ closingParen,
2480
+ openingParen
2481
+ };
2482
+ }
2483
+ //#endregion
2484
+ //#region src/rules/singleLineFunctionParameters/checkFunction.ts
2485
+ function checkFunction(sourceCode, context, node) {
2486
+ const maxLength = (context.options[0] ?? {}).maxLength ?? defaultOptions.maxLength;
2487
+ const params = node.params;
2488
+ if (params.length === 0) return;
2489
+ const parens = getParens(sourceCode, params);
2490
+ if (!isValidParens(parens)) return;
2491
+ if (parens.openingParen.loc.start.line === parens.closingParen.loc.end.line) return;
2492
+ const paramsText = params.map((param, index) => {
2493
+ const text = sourceCode.getText(param);
2494
+ if (index === params.length - 1) return text;
2495
+ const comma = sourceCode.getTokenAfter(param, (token) => token.value === ",");
2496
+ if (comma && comma.loc.end.line === param.loc.end.line) return text + ",";
2497
+ return text;
2498
+ }).join(" ");
2499
+ const closingLine = parens.closingParen.loc.end.line;
2500
+ const closingCol = parens.closingParen.loc.end.column;
2501
+ const closingLineText = getLineLength(sourceCode, closingLine) > closingCol ? sourceCode.getText().split("\n")[closingLine - 1].slice(closingCol) : "";
2502
+ if (parens.openingParen.loc.start.column + 1 + paramsText.length + 1 + closingLineText.length <= maxLength) context.report({
2503
+ fix: (fixer) => fixer.replaceTextRange([parens.openingParen.range[0], parens.closingParen.range[1]], `(${paramsText})`),
2504
+ messageId: "singleLine",
2505
+ node
2506
+ });
2507
+ }
2508
+ //#endregion
2509
+ //#region src/rules/singleLineFunctionParameters/index.ts
2510
+ var singleLineFunctionParameters = {
2511
+ create(context) {
2512
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
2513
+ return {
2514
+ FunctionDeclaration(node) {
2515
+ checkFunction(sourceCode, context, node);
2516
+ },
2517
+ FunctionExpression(node) {
2518
+ checkFunction(sourceCode, context, node);
2519
+ },
2520
+ TSCallSignatureDeclaration(node) {
2521
+ checkFunction(sourceCode, context, node);
2522
+ },
2523
+ TSFunctionType(node) {
2524
+ checkFunction(sourceCode, context, node);
2525
+ },
2526
+ TSMethodSignature(node) {
2527
+ checkFunction(sourceCode, context, node);
2528
+ }
2529
+ };
2530
+ },
2531
+ meta: {
2532
+ docs: { description: "Enforce function parameters to be on a single line when they fit." },
2533
+ fixable: "code",
2534
+ messages: { singleLine: "Function parameters can be on a single line" },
2535
+ schema: [{
2536
+ additionalProperties: false,
2537
+ properties: { maxLength: { type: "number" } },
2538
+ type: "object"
2539
+ }],
2540
+ type: "layout"
2541
+ }
2542
+ };
2543
+ //#endregion
2544
+ //#region src/rules/singleLineImports/formatAttributes.ts
2545
+ function formatAttributes(attributes) {
2546
+ if (attributes.length === 0) return "";
2547
+ return ` with {${attributes.map((attr) => {
2548
+ return `${attr.key.type === "Identifier" ? attr.key.name : attr.key.value}: '${attr.value.value}'`;
2549
+ }).join(", ")}}`;
2550
+ }
2551
+ //#endregion
2552
+ //#region src/rules/singleLineImports/formatNamed.ts
2553
+ function formatNamed(specifiers, sourceCode) {
2554
+ return specifiers.map((s) => sourceCode.getText(s)).join(", ");
2555
+ }
2556
+ //#endregion
2557
+ //#region src/rules/singleLineImports/formatSpecifiers.ts
2558
+ function formatSpecifiers(declaration, sourceCode) {
2559
+ const defaultSpecifier = declaration.specifiers.find((s) => s.type === "ImportDefaultSpecifier");
2560
+ const namespaceSpecifier = declaration.specifiers.find((s) => s.type === "ImportNamespaceSpecifier");
2561
+ const namedSpecifiers = declaration.specifiers.filter((s) => s.type === "ImportSpecifier");
2562
+ if (namespaceSpecifier) return `* as ${namespaceSpecifier.local.name}`;
2563
+ if (defaultSpecifier && namedSpecifiers.length > 0) return `${defaultSpecifier.local.name}, {${formatNamed(namedSpecifiers, sourceCode)}}`;
2564
+ if (defaultSpecifier) return defaultSpecifier.local.name;
2565
+ if (namedSpecifiers.length === 0) return "";
2566
+ return `{${formatNamed(namedSpecifiers, sourceCode)}}`;
2567
+ }
2568
+ //#endregion
2569
+ //#region src/rules/singleLineImports/createImportFix.ts
2570
+ function createImportFix$1(fixer, declaration, sourceCode) {
2571
+ const source = declaration.source.value;
2572
+ const prefix = declaration.importKind === "type" ? "import type " : "import ";
2573
+ const specifiers = formatSpecifiers(declaration, sourceCode);
2574
+ const attributes = formatAttributes(declaration.attributes);
2575
+ if (specifiers === "") {
2576
+ const result = `${prefix}'${source}'${attributes}`;
2577
+ return fixer.replaceText(declaration, result);
2578
+ }
2579
+ const result = `${prefix}${specifiers} from '${source}'${attributes}`;
2580
+ return fixer.replaceText(declaration, result);
2581
+ }
2582
+ //#endregion
2583
+ //#region src/rules/singleLineImports/isMultilineImport.ts
2584
+ function isMultilineImport(declaration) {
2585
+ const { end, start } = declaration.loc ?? {};
2586
+ return start?.line !== end?.line;
2587
+ }
2588
+ //#endregion
2589
+ //#region src/rules/singleLineImports/index.ts
2590
+ var singleLineImports = {
2591
+ create(context) {
2592
+ return { ImportDeclaration(node) {
2593
+ if (!isMultilineImport(node)) return;
2594
+ context.report({
2595
+ fix: (fixer) => createImportFix$1(fixer, node, context.sourceCode),
2596
+ messageId: "multiline",
2597
+ node
2598
+ });
2599
+ } };
2600
+ },
2601
+ meta: {
2602
+ docs: { description: "Enforce imports to be on a single line." },
2603
+ fixable: "code",
2604
+ messages: { multiline: "Import should be on a single line" },
2605
+ schema: [],
2606
+ type: "layout"
2607
+ }
2608
+ };
2609
+ //#endregion
2610
+ //#region src/rules/singleLineReExports/createReExportFix.ts
2611
+ function createReExportFix$1(fixer, declaration, sourceCode) {
2612
+ const source = declaration.source.value;
2613
+ if (declaration.type === "ExportAllDeclaration") {
2614
+ const result = `export ${declaration.exported ? `* as ${sourceCode.getText(declaration.exported)}` : "*"} from '${source}'${formatAttributes(declaration.attributes)}`;
2615
+ return fixer.replaceText(declaration, result);
2616
+ }
2617
+ const result = `${declaration.exportKind === "type" ? "export type " : "export "}{${declaration.specifiers.map((s) => sourceCode.getText(s)).join(", ")}} from '${source}'${formatAttributes(declaration.attributes)}`;
2618
+ return fixer.replaceText(declaration, result);
2619
+ }
2620
+ //#endregion
2621
+ //#region src/rules/singleLineReExports/isMultilineReExport.ts
2622
+ function isMultilineReExport(declaration) {
2623
+ const { end, start } = declaration.loc ?? {};
2624
+ return start?.line !== end?.line;
2625
+ }
2626
+ //#endregion
2627
+ //#region src/rules/singleLineReExports/index.ts
2628
+ var singleLineReExports = {
2629
+ create(context) {
2630
+ const checkDeclaration = (node, declaration) => {
2631
+ if (!declaration.source) return;
2632
+ if (!isMultilineReExport(declaration)) return;
2633
+ context.report({
2634
+ fix: (fixer) => createReExportFix$1(fixer, declaration, context.sourceCode),
2635
+ messageId: "multiline",
2636
+ node
2637
+ });
2638
+ };
2639
+ return {
2640
+ ExportAllDeclaration: (node) => {
2641
+ checkDeclaration(node, node);
2642
+ },
2643
+ ExportNamedDeclaration: (node) => {
2644
+ checkDeclaration(node, node);
2645
+ }
2646
+ };
2647
+ },
2648
+ meta: {
2649
+ docs: { description: "Enforce re-exports to be on a single line." },
2650
+ fixable: "code",
2651
+ messages: { multiline: "Re-export should be on a single line" },
2652
+ schema: [],
2653
+ type: "layout"
2654
+ }
2655
+ };
2656
+ //#endregion
2657
+ //#region src/rules/sortedImports/categorizeImport.ts
2658
+ function categorizeImport(declaration) {
2659
+ if (declaration.specifiers.some((s) => s.type === "ImportNamespaceSpecifier")) return declaration.importKind === "type" ? "type-namespace" : "namespace";
2660
+ if (declaration.specifiers.some((s) => s.type === "ImportDefaultSpecifier")) return declaration.importKind === "type" ? "type-default" : "default";
2661
+ if (declaration.importKind === "type") return "type-named";
2662
+ if (declaration.specifiers.length === 0) return "side-effect";
2663
+ return "named";
2664
+ }
2665
+ //#endregion
2666
+ //#region src/rules/sortedImports/getImportSortKey.ts
2667
+ function getImportSortKey(declaration) {
2668
+ const group = categorizeImport(declaration);
2669
+ if (group === "side-effect") return declaration.source.value;
2670
+ if (group === "namespace" || group === "type-namespace") return `*${declaration.specifiers.find((s) => s.type === "ImportNamespaceSpecifier")?.local.name ?? ""}`;
2671
+ if (group === "default" || group === "type-default") return declaration.specifiers.find((s) => s.type === "ImportDefaultSpecifier")?.local.name ?? "";
2672
+ return declaration.specifiers[0].local.name;
2673
+ }
2674
+ //#endregion
2675
+ //#region src/rules/sortedImports/categorizeImports.ts
2676
+ function categorizeImports(declarations) {
2677
+ return declarations.map((declaration) => ({
2678
+ declaration,
2679
+ group: categorizeImport(declaration),
2680
+ sortKey: getImportSortKey(declaration)
2681
+ }));
2682
+ }
2683
+ //#endregion
2684
+ //#region src/lib/compare.ts
2685
+ function compare(a, b) {
2686
+ return a.localeCompare(b, "en", { sensitivity: "case" });
2687
+ }
2688
+ //#endregion
2689
+ //#region src/rules/sortedImports/importGroupOrder.ts
2690
+ var importGroupOrder = [
2691
+ "side-effect",
2692
+ "namespace",
2693
+ "default",
2694
+ "named",
2695
+ "type-namespace",
2696
+ "type-default",
2697
+ "type-named"
2698
+ ];
2699
+ //#endregion
2700
+ //#region src/rules/sortedImports/checkAlphabeticalSorting.ts
2701
+ function checkAlphabeticalSorting$1(categorizedImports) {
2702
+ const errors = [];
2703
+ for (const importGroup of importGroupOrder) {
2704
+ const groupImports = categorizedImports.filter((c) => c.group === importGroup);
2705
+ const expectedSortedImports = [...groupImports].sort((a, b) => compare(a.sortKey, b.sortKey));
2706
+ for (let i = 0; i < groupImports.length; i++) if (groupImports[i] !== expectedSortedImports[i]) errors.push({
2707
+ messageId: "sortedImports",
2708
+ node: groupImports[i].declaration
2709
+ });
2710
+ }
2711
+ return errors;
2712
+ }
2713
+ //#endregion
2714
+ //#region src/rules/sortedImports/checkGroupOrdering.ts
2715
+ function checkGroupOrdering$1(categorizedImports) {
2716
+ const errors = [];
2717
+ let currentGroupIndex = -1;
2718
+ for (const { declaration, group: importGroup } of categorizedImports) {
2719
+ const groupIndex = importGroupOrder.indexOf(importGroup);
2720
+ if (groupIndex < currentGroupIndex) errors.push({
2721
+ messageId: "wrongGroup",
2722
+ node: declaration
2723
+ });
2724
+ else currentGroupIndex = groupIndex;
2725
+ }
2726
+ return errors;
2727
+ }
2728
+ //#endregion
2729
+ //#region src/rules/sortedImports/getImportSpecifierName.ts
2730
+ function getImportSpecifierName(specifier) {
2731
+ return specifier.imported.type === "Identifier" ? specifier.imported.name : String(specifier.imported.value);
2732
+ }
2733
+ //#endregion
2734
+ //#region src/rules/sortedImports/areSpecifiersSorted.ts
2735
+ function areSpecifiersSorted$1(specifiers) {
2736
+ const names = specifiers.map((s) => getImportSpecifierName(s));
2737
+ const sorted = [...names].sort((a, b) => compare(a, b));
2738
+ return names.every((name, i) => name === sorted[i]);
2739
+ }
2740
+ //#endregion
2741
+ //#region src/rules/sortedImports/getImportNamedSpecifiers.ts
2742
+ function getImportNamedSpecifiers(declaration) {
2743
+ return declaration.specifiers.filter((s) => s.type === "ImportSpecifier");
2744
+ }
2745
+ //#endregion
2746
+ //#region src/rules/sortedImports/checkSpecifiersSorting.ts
2747
+ function checkSpecifiersSorting$1(categorized) {
2748
+ const errors = [];
2749
+ const namedImportDeclarations = categorized.filter((c) => c.group === "named");
2750
+ for (const { declaration } of namedImportDeclarations) {
2751
+ const namedSpecifiers = getImportNamedSpecifiers(declaration);
2752
+ if (namedSpecifiers.length > 1 && !areSpecifiersSorted$1(namedSpecifiers)) errors.push({
2753
+ messageId: "sortedNames",
2754
+ node: declaration
2755
+ });
2756
+ }
2757
+ return errors;
2758
+ }
2759
+ //#endregion
2760
+ //#region src/rules/sortedImports/sortImportSpecifiersText.ts
2761
+ function sortImportSpecifiersText(specifiers, sourceCode) {
2762
+ return [...specifiers].sort((a, b) => {
2763
+ return compare(getImportSpecifierName(a), getImportSpecifierName(b));
2764
+ }).map((s) => sourceCode.getText(s)).join(", ");
2765
+ }
2766
+ //#endregion
2767
+ //#region src/rules/sortedImports/createFix/formatNamedImportSpecifiers.ts
2768
+ function formatNamedImportSpecifiers(declaration, sourceCode) {
2769
+ const specifiers = getImportNamedSpecifiers(declaration);
2770
+ if (specifiers.length > 1 && !areSpecifiersSorted$1(specifiers)) {
2771
+ const sortedSpecifiers = sortImportSpecifiersText(specifiers, sourceCode);
2772
+ const source = declaration.source.value;
2773
+ return `${declaration.importKind === "type" ? "import type " : "import "}{${sortedSpecifiers}} from '${source}'`;
2774
+ }
2775
+ return sourceCode.getText(declaration);
2776
+ }
2777
+ //#endregion
2778
+ //#region src/rules/sortedImports/createFix/buildSortedImportCode.ts
2779
+ function buildSortedImportCode(grouped, sourceCode) {
2780
+ const sortedCode = [];
2781
+ for (const group of importGroupOrder) for (const { declaration } of grouped[group] ?? []) if (group === "named" || group === "type-named") sortedCode.push(formatNamedImportSpecifiers(declaration, sourceCode));
2782
+ else sortedCode.push(sourceCode.getText(declaration));
2783
+ return sortedCode;
2784
+ }
2785
+ //#endregion
2786
+ //#region src/rules/sortedImports/createFix/groupImportsByType.ts
2787
+ function groupImportsByType(categorized) {
2788
+ const grouped = {
2789
+ default: [],
2790
+ named: [],
2791
+ namespace: [],
2792
+ "side-effect": [],
2793
+ "type-default": [],
2794
+ "type-named": [],
2795
+ "type-namespace": []
2796
+ };
2797
+ for (const item of categorized) grouped[item.group].push(item);
2798
+ return grouped;
2799
+ }
2800
+ //#endregion
2801
+ //#region src/rules/sortedImports/createFix/sortImportGroups.ts
2802
+ function sortImportGroups(grouped) {
2803
+ grouped["side-effect"].sort((a, b) => compare(a.sortKey, b.sortKey));
2804
+ grouped["namespace"].sort((a, b) => compare(a.sortKey, b.sortKey));
2805
+ grouped["default"].sort((a, b) => compare(a.sortKey, b.sortKey));
2806
+ grouped["named"].sort((a, b) => compare(a.sortKey, b.sortKey));
2807
+ grouped["type-namespace"].sort((a, b) => compare(a.sortKey, b.sortKey));
2808
+ grouped["type-default"].sort((a, b) => compare(a.sortKey, b.sortKey));
2809
+ grouped["type-named"].sort((a, b) => compare(a.sortKey, b.sortKey));
2810
+ }
2811
+ //#endregion
2812
+ //#region src/rules/sortedImports/createFix/createFixForGroup.ts
2813
+ function createFixForGroup$1(fixer, importDeclarations, sourceCode) {
2814
+ if (importDeclarations.length === 0) return null;
2815
+ const grouped = groupImportsByType(categorizeImports(importDeclarations));
2816
+ sortImportGroups(grouped);
2817
+ const sortedCode = buildSortedImportCode(grouped, sourceCode).join("\n");
2818
+ const firstImport = importDeclarations[0];
2819
+ const lastImport = importDeclarations[importDeclarations.length - 1];
2820
+ return fixer.replaceTextRange([firstImport.range[0], lastImport.range[1]], sortedCode);
2821
+ }
2822
+ //#endregion
2823
+ //#region src/rules/sortedImports/createFix/index.ts
2824
+ function createImportFix(fixer, importGroups, sourceCode) {
2825
+ const fixes = [];
2826
+ for (const group of importGroups) {
2827
+ const fix = createFixForGroup$1(fixer, group, sourceCode);
2828
+ if (fix) fixes.push(fix);
2829
+ }
2830
+ return fixes;
2831
+ }
2832
+ //#endregion
2833
+ //#region src/rules/sortedImports/getImportGroups.ts
2834
+ function getImportGroups(programBody) {
2835
+ const groups = [];
2836
+ let currentImportGroup = [];
2837
+ for (const statement of programBody) {
2838
+ if (statement.type === "ImportDeclaration") {
2839
+ currentImportGroup.push(statement);
2840
+ continue;
2841
+ }
2842
+ if (currentImportGroup.length > 0) {
2843
+ groups.push(currentImportGroup);
2844
+ currentImportGroup = [];
2845
+ }
2846
+ }
2847
+ if (currentImportGroup.length > 0) groups.push(currentImportGroup);
2848
+ return groups;
2849
+ }
2850
+ //#endregion
2851
+ //#region src/rules/sortedImports/index.ts
2852
+ var sortedImports = {
2853
+ create(context) {
2854
+ return { Program(node) {
2855
+ const programBody = node.body;
2856
+ const importGroups = getImportGroups(programBody);
2857
+ if (importGroups.length === 0) return;
2858
+ const allImportErrors = [];
2859
+ for (const group of importGroups) {
2860
+ const categorized = categorizeImports(group);
2861
+ const errors = [
2862
+ ...checkGroupOrdering$1(categorized),
2863
+ ...checkAlphabeticalSorting$1(categorized),
2864
+ ...checkSpecifiersSorting$1(categorized)
2865
+ ];
2866
+ allImportErrors.push(...errors);
2867
+ }
2868
+ for (const error of allImportErrors) context.report({
2869
+ fix(fixer) {
2870
+ const sourceCode = context.sourceCode;
2871
+ return createImportFix(fixer, importGroups, sourceCode);
2872
+ },
2873
+ messageId: error.messageId,
2874
+ node: error.node
2875
+ });
2876
+ } };
2877
+ },
2878
+ meta: {
2879
+ docs: { description: "Enforce sorted imports alphabetically." },
2880
+ fixable: "code",
2881
+ messages: {
2882
+ sortedImports: "Imports should be sorted alphabetically",
2883
+ sortedNames: "Named imports should be sorted alphabetically",
2884
+ wrongGroup: "Import is in wrong group"
2885
+ },
2886
+ schema: [],
2887
+ type: "suggestion"
2888
+ }
2889
+ };
2890
+ //#endregion
2891
+ //#region src/rules/sortedReExports/categorizeReExport.ts
2892
+ function categorizeReExport(declaration) {
2893
+ if (declaration.type === "ExportAllDeclaration") {
2894
+ if (declaration.exportKind === "type") {
2895
+ if (declaration.exported) return "type-namespace";
2896
+ return "type-all";
2897
+ }
2898
+ if (declaration.exported) return "re-export-namespace";
2899
+ return "re-export-all";
2900
+ }
2901
+ if (declaration.exportKind === "type") return "type-named";
2902
+ if (declaration.specifiers?.some((s) => s.exportKind === "type")) return "type-named";
2903
+ return "re-export-named";
2904
+ }
2905
+ //#endregion
2906
+ //#region src/rules/sortedReExports/getReExportSortKey.ts
2907
+ function getReExportSortKey(declaration) {
2908
+ const group = categorizeReExport(declaration);
2909
+ if (declaration.type === "ExportAllDeclaration") {
2910
+ if (group === "re-export-namespace") {
2911
+ if (declaration.exported?.type === "Identifier") return `*${declaration.exported.name}`;
2912
+ }
2913
+ return declaration.source.value;
2914
+ }
2915
+ const specifier = declaration.specifiers[0];
2916
+ if (!specifier) return "";
2917
+ return specifier.local.type === "Identifier" ? specifier.local.name : specifier.local.value;
2918
+ }
2919
+ //#endregion
2920
+ //#region src/rules/sortedReExports/categorizeReExports.ts
2921
+ function categorizeReExports(declarations) {
2922
+ return declarations.map((declaration) => {
2923
+ return {
2924
+ declaration,
2925
+ group: categorizeReExport(declaration),
2926
+ sortKey: getReExportSortKey(declaration)
2927
+ };
2928
+ });
2929
+ }
2930
+ //#endregion
2931
+ //#region src/rules/sortedReExports/reExportGroupOrder.ts
2932
+ var reExportGroupOrder = [
2933
+ "re-export-all",
2934
+ "re-export-namespace",
2935
+ "re-export-named",
2936
+ "type-all",
2937
+ "type-namespace",
2938
+ "type-named"
2939
+ ];
2940
+ //#endregion
2941
+ //#region src/rules/sortedReExports/checkAlphabeticalSorting.ts
2942
+ function checkAlphabeticalSorting(categorized) {
2943
+ const errors = [];
2944
+ for (const group of reExportGroupOrder) {
2945
+ const groupReExports = categorized.filter((c) => c.group === group);
2946
+ const sorted = [...groupReExports].sort((a, b) => compare(a.sortKey, b.sortKey));
2947
+ for (let i = 0; i < groupReExports.length; i++) if (groupReExports[i] !== sorted[i]) errors.push({
2948
+ messageId: "sortedReExports",
2949
+ node: groupReExports[i].declaration
2950
+ });
2951
+ }
2952
+ return errors;
2953
+ }
2954
+ //#endregion
2955
+ //#region src/rules/sortedReExports/checkGroupOrdering.ts
2956
+ function checkGroupOrdering(categorized) {
2957
+ const errors = [];
2958
+ let currentGroupIndex = -1;
2959
+ for (const { declaration, group } of categorized) {
2960
+ const groupIndex = reExportGroupOrder.indexOf(group);
2961
+ if (groupIndex < currentGroupIndex) errors.push({
2962
+ messageId: "wrongGroup",
2963
+ node: declaration
2964
+ });
2965
+ else currentGroupIndex = groupIndex;
2966
+ }
2967
+ return errors;
2968
+ }
2969
+ //#endregion
2970
+ //#region src/rules/sortedReExports/getSpecifierName.ts
2971
+ function getSpecifierName(specifier) {
2972
+ return specifier.local.type === "Identifier" ? specifier.local.name : String(specifier.local.value);
2973
+ }
2974
+ //#endregion
2975
+ //#region src/rules/sortedReExports/areSpecifiersSorted.ts
2976
+ function areSpecifiersSorted(specifiers) {
2977
+ const names = specifiers.map((s) => getSpecifierName(s));
2978
+ const sorted = [...names].sort((a, b) => compare(a, b));
2979
+ return names.every((name, i) => name === sorted[i]);
2980
+ }
2981
+ //#endregion
2982
+ //#region src/rules/sortedReExports/getReExportNamedSpecifiers.ts
2983
+ function getReExportNamedSpecifiers(declaration) {
2984
+ return declaration.specifiers.filter((s) => s.type === "ExportSpecifier" && s.local.type === "Identifier");
2985
+ }
2986
+ //#endregion
2987
+ //#region src/rules/sortedReExports/isNamedReExport.ts
2988
+ function isNamedReExport(x) {
2989
+ return x.group !== "re-export-all" && x.group !== "re-export-namespace";
2990
+ }
2991
+ //#endregion
2992
+ //#region src/rules/sortedReExports/checkSpecifiersSorting.ts
2993
+ function checkSpecifiersSorting(categorized) {
2994
+ const errors = [];
2995
+ const namedReExports = categorized.filter(isNamedReExport);
2996
+ for (const { declaration } of namedReExports) {
2997
+ const specifiers = getReExportNamedSpecifiers(declaration);
2998
+ const isSorted = areSpecifiersSorted(specifiers);
2999
+ if (specifiers.length > 1 && !isSorted) errors.push({
3000
+ messageId: "sortedNames",
3001
+ node: declaration
3002
+ });
3003
+ }
3004
+ return errors;
3005
+ }
3006
+ //#endregion
3007
+ //#region src/rules/sortedReExports/sortSpecifiersText.ts
3008
+ function sortSpecifiersText(specifiers, sourceCode) {
3009
+ return [...specifiers].sort((a, b) => {
3010
+ return compare(getSpecifierName(a), getSpecifierName(b));
3011
+ }).map((s) => sourceCode.getText(s)).join(", ");
3012
+ }
3013
+ //#endregion
3014
+ //#region src/rules/sortedReExports/createFix/formatNamedReExportSpecifiers.ts
3015
+ function formatNamedReExportSpecifiers(declaration, sourceCode) {
3016
+ const specifiers = getReExportNamedSpecifiers(declaration);
3017
+ if (specifiers.length > 1 && !areSpecifiersSorted(specifiers)) {
3018
+ const sortedSpecifiers = sortSpecifiersText(specifiers, sourceCode);
3019
+ const source = declaration.source.value;
3020
+ return `${declaration.exportKind === "type" ? "export type " : "export "}{${sortedSpecifiers}} from '${source}'`;
3021
+ }
3022
+ return sourceCode.getText(declaration);
3023
+ }
3024
+ //#endregion
3025
+ //#region src/rules/sortedReExports/createFix/buildSortedReExportCode.ts
3026
+ function buildSortedReExportCode(grouped, sourceCode) {
3027
+ const sortedCode = [];
3028
+ for (const group of reExportGroupOrder) for (const item of grouped[group]) if (isNamedReExport(item)) sortedCode.push(formatNamedReExportSpecifiers(item.declaration, sourceCode));
3029
+ else sortedCode.push(sourceCode.getText(item.declaration));
3030
+ return sortedCode;
3031
+ }
3032
+ //#endregion
3033
+ //#region src/rules/sortedReExports/createFix/groupReExportsByType.ts
3034
+ function groupReExportsByType(categorized) {
3035
+ const grouped = {
3036
+ "re-export-all": [],
3037
+ "re-export-named": [],
3038
+ "re-export-namespace": [],
3039
+ "type-all": [],
3040
+ "type-named": [],
3041
+ "type-namespace": []
3042
+ };
3043
+ for (const item of categorized) grouped[item.group].push(item);
3044
+ return grouped;
3045
+ }
3046
+ //#endregion
3047
+ //#region src/rules/sortedReExports/createFix/sortExportGroups.ts
3048
+ function sortExportGroups(grouped) {
3049
+ grouped["re-export-all"].sort((a, b) => compare(a.sortKey, b.sortKey));
3050
+ grouped["re-export-namespace"].sort((a, b) => compare(a.sortKey, b.sortKey));
3051
+ grouped["re-export-named"].sort((a, b) => compare(a.sortKey, b.sortKey));
3052
+ grouped["type-all"].sort((a, b) => compare(a.sortKey, b.sortKey));
3053
+ grouped["type-namespace"].sort((a, b) => compare(a.sortKey, b.sortKey));
3054
+ grouped["type-named"].sort((a, b) => compare(a.sortKey, b.sortKey));
3055
+ }
3056
+ //#endregion
3057
+ //#region src/rules/sortedReExports/createFix/createFixForGroup.ts
3058
+ function createFixForGroup(fixer, reExportDeclarations, sourceCode) {
3059
+ if (reExportDeclarations.length === 0) return null;
3060
+ const grouped = groupReExportsByType(categorizeReExports(reExportDeclarations));
3061
+ sortExportGroups(grouped);
3062
+ const sortedCode = buildSortedReExportCode(grouped, sourceCode).join("\n");
3063
+ const firstReExport = reExportDeclarations[0];
3064
+ const lastReExport = reExportDeclarations[reExportDeclarations.length - 1];
3065
+ return fixer.replaceTextRange([firstReExport.range[0], lastReExport.range[1]], sortedCode);
3066
+ }
3067
+ //#endregion
3068
+ //#region src/rules/sortedReExports/createFix/index.ts
3069
+ function createReExportFix(fixer, reExportGroups, sourceCode) {
3070
+ const fixes = [];
3071
+ for (const group of reExportGroups) {
3072
+ const fix = createFixForGroup(fixer, group, sourceCode);
3073
+ if (fix) fixes.push(fix);
3074
+ }
3075
+ return fixes;
3076
+ }
3077
+ //#endregion
3078
+ //#region src/rules/sortedReExports/isReExportDeclaration.ts
3079
+ function isReExportDeclaration(statement) {
3080
+ return statement.type === "ExportNamedDeclaration" && statement.source !== null || statement.type === "ExportAllDeclaration";
3081
+ }
3082
+ //#endregion
3083
+ //#region src/rules/sortedReExports/getReExportGroups.ts
3084
+ function getReExportGroups(programBody) {
3085
+ const groups = [];
3086
+ let currentGroup = [];
3087
+ for (const statement of programBody) {
3088
+ if (isReExportDeclaration(statement)) {
3089
+ currentGroup.push(statement);
3090
+ continue;
3091
+ }
3092
+ if (currentGroup.length > 0) {
3093
+ groups.push(currentGroup);
3094
+ currentGroup = [];
3095
+ }
3096
+ }
3097
+ if (currentGroup.length > 0) groups.push(currentGroup);
3098
+ return groups;
3099
+ }
3100
+ //#endregion
3101
+ //#region src/main/customRules.ts
3102
+ var customRules = {
3103
+ plugins: { "@borela-tech": { rules: {
3104
+ "array-items-line-break": arrayItemsLineBreak,
3105
+ "brace-style-control-statements": braceStyleControlStatements,
3106
+ "brace-style-object-literal": braceStyleObjectLiteral,
3107
+ "compact-array-items": compactArrayItems,
3108
+ "export-filename-match": exportFilenameMatch,
3109
+ "function-call-argument-line-break": functionCallArgumentLineBreak,
3110
+ "function-cognitive-complexity": functionCognitiveComplexity,
3111
+ "function-parameter-line-break": functionParameterLineBreak,
3112
+ "imports-and-re-exports-at-top": importsAndReExportsAtTop,
3113
+ "individual-imports": individualImports,
3114
+ "individual-re-exports": individualReExports,
3115
+ "interface-property-line-break": interfacePropertyLineBreak,
3116
+ "max-declarations-per-file": maxDeclarationsPerFile,
3117
+ "multiline-union-type-aliases": multilineUnionTypeAliases,
3118
+ "naming-convention": namingConvention,
3119
+ "no-inline-object-types": noInlineObjectTypes,
3120
+ "no-unnecessary-braces": noUnnecessaryBraces,
3121
+ "object-property-line-break": objectPropertyLineBreak,
3122
+ "one-export-per-file": oneExportPerFile,
3123
+ "prefer-inline-export": preferInlineExport,
3124
+ "single-line-arrow-function-parameters": singleLineArrowFunctionParameters,
3125
+ "single-line-function-parameters": singleLineFunctionParameters,
3126
+ "single-line-imports": singleLineImports,
3127
+ "single-line-re-exports": singleLineReExports,
3128
+ "sorted-imports": sortedImports,
3129
+ "sorted-re-exports": {
3130
+ create(context) {
3131
+ return { Program(node) {
3132
+ const programBody = node.body;
3133
+ const reExportGroups = getReExportGroups(programBody);
3134
+ if (reExportGroups.length === 0) return;
3135
+ const allReExportErrors = [];
3136
+ for (const group of reExportGroups) {
3137
+ const categorizedReExports = categorizeReExports(group);
3138
+ const groupErrors = [
3139
+ ...checkGroupOrdering(categorizedReExports),
3140
+ ...checkAlphabeticalSorting(categorizedReExports),
3141
+ ...checkSpecifiersSorting(categorizedReExports)
3142
+ ];
3143
+ allReExportErrors.push(...groupErrors);
3144
+ }
3145
+ for (const error of allReExportErrors) context.report({
3146
+ fix(fixer) {
3147
+ const sourceCode = context.sourceCode;
3148
+ return createReExportFix(fixer, reExportGroups, sourceCode);
3149
+ },
3150
+ messageId: error.messageId,
3151
+ node: error.node
3152
+ });
3153
+ } };
3154
+ },
3155
+ meta: {
3156
+ docs: { description: "Enforce sorted exports alphabetically." },
3157
+ fixable: "code",
3158
+ messages: {
3159
+ sortedNames: "Named exports should be sorted alphabetically",
3160
+ sortedReExports: "Exports should be sorted alphabetically",
3161
+ wrongGroup: "Export is in wrong group"
3162
+ },
3163
+ schema: [],
3164
+ type: "suggestion"
3165
+ }
3166
+ }
3167
+ } } },
3168
+ rules: {
3169
+ "@borela-tech/array-items-line-break": ["error", { maxLength: 80 }],
3170
+ "@borela-tech/brace-style-control-statements": "error",
3171
+ "@borela-tech/brace-style-object-literal": "error",
3172
+ "@borela-tech/compact-array-items": "error",
3173
+ "@borela-tech/export-filename-match": "error",
3174
+ "@borela-tech/function-call-argument-line-break": ["error", { maxLength: 80 }],
3175
+ "@borela-tech/function-cognitive-complexity": ["error", { maxCognitiveComplexity: 15 }],
3176
+ "@borela-tech/function-parameter-line-break": ["error", { maxLength: 80 }],
3177
+ "@borela-tech/imports-and-re-exports-at-top": "error",
3178
+ "@borela-tech/individual-imports": "error",
3179
+ "@borela-tech/individual-re-exports": "error",
3180
+ "@borela-tech/interface-property-line-break": ["error", { maxLength: 80 }],
3181
+ "@borela-tech/max-declarations-per-file": "error",
3182
+ "@borela-tech/multiline-union-type-aliases": "error",
3183
+ "@borela-tech/naming-convention": "error",
3184
+ "@borela-tech/no-inline-object-types": "error",
3185
+ "@borela-tech/no-unnecessary-braces": "error",
3186
+ "@borela-tech/object-property-line-break": "error",
3187
+ "@borela-tech/one-export-per-file": "error",
3188
+ "@borela-tech/prefer-inline-export": "error",
3189
+ "@borela-tech/single-line-arrow-function-parameters": ["error", { maxLength: 80 }],
3190
+ "@borela-tech/single-line-function-parameters": ["error", { maxLength: 80 }],
3191
+ "@borela-tech/single-line-imports": "error",
3192
+ "@borela-tech/single-line-re-exports": "error",
3193
+ "@borela-tech/sorted-imports": "error",
3194
+ "@borela-tech/sorted-re-exports": "error"
3195
+ }
3196
+ };
3197
+ //#endregion
3198
+ //#region src/main/generalRules.ts
3199
+ var generalRules = { rules: {
3200
+ "capitalized-comments": [
3201
+ "error",
3202
+ "always",
3203
+ { ignoreConsecutiveComments: true }
3204
+ ],
3205
+ complexity: ["error", 10],
3206
+ "no-restricted-exports": ["error", { restrictDefaultExports: { direct: true } }],
3207
+ "react/react-in-jsx-scope": "off"
3208
+ } };
3209
+ //#endregion
3210
+ //#region src/main/ignores.ts
3211
+ var ignores = { ignores: [
3212
+ "src/graphql/sdk.ts",
3213
+ "**/node_modules/**",
3214
+ "**/dist/**"
3215
+ ] };
3216
+ //#endregion
3217
+ //#region src/main/languageOptions.ts
3218
+ var languageOptions = {
3219
+ languageOptions: { parserOptions: { projectService: true } },
3220
+ settings: { react: { version: "19" } }
3221
+ };
3222
+ //#endregion
3223
+ //#region src/main/perfectionistRules.ts
3224
+ var perfectionistRules = {
3225
+ plugins: { perfectionist: eslint_plugin_perfectionist.default },
3226
+ rules: {
3227
+ "perfectionist/sort-array-includes": ["error", {
3228
+ order: "asc",
3229
+ type: "natural"
3230
+ }],
3231
+ "perfectionist/sort-decorators": ["error", {
3232
+ order: "asc",
3233
+ type: "natural"
3234
+ }],
3235
+ "perfectionist/sort-enums": ["error", {
3236
+ order: "asc",
3237
+ type: "natural"
3238
+ }],
3239
+ "perfectionist/sort-heritage-clauses": ["error", {
3240
+ order: "asc",
3241
+ type: "natural"
3242
+ }],
3243
+ "perfectionist/sort-interfaces": ["error", {
3244
+ order: "asc",
3245
+ type: "natural"
3246
+ }],
3247
+ "perfectionist/sort-intersection-types": ["error", {
3248
+ order: "asc",
3249
+ type: "natural"
3250
+ }],
3251
+ "perfectionist/sort-jsx-props": ["error", {
3252
+ order: "asc",
3253
+ type: "natural"
3254
+ }],
3255
+ "perfectionist/sort-maps": ["error", {
3256
+ order: "asc",
3257
+ type: "natural"
3258
+ }],
3259
+ "perfectionist/sort-object-types": ["error", {
3260
+ order: "asc",
3261
+ type: "natural"
3262
+ }],
3263
+ "perfectionist/sort-objects": ["error", {
3264
+ order: "asc",
3265
+ type: "natural"
3266
+ }],
3267
+ "perfectionist/sort-sets": ["error", {
3268
+ order: "asc",
3269
+ type: "natural"
3270
+ }],
3271
+ "perfectionist/sort-switch-case": ["error", {
3272
+ order: "asc",
3273
+ type: "natural"
3274
+ }],
3275
+ "perfectionist/sort-union-types": ["error", {
3276
+ order: "asc",
3277
+ type: "natural"
3278
+ }]
3279
+ }
3280
+ };
3281
+ //#endregion
3282
+ //#region src/main/reactHooks.ts
3283
+ var reactHooks = {
3284
+ plugins: { "react-hooks": eslint_plugin_react_hooks.default },
3285
+ rules: eslint_plugin_react_hooks.default.configs.recommended.rules
3286
+ };
3287
+ //#endregion
3288
+ //#region src/main/stylisticRules.ts
3289
+ var stylisticRules = { rules: {
3290
+ "@stylistic/array-bracket-spacing": ["error", "never"],
3291
+ "@stylistic/arrow-parens": ["error", "as-needed"],
3292
+ "@stylistic/block-spacing": "off",
3293
+ "@stylistic/brace-style": [
3294
+ "error",
3295
+ "1tbs",
3296
+ { allowSingleLine: true }
3297
+ ],
3298
+ "@stylistic/indent": [
3299
+ "error",
3300
+ 2,
3301
+ { ignoredNodes: ["TSMappedType > *"] }
3302
+ ],
3303
+ "@stylistic/jsx-tag-spacing": ["error", {
3304
+ afterOpening: "never",
3305
+ beforeClosing: "never",
3306
+ beforeSelfClosing: "never",
3307
+ closingSlash: "never"
3308
+ }],
3309
+ "@stylistic/jsx-wrap-multilines": "off",
3310
+ "@stylistic/lines-between-class-members": "off",
3311
+ "@stylistic/object-curly-newline": "off",
3312
+ "@stylistic/object-curly-spacing": ["error", "never"],
3313
+ "@stylistic/operator-linebreak": [
3314
+ "error",
3315
+ "before",
3316
+ { overrides: { "=": "after" } }
3317
+ ],
3318
+ "@stylistic/quote-props": ["error", "as-needed"],
3319
+ "@stylistic/quotes": [
3320
+ "error",
3321
+ "single",
3322
+ { avoidEscape: true }
3323
+ ],
3324
+ "@stylistic/semi": [
3325
+ "error",
3326
+ "never",
3327
+ { beforeStatementContinuationChars: "always" }
3328
+ ]
3329
+ } };
3330
+ //#endregion
3331
+ //#region src/main/typescriptRules.ts
3332
+ var typescriptRules = { rules: {
3333
+ "@typescript-eslint/consistent-indexed-object-style": "off",
3334
+ "@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "separate-type-imports" }],
3335
+ "@typescript-eslint/explicit-function-return-type": ["error", { allowExpressions: true }],
3336
+ "@typescript-eslint/no-empty-function": "off",
3337
+ "@typescript-eslint/no-unused-vars": ["error", {
3338
+ argsIgnorePattern: "^_",
3339
+ caughtErrorsIgnorePattern: "^_",
3340
+ varsIgnorePattern: "^_"
3341
+ }]
3342
+ } };
3343
+ //#endregion
3344
+ //#region node_modules/globals/globals.json
3345
+ var globals_exports = /* @__PURE__ */ __exportAll({
3346
+ amd: () => amd,
3347
+ applescript: () => applescript,
3348
+ atomtest: () => atomtest,
3349
+ browser: () => browser,
3350
+ builtin: () => builtin,
3351
+ commonjs: () => commonjs,
3352
+ couch: () => couch,
3353
+ default: () => globals_default,
3354
+ devtools: () => devtools,
3355
+ embertest: () => embertest,
3356
+ es2015: () => es2015,
3357
+ es2017: () => es2017,
3358
+ es2020: () => es2020,
3359
+ es2021: () => es2021,
3360
+ es5: () => es5,
3361
+ greasemonkey: () => greasemonkey,
3362
+ jasmine: () => jasmine,
3363
+ jest: () => jest,
3364
+ jquery: () => jquery,
3365
+ meteor: () => meteor,
3366
+ mocha: () => mocha,
3367
+ mongo: () => mongo,
3368
+ nashorn: () => nashorn,
3369
+ node: () => node,
3370
+ nodeBuiltin: () => nodeBuiltin,
3371
+ phantomjs: () => phantomjs,
3372
+ prototypejs: () => prototypejs,
3373
+ protractor: () => protractor,
3374
+ qunit: () => qunit,
3375
+ rhino: () => rhino,
3376
+ serviceworker: () => serviceworker,
3377
+ shelljs: () => shelljs,
3378
+ webextensions: () => webextensions,
3379
+ worker: () => worker,
3380
+ wsh: () => wsh,
3381
+ yui: () => yui
3382
+ });
3383
+ var builtin, es5, es2015, es2017, es2020, es2021, browser, worker, node, nodeBuiltin, commonjs, amd, mocha, jasmine, jest, qunit, phantomjs, couch, rhino, nashorn, wsh, jquery, yui, shelljs, prototypejs, meteor, mongo, applescript, serviceworker, atomtest, embertest, protractor, webextensions, greasemonkey, devtools, globals_default;
3384
+ var init_globals = __esmMin((() => {
3385
+ builtin = {
3386
+ "AggregateError": false,
3387
+ "Array": false,
3388
+ "ArrayBuffer": false,
3389
+ "Atomics": false,
3390
+ "BigInt": false,
3391
+ "BigInt64Array": false,
3392
+ "BigUint64Array": false,
3393
+ "Boolean": false,
3394
+ "constructor": false,
3395
+ "DataView": false,
3396
+ "Date": false,
3397
+ "decodeURI": false,
3398
+ "decodeURIComponent": false,
3399
+ "encodeURI": false,
3400
+ "encodeURIComponent": false,
3401
+ "Error": false,
3402
+ "escape": false,
3403
+ "eval": false,
3404
+ "EvalError": false,
3405
+ "FinalizationRegistry": false,
3406
+ "Float32Array": false,
3407
+ "Float64Array": false,
3408
+ "Function": false,
3409
+ "globalThis": false,
3410
+ "hasOwnProperty": false,
3411
+ "Infinity": false,
3412
+ "Int16Array": false,
3413
+ "Int32Array": false,
3414
+ "Int8Array": false,
3415
+ "isFinite": false,
3416
+ "isNaN": false,
3417
+ "isPrototypeOf": false,
3418
+ "JSON": false,
3419
+ "Map": false,
3420
+ "Math": false,
3421
+ "NaN": false,
3422
+ "Number": false,
3423
+ "Object": false,
3424
+ "parseFloat": false,
3425
+ "parseInt": false,
3426
+ "Promise": false,
3427
+ "propertyIsEnumerable": false,
3428
+ "Proxy": false,
3429
+ "RangeError": false,
3430
+ "ReferenceError": false,
3431
+ "Reflect": false,
3432
+ "RegExp": false,
3433
+ "Set": false,
3434
+ "SharedArrayBuffer": false,
3435
+ "String": false,
3436
+ "Symbol": false,
3437
+ "SyntaxError": false,
3438
+ "toLocaleString": false,
3439
+ "toString": false,
3440
+ "TypeError": false,
3441
+ "Uint16Array": false,
3442
+ "Uint32Array": false,
3443
+ "Uint8Array": false,
3444
+ "Uint8ClampedArray": false,
3445
+ "undefined": false,
3446
+ "unescape": false,
3447
+ "URIError": false,
3448
+ "valueOf": false,
3449
+ "WeakMap": false,
3450
+ "WeakRef": false,
3451
+ "WeakSet": false
3452
+ };
3453
+ es5 = {
3454
+ "Array": false,
3455
+ "Boolean": false,
3456
+ "constructor": false,
3457
+ "Date": false,
3458
+ "decodeURI": false,
3459
+ "decodeURIComponent": false,
3460
+ "encodeURI": false,
3461
+ "encodeURIComponent": false,
3462
+ "Error": false,
3463
+ "escape": false,
3464
+ "eval": false,
3465
+ "EvalError": false,
3466
+ "Function": false,
3467
+ "hasOwnProperty": false,
3468
+ "Infinity": false,
3469
+ "isFinite": false,
3470
+ "isNaN": false,
3471
+ "isPrototypeOf": false,
3472
+ "JSON": false,
3473
+ "Math": false,
3474
+ "NaN": false,
3475
+ "Number": false,
3476
+ "Object": false,
3477
+ "parseFloat": false,
3478
+ "parseInt": false,
3479
+ "propertyIsEnumerable": false,
3480
+ "RangeError": false,
3481
+ "ReferenceError": false,
3482
+ "RegExp": false,
3483
+ "String": false,
3484
+ "SyntaxError": false,
3485
+ "toLocaleString": false,
3486
+ "toString": false,
3487
+ "TypeError": false,
3488
+ "undefined": false,
3489
+ "unescape": false,
3490
+ "URIError": false,
3491
+ "valueOf": false
3492
+ };
3493
+ es2015 = {
3494
+ "Array": false,
3495
+ "ArrayBuffer": false,
3496
+ "Boolean": false,
3497
+ "constructor": false,
3498
+ "DataView": false,
3499
+ "Date": false,
3500
+ "decodeURI": false,
3501
+ "decodeURIComponent": false,
3502
+ "encodeURI": false,
3503
+ "encodeURIComponent": false,
3504
+ "Error": false,
3505
+ "escape": false,
3506
+ "eval": false,
3507
+ "EvalError": false,
3508
+ "Float32Array": false,
3509
+ "Float64Array": false,
3510
+ "Function": false,
3511
+ "hasOwnProperty": false,
3512
+ "Infinity": false,
3513
+ "Int16Array": false,
3514
+ "Int32Array": false,
3515
+ "Int8Array": false,
3516
+ "isFinite": false,
3517
+ "isNaN": false,
3518
+ "isPrototypeOf": false,
3519
+ "JSON": false,
3520
+ "Map": false,
3521
+ "Math": false,
3522
+ "NaN": false,
3523
+ "Number": false,
3524
+ "Object": false,
3525
+ "parseFloat": false,
3526
+ "parseInt": false,
3527
+ "Promise": false,
3528
+ "propertyIsEnumerable": false,
3529
+ "Proxy": false,
3530
+ "RangeError": false,
3531
+ "ReferenceError": false,
3532
+ "Reflect": false,
3533
+ "RegExp": false,
3534
+ "Set": false,
3535
+ "String": false,
3536
+ "Symbol": false,
3537
+ "SyntaxError": false,
3538
+ "toLocaleString": false,
3539
+ "toString": false,
3540
+ "TypeError": false,
3541
+ "Uint16Array": false,
3542
+ "Uint32Array": false,
3543
+ "Uint8Array": false,
3544
+ "Uint8ClampedArray": false,
3545
+ "undefined": false,
3546
+ "unescape": false,
3547
+ "URIError": false,
3548
+ "valueOf": false,
3549
+ "WeakMap": false,
3550
+ "WeakSet": false
3551
+ };
3552
+ es2017 = {
3553
+ "Array": false,
3554
+ "ArrayBuffer": false,
3555
+ "Atomics": false,
3556
+ "Boolean": false,
3557
+ "constructor": false,
3558
+ "DataView": false,
3559
+ "Date": false,
3560
+ "decodeURI": false,
3561
+ "decodeURIComponent": false,
3562
+ "encodeURI": false,
3563
+ "encodeURIComponent": false,
3564
+ "Error": false,
3565
+ "escape": false,
3566
+ "eval": false,
3567
+ "EvalError": false,
3568
+ "Float32Array": false,
3569
+ "Float64Array": false,
3570
+ "Function": false,
3571
+ "hasOwnProperty": false,
3572
+ "Infinity": false,
3573
+ "Int16Array": false,
3574
+ "Int32Array": false,
3575
+ "Int8Array": false,
3576
+ "isFinite": false,
3577
+ "isNaN": false,
3578
+ "isPrototypeOf": false,
3579
+ "JSON": false,
3580
+ "Map": false,
3581
+ "Math": false,
3582
+ "NaN": false,
3583
+ "Number": false,
3584
+ "Object": false,
3585
+ "parseFloat": false,
3586
+ "parseInt": false,
3587
+ "Promise": false,
3588
+ "propertyIsEnumerable": false,
3589
+ "Proxy": false,
3590
+ "RangeError": false,
3591
+ "ReferenceError": false,
3592
+ "Reflect": false,
3593
+ "RegExp": false,
3594
+ "Set": false,
3595
+ "SharedArrayBuffer": false,
3596
+ "String": false,
3597
+ "Symbol": false,
3598
+ "SyntaxError": false,
3599
+ "toLocaleString": false,
3600
+ "toString": false,
3601
+ "TypeError": false,
3602
+ "Uint16Array": false,
3603
+ "Uint32Array": false,
3604
+ "Uint8Array": false,
3605
+ "Uint8ClampedArray": false,
3606
+ "undefined": false,
3607
+ "unescape": false,
3608
+ "URIError": false,
3609
+ "valueOf": false,
3610
+ "WeakMap": false,
3611
+ "WeakSet": false
3612
+ };
3613
+ es2020 = {
3614
+ "Array": false,
3615
+ "ArrayBuffer": false,
3616
+ "Atomics": false,
3617
+ "BigInt": false,
3618
+ "BigInt64Array": false,
3619
+ "BigUint64Array": false,
3620
+ "Boolean": false,
3621
+ "constructor": false,
3622
+ "DataView": false,
3623
+ "Date": false,
3624
+ "decodeURI": false,
3625
+ "decodeURIComponent": false,
3626
+ "encodeURI": false,
3627
+ "encodeURIComponent": false,
3628
+ "Error": false,
3629
+ "escape": false,
3630
+ "eval": false,
3631
+ "EvalError": false,
3632
+ "Float32Array": false,
3633
+ "Float64Array": false,
3634
+ "Function": false,
3635
+ "globalThis": false,
3636
+ "hasOwnProperty": false,
3637
+ "Infinity": false,
3638
+ "Int16Array": false,
3639
+ "Int32Array": false,
3640
+ "Int8Array": false,
3641
+ "isFinite": false,
3642
+ "isNaN": false,
3643
+ "isPrototypeOf": false,
3644
+ "JSON": false,
3645
+ "Map": false,
3646
+ "Math": false,
3647
+ "NaN": false,
3648
+ "Number": false,
3649
+ "Object": false,
3650
+ "parseFloat": false,
3651
+ "parseInt": false,
3652
+ "Promise": false,
3653
+ "propertyIsEnumerable": false,
3654
+ "Proxy": false,
3655
+ "RangeError": false,
3656
+ "ReferenceError": false,
3657
+ "Reflect": false,
3658
+ "RegExp": false,
3659
+ "Set": false,
3660
+ "SharedArrayBuffer": false,
3661
+ "String": false,
3662
+ "Symbol": false,
3663
+ "SyntaxError": false,
3664
+ "toLocaleString": false,
3665
+ "toString": false,
3666
+ "TypeError": false,
3667
+ "Uint16Array": false,
3668
+ "Uint32Array": false,
3669
+ "Uint8Array": false,
3670
+ "Uint8ClampedArray": false,
3671
+ "undefined": false,
3672
+ "unescape": false,
3673
+ "URIError": false,
3674
+ "valueOf": false,
3675
+ "WeakMap": false,
3676
+ "WeakSet": false
3677
+ };
3678
+ es2021 = {
3679
+ "AggregateError": false,
3680
+ "Array": false,
3681
+ "ArrayBuffer": false,
3682
+ "Atomics": false,
3683
+ "BigInt": false,
3684
+ "BigInt64Array": false,
3685
+ "BigUint64Array": false,
3686
+ "Boolean": false,
3687
+ "constructor": false,
3688
+ "DataView": false,
3689
+ "Date": false,
3690
+ "decodeURI": false,
3691
+ "decodeURIComponent": false,
3692
+ "encodeURI": false,
3693
+ "encodeURIComponent": false,
3694
+ "Error": false,
3695
+ "escape": false,
3696
+ "eval": false,
3697
+ "EvalError": false,
3698
+ "FinalizationRegistry": false,
3699
+ "Float32Array": false,
3700
+ "Float64Array": false,
3701
+ "Function": false,
3702
+ "globalThis": false,
3703
+ "hasOwnProperty": false,
3704
+ "Infinity": false,
3705
+ "Int16Array": false,
3706
+ "Int32Array": false,
3707
+ "Int8Array": false,
3708
+ "isFinite": false,
3709
+ "isNaN": false,
3710
+ "isPrototypeOf": false,
3711
+ "JSON": false,
3712
+ "Map": false,
3713
+ "Math": false,
3714
+ "NaN": false,
3715
+ "Number": false,
3716
+ "Object": false,
3717
+ "parseFloat": false,
3718
+ "parseInt": false,
3719
+ "Promise": false,
3720
+ "propertyIsEnumerable": false,
3721
+ "Proxy": false,
3722
+ "RangeError": false,
3723
+ "ReferenceError": false,
3724
+ "Reflect": false,
3725
+ "RegExp": false,
3726
+ "Set": false,
3727
+ "SharedArrayBuffer": false,
3728
+ "String": false,
3729
+ "Symbol": false,
3730
+ "SyntaxError": false,
3731
+ "toLocaleString": false,
3732
+ "toString": false,
3733
+ "TypeError": false,
3734
+ "Uint16Array": false,
3735
+ "Uint32Array": false,
3736
+ "Uint8Array": false,
3737
+ "Uint8ClampedArray": false,
3738
+ "undefined": false,
3739
+ "unescape": false,
3740
+ "URIError": false,
3741
+ "valueOf": false,
3742
+ "WeakMap": false,
3743
+ "WeakRef": false,
3744
+ "WeakSet": false
3745
+ };
3746
+ browser = /* @__PURE__ */ JSON.parse("{\"AbortController\":false,\"AbortSignal\":false,\"addEventListener\":false,\"alert\":false,\"AnalyserNode\":false,\"Animation\":false,\"AnimationEffectReadOnly\":false,\"AnimationEffectTiming\":false,\"AnimationEffectTimingReadOnly\":false,\"AnimationEvent\":false,\"AnimationPlaybackEvent\":false,\"AnimationTimeline\":false,\"applicationCache\":false,\"ApplicationCache\":false,\"ApplicationCacheErrorEvent\":false,\"atob\":false,\"Attr\":false,\"Audio\":false,\"AudioBuffer\":false,\"AudioBufferSourceNode\":false,\"AudioContext\":false,\"AudioDestinationNode\":false,\"AudioListener\":false,\"AudioNode\":false,\"AudioParam\":false,\"AudioProcessingEvent\":false,\"AudioScheduledSourceNode\":false,\"AudioWorkletGlobalScope\":false,\"AudioWorkletNode\":false,\"AudioWorkletProcessor\":false,\"BarProp\":false,\"BaseAudioContext\":false,\"BatteryManager\":false,\"BeforeUnloadEvent\":false,\"BiquadFilterNode\":false,\"Blob\":false,\"BlobEvent\":false,\"blur\":false,\"BroadcastChannel\":false,\"btoa\":false,\"BudgetService\":false,\"ByteLengthQueuingStrategy\":false,\"Cache\":false,\"caches\":false,\"CacheStorage\":false,\"cancelAnimationFrame\":false,\"cancelIdleCallback\":false,\"CanvasCaptureMediaStreamTrack\":false,\"CanvasGradient\":false,\"CanvasPattern\":false,\"CanvasRenderingContext2D\":false,\"ChannelMergerNode\":false,\"ChannelSplitterNode\":false,\"CharacterData\":false,\"clearInterval\":false,\"clearTimeout\":false,\"clientInformation\":false,\"ClipboardEvent\":false,\"ClipboardItem\":false,\"close\":false,\"closed\":false,\"CloseEvent\":false,\"Comment\":false,\"CompositionEvent\":false,\"CompressionStream\":false,\"confirm\":false,\"console\":false,\"ConstantSourceNode\":false,\"ConvolverNode\":false,\"CountQueuingStrategy\":false,\"createImageBitmap\":false,\"Credential\":false,\"CredentialsContainer\":false,\"crypto\":false,\"Crypto\":false,\"CryptoKey\":false,\"CSS\":false,\"CSSConditionRule\":false,\"CSSFontFaceRule\":false,\"CSSGroupingRule\":false,\"CSSImportRule\":false,\"CSSKeyframeRule\":false,\"CSSKeyframesRule\":false,\"CSSMatrixComponent\":false,\"CSSMediaRule\":false,\"CSSNamespaceRule\":false,\"CSSPageRule\":false,\"CSSPerspective\":false,\"CSSRotate\":false,\"CSSRule\":false,\"CSSRuleList\":false,\"CSSScale\":false,\"CSSSkew\":false,\"CSSSkewX\":false,\"CSSSkewY\":false,\"CSSStyleDeclaration\":false,\"CSSStyleRule\":false,\"CSSStyleSheet\":false,\"CSSSupportsRule\":false,\"CSSTransformValue\":false,\"CSSTranslate\":false,\"CustomElementRegistry\":false,\"customElements\":false,\"CustomEvent\":false,\"DataTransfer\":false,\"DataTransferItem\":false,\"DataTransferItemList\":false,\"DecompressionStream\":false,\"defaultstatus\":false,\"defaultStatus\":false,\"DelayNode\":false,\"DeviceMotionEvent\":false,\"DeviceOrientationEvent\":false,\"devicePixelRatio\":false,\"dispatchEvent\":false,\"document\":false,\"Document\":false,\"DocumentFragment\":false,\"DocumentType\":false,\"DOMError\":false,\"DOMException\":false,\"DOMImplementation\":false,\"DOMMatrix\":false,\"DOMMatrixReadOnly\":false,\"DOMParser\":false,\"DOMPoint\":false,\"DOMPointReadOnly\":false,\"DOMQuad\":false,\"DOMRect\":false,\"DOMRectList\":false,\"DOMRectReadOnly\":false,\"DOMStringList\":false,\"DOMStringMap\":false,\"DOMTokenList\":false,\"DragEvent\":false,\"DynamicsCompressorNode\":false,\"Element\":false,\"ErrorEvent\":false,\"event\":false,\"Event\":false,\"EventSource\":false,\"EventTarget\":false,\"external\":false,\"fetch\":false,\"File\":false,\"FileList\":false,\"FileReader\":false,\"find\":false,\"focus\":false,\"FocusEvent\":false,\"FontFace\":false,\"FontFaceSetLoadEvent\":false,\"FormData\":false,\"FormDataEvent\":false,\"frameElement\":false,\"frames\":false,\"GainNode\":false,\"Gamepad\":false,\"GamepadButton\":false,\"GamepadEvent\":false,\"getComputedStyle\":false,\"getSelection\":false,\"HashChangeEvent\":false,\"Headers\":false,\"history\":false,\"History\":false,\"HTMLAllCollection\":false,\"HTMLAnchorElement\":false,\"HTMLAreaElement\":false,\"HTMLAudioElement\":false,\"HTMLBaseElement\":false,\"HTMLBodyElement\":false,\"HTMLBRElement\":false,\"HTMLButtonElement\":false,\"HTMLCanvasElement\":false,\"HTMLCollection\":false,\"HTMLContentElement\":false,\"HTMLDataElement\":false,\"HTMLDataListElement\":false,\"HTMLDetailsElement\":false,\"HTMLDialogElement\":false,\"HTMLDirectoryElement\":false,\"HTMLDivElement\":false,\"HTMLDListElement\":false,\"HTMLDocument\":false,\"HTMLElement\":false,\"HTMLEmbedElement\":false,\"HTMLFieldSetElement\":false,\"HTMLFontElement\":false,\"HTMLFormControlsCollection\":false,\"HTMLFormElement\":false,\"HTMLFrameElement\":false,\"HTMLFrameSetElement\":false,\"HTMLHeadElement\":false,\"HTMLHeadingElement\":false,\"HTMLHRElement\":false,\"HTMLHtmlElement\":false,\"HTMLIFrameElement\":false,\"HTMLImageElement\":false,\"HTMLInputElement\":false,\"HTMLLabelElement\":false,\"HTMLLegendElement\":false,\"HTMLLIElement\":false,\"HTMLLinkElement\":false,\"HTMLMapElement\":false,\"HTMLMarqueeElement\":false,\"HTMLMediaElement\":false,\"HTMLMenuElement\":false,\"HTMLMetaElement\":false,\"HTMLMeterElement\":false,\"HTMLModElement\":false,\"HTMLObjectElement\":false,\"HTMLOListElement\":false,\"HTMLOptGroupElement\":false,\"HTMLOptionElement\":false,\"HTMLOptionsCollection\":false,\"HTMLOutputElement\":false,\"HTMLParagraphElement\":false,\"HTMLParamElement\":false,\"HTMLPictureElement\":false,\"HTMLPreElement\":false,\"HTMLProgressElement\":false,\"HTMLQuoteElement\":false,\"HTMLScriptElement\":false,\"HTMLSelectElement\":false,\"HTMLShadowElement\":false,\"HTMLSlotElement\":false,\"HTMLSourceElement\":false,\"HTMLSpanElement\":false,\"HTMLStyleElement\":false,\"HTMLTableCaptionElement\":false,\"HTMLTableCellElement\":false,\"HTMLTableColElement\":false,\"HTMLTableElement\":false,\"HTMLTableRowElement\":false,\"HTMLTableSectionElement\":false,\"HTMLTemplateElement\":false,\"HTMLTextAreaElement\":false,\"HTMLTimeElement\":false,\"HTMLTitleElement\":false,\"HTMLTrackElement\":false,\"HTMLUListElement\":false,\"HTMLUnknownElement\":false,\"HTMLVideoElement\":false,\"IDBCursor\":false,\"IDBCursorWithValue\":false,\"IDBDatabase\":false,\"IDBFactory\":false,\"IDBIndex\":false,\"IDBKeyRange\":false,\"IDBObjectStore\":false,\"IDBOpenDBRequest\":false,\"IDBRequest\":false,\"IDBTransaction\":false,\"IDBVersionChangeEvent\":false,\"IdleDeadline\":false,\"IIRFilterNode\":false,\"Image\":false,\"ImageBitmap\":false,\"ImageBitmapRenderingContext\":false,\"ImageCapture\":false,\"ImageData\":false,\"indexedDB\":false,\"innerHeight\":false,\"innerWidth\":false,\"InputEvent\":false,\"IntersectionObserver\":false,\"IntersectionObserverEntry\":false,\"Intl\":false,\"isSecureContext\":false,\"KeyboardEvent\":false,\"KeyframeEffect\":false,\"KeyframeEffectReadOnly\":false,\"length\":false,\"localStorage\":false,\"location\":true,\"Location\":false,\"locationbar\":false,\"matchMedia\":false,\"MediaDeviceInfo\":false,\"MediaDevices\":false,\"MediaElementAudioSourceNode\":false,\"MediaEncryptedEvent\":false,\"MediaError\":false,\"MediaKeyMessageEvent\":false,\"MediaKeySession\":false,\"MediaKeyStatusMap\":false,\"MediaKeySystemAccess\":false,\"MediaList\":false,\"MediaMetadata\":false,\"MediaQueryList\":false,\"MediaQueryListEvent\":false,\"MediaRecorder\":false,\"MediaSettingsRange\":false,\"MediaSource\":false,\"MediaStream\":false,\"MediaStreamAudioDestinationNode\":false,\"MediaStreamAudioSourceNode\":false,\"MediaStreamConstraints\":false,\"MediaStreamEvent\":false,\"MediaStreamTrack\":false,\"MediaStreamTrackEvent\":false,\"menubar\":false,\"MessageChannel\":false,\"MessageEvent\":false,\"MessagePort\":false,\"MIDIAccess\":false,\"MIDIConnectionEvent\":false,\"MIDIInput\":false,\"MIDIInputMap\":false,\"MIDIMessageEvent\":false,\"MIDIOutput\":false,\"MIDIOutputMap\":false,\"MIDIPort\":false,\"MimeType\":false,\"MimeTypeArray\":false,\"MouseEvent\":false,\"moveBy\":false,\"moveTo\":false,\"MutationEvent\":false,\"MutationObserver\":false,\"MutationRecord\":false,\"name\":false,\"NamedNodeMap\":false,\"NavigationPreloadManager\":false,\"navigator\":false,\"Navigator\":false,\"NavigatorUAData\":false,\"NetworkInformation\":false,\"Node\":false,\"NodeFilter\":false,\"NodeIterator\":false,\"NodeList\":false,\"Notification\":false,\"OfflineAudioCompletionEvent\":false,\"OfflineAudioContext\":false,\"offscreenBuffering\":false,\"OffscreenCanvas\":true,\"OffscreenCanvasRenderingContext2D\":false,\"onabort\":true,\"onafterprint\":true,\"onanimationend\":true,\"onanimationiteration\":true,\"onanimationstart\":true,\"onappinstalled\":true,\"onauxclick\":true,\"onbeforeinstallprompt\":true,\"onbeforeprint\":true,\"onbeforeunload\":true,\"onblur\":true,\"oncancel\":true,\"oncanplay\":true,\"oncanplaythrough\":true,\"onchange\":true,\"onclick\":true,\"onclose\":true,\"oncontextmenu\":true,\"oncuechange\":true,\"ondblclick\":true,\"ondevicemotion\":true,\"ondeviceorientation\":true,\"ondeviceorientationabsolute\":true,\"ondrag\":true,\"ondragend\":true,\"ondragenter\":true,\"ondragleave\":true,\"ondragover\":true,\"ondragstart\":true,\"ondrop\":true,\"ondurationchange\":true,\"onemptied\":true,\"onended\":true,\"onerror\":true,\"onfocus\":true,\"ongotpointercapture\":true,\"onhashchange\":true,\"oninput\":true,\"oninvalid\":true,\"onkeydown\":true,\"onkeypress\":true,\"onkeyup\":true,\"onlanguagechange\":true,\"onload\":true,\"onloadeddata\":true,\"onloadedmetadata\":true,\"onloadstart\":true,\"onlostpointercapture\":true,\"onmessage\":true,\"onmessageerror\":true,\"onmousedown\":true,\"onmouseenter\":true,\"onmouseleave\":true,\"onmousemove\":true,\"onmouseout\":true,\"onmouseover\":true,\"onmouseup\":true,\"onmousewheel\":true,\"onoffline\":true,\"ononline\":true,\"onpagehide\":true,\"onpageshow\":true,\"onpause\":true,\"onplay\":true,\"onplaying\":true,\"onpointercancel\":true,\"onpointerdown\":true,\"onpointerenter\":true,\"onpointerleave\":true,\"onpointermove\":true,\"onpointerout\":true,\"onpointerover\":true,\"onpointerup\":true,\"onpopstate\":true,\"onprogress\":true,\"onratechange\":true,\"onrejectionhandled\":true,\"onreset\":true,\"onresize\":true,\"onscroll\":true,\"onsearch\":true,\"onseeked\":true,\"onseeking\":true,\"onselect\":true,\"onstalled\":true,\"onstorage\":true,\"onsubmit\":true,\"onsuspend\":true,\"ontimeupdate\":true,\"ontoggle\":true,\"ontransitionend\":true,\"onunhandledrejection\":true,\"onunload\":true,\"onvolumechange\":true,\"onwaiting\":true,\"onwheel\":true,\"open\":false,\"openDatabase\":false,\"opener\":false,\"Option\":false,\"origin\":false,\"OscillatorNode\":false,\"outerHeight\":false,\"outerWidth\":false,\"OverconstrainedError\":false,\"PageTransitionEvent\":false,\"pageXOffset\":false,\"pageYOffset\":false,\"PannerNode\":false,\"parent\":false,\"Path2D\":false,\"PaymentAddress\":false,\"PaymentRequest\":false,\"PaymentRequestUpdateEvent\":false,\"PaymentResponse\":false,\"performance\":false,\"Performance\":false,\"PerformanceEntry\":false,\"PerformanceLongTaskTiming\":false,\"PerformanceMark\":false,\"PerformanceMeasure\":false,\"PerformanceNavigation\":false,\"PerformanceNavigationTiming\":false,\"PerformanceObserver\":false,\"PerformanceObserverEntryList\":false,\"PerformancePaintTiming\":false,\"PerformanceResourceTiming\":false,\"PerformanceTiming\":false,\"PeriodicWave\":false,\"Permissions\":false,\"PermissionStatus\":false,\"personalbar\":false,\"PhotoCapabilities\":false,\"Plugin\":false,\"PluginArray\":false,\"PointerEvent\":false,\"PopStateEvent\":false,\"postMessage\":false,\"Presentation\":false,\"PresentationAvailability\":false,\"PresentationConnection\":false,\"PresentationConnectionAvailableEvent\":false,\"PresentationConnectionCloseEvent\":false,\"PresentationConnectionList\":false,\"PresentationReceiver\":false,\"PresentationRequest\":false,\"print\":false,\"ProcessingInstruction\":false,\"ProgressEvent\":false,\"PromiseRejectionEvent\":false,\"prompt\":false,\"PushManager\":false,\"PushSubscription\":false,\"PushSubscriptionOptions\":false,\"queueMicrotask\":false,\"RadioNodeList\":false,\"Range\":false,\"ReadableByteStreamController\":false,\"ReadableStream\":false,\"ReadableStreamBYOBReader\":false,\"ReadableStreamBYOBRequest\":false,\"ReadableStreamDefaultController\":false,\"ReadableStreamDefaultReader\":false,\"registerProcessor\":false,\"RemotePlayback\":false,\"removeEventListener\":false,\"reportError\":false,\"Request\":false,\"requestAnimationFrame\":false,\"requestIdleCallback\":false,\"resizeBy\":false,\"ResizeObserver\":false,\"ResizeObserverEntry\":false,\"resizeTo\":false,\"Response\":false,\"RTCCertificate\":false,\"RTCDataChannel\":false,\"RTCDataChannelEvent\":false,\"RTCDtlsTransport\":false,\"RTCIceCandidate\":false,\"RTCIceGatherer\":false,\"RTCIceTransport\":false,\"RTCPeerConnection\":false,\"RTCPeerConnectionIceEvent\":false,\"RTCRtpContributingSource\":false,\"RTCRtpReceiver\":false,\"RTCRtpSender\":false,\"RTCSctpTransport\":false,\"RTCSessionDescription\":false,\"RTCStatsReport\":false,\"RTCTrackEvent\":false,\"screen\":false,\"Screen\":false,\"screenLeft\":false,\"ScreenOrientation\":false,\"screenTop\":false,\"screenX\":false,\"screenY\":false,\"ScriptProcessorNode\":false,\"scroll\":false,\"scrollbars\":false,\"scrollBy\":false,\"scrollTo\":false,\"scrollX\":false,\"scrollY\":false,\"SecurityPolicyViolationEvent\":false,\"Selection\":false,\"self\":false,\"ServiceWorker\":false,\"ServiceWorkerContainer\":false,\"ServiceWorkerRegistration\":false,\"sessionStorage\":false,\"setInterval\":false,\"setTimeout\":false,\"ShadowRoot\":false,\"SharedWorker\":false,\"SourceBuffer\":false,\"SourceBufferList\":false,\"speechSynthesis\":false,\"SpeechSynthesisEvent\":false,\"SpeechSynthesisUtterance\":false,\"StaticRange\":false,\"status\":false,\"statusbar\":false,\"StereoPannerNode\":false,\"stop\":false,\"Storage\":false,\"StorageEvent\":false,\"StorageManager\":false,\"structuredClone\":false,\"styleMedia\":false,\"StyleSheet\":false,\"StyleSheetList\":false,\"SubmitEvent\":false,\"SubtleCrypto\":false,\"SVGAElement\":false,\"SVGAngle\":false,\"SVGAnimatedAngle\":false,\"SVGAnimatedBoolean\":false,\"SVGAnimatedEnumeration\":false,\"SVGAnimatedInteger\":false,\"SVGAnimatedLength\":false,\"SVGAnimatedLengthList\":false,\"SVGAnimatedNumber\":false,\"SVGAnimatedNumberList\":false,\"SVGAnimatedPreserveAspectRatio\":false,\"SVGAnimatedRect\":false,\"SVGAnimatedString\":false,\"SVGAnimatedTransformList\":false,\"SVGAnimateElement\":false,\"SVGAnimateMotionElement\":false,\"SVGAnimateTransformElement\":false,\"SVGAnimationElement\":false,\"SVGCircleElement\":false,\"SVGClipPathElement\":false,\"SVGComponentTransferFunctionElement\":false,\"SVGDefsElement\":false,\"SVGDescElement\":false,\"SVGDiscardElement\":false,\"SVGElement\":false,\"SVGEllipseElement\":false,\"SVGFEBlendElement\":false,\"SVGFEColorMatrixElement\":false,\"SVGFEComponentTransferElement\":false,\"SVGFECompositeElement\":false,\"SVGFEConvolveMatrixElement\":false,\"SVGFEDiffuseLightingElement\":false,\"SVGFEDisplacementMapElement\":false,\"SVGFEDistantLightElement\":false,\"SVGFEDropShadowElement\":false,\"SVGFEFloodElement\":false,\"SVGFEFuncAElement\":false,\"SVGFEFuncBElement\":false,\"SVGFEFuncGElement\":false,\"SVGFEFuncRElement\":false,\"SVGFEGaussianBlurElement\":false,\"SVGFEImageElement\":false,\"SVGFEMergeElement\":false,\"SVGFEMergeNodeElement\":false,\"SVGFEMorphologyElement\":false,\"SVGFEOffsetElement\":false,\"SVGFEPointLightElement\":false,\"SVGFESpecularLightingElement\":false,\"SVGFESpotLightElement\":false,\"SVGFETileElement\":false,\"SVGFETurbulenceElement\":false,\"SVGFilterElement\":false,\"SVGForeignObjectElement\":false,\"SVGGElement\":false,\"SVGGeometryElement\":false,\"SVGGradientElement\":false,\"SVGGraphicsElement\":false,\"SVGImageElement\":false,\"SVGLength\":false,\"SVGLengthList\":false,\"SVGLinearGradientElement\":false,\"SVGLineElement\":false,\"SVGMarkerElement\":false,\"SVGMaskElement\":false,\"SVGMatrix\":false,\"SVGMetadataElement\":false,\"SVGMPathElement\":false,\"SVGNumber\":false,\"SVGNumberList\":false,\"SVGPathElement\":false,\"SVGPatternElement\":false,\"SVGPoint\":false,\"SVGPointList\":false,\"SVGPolygonElement\":false,\"SVGPolylineElement\":false,\"SVGPreserveAspectRatio\":false,\"SVGRadialGradientElement\":false,\"SVGRect\":false,\"SVGRectElement\":false,\"SVGScriptElement\":false,\"SVGSetElement\":false,\"SVGStopElement\":false,\"SVGStringList\":false,\"SVGStyleElement\":false,\"SVGSVGElement\":false,\"SVGSwitchElement\":false,\"SVGSymbolElement\":false,\"SVGTextContentElement\":false,\"SVGTextElement\":false,\"SVGTextPathElement\":false,\"SVGTextPositioningElement\":false,\"SVGTitleElement\":false,\"SVGTransform\":false,\"SVGTransformList\":false,\"SVGTSpanElement\":false,\"SVGUnitTypes\":false,\"SVGUseElement\":false,\"SVGViewElement\":false,\"TaskAttributionTiming\":false,\"Text\":false,\"TextDecoder\":false,\"TextDecoderStream\":false,\"TextEncoder\":false,\"TextEncoderStream\":false,\"TextEvent\":false,\"TextMetrics\":false,\"TextTrack\":false,\"TextTrackCue\":false,\"TextTrackCueList\":false,\"TextTrackList\":false,\"TimeRanges\":false,\"ToggleEvent\":false,\"toolbar\":false,\"top\":false,\"Touch\":false,\"TouchEvent\":false,\"TouchList\":false,\"TrackEvent\":false,\"TransformStream\":false,\"TransformStreamDefaultController\":false,\"TransitionEvent\":false,\"TreeWalker\":false,\"UIEvent\":false,\"URL\":false,\"URLSearchParams\":false,\"ValidityState\":false,\"visualViewport\":false,\"VisualViewport\":false,\"VTTCue\":false,\"WaveShaperNode\":false,\"WebAssembly\":false,\"WebGL2RenderingContext\":false,\"WebGLActiveInfo\":false,\"WebGLBuffer\":false,\"WebGLContextEvent\":false,\"WebGLFramebuffer\":false,\"WebGLProgram\":false,\"WebGLQuery\":false,\"WebGLRenderbuffer\":false,\"WebGLRenderingContext\":false,\"WebGLSampler\":false,\"WebGLShader\":false,\"WebGLShaderPrecisionFormat\":false,\"WebGLSync\":false,\"WebGLTexture\":false,\"WebGLTransformFeedback\":false,\"WebGLUniformLocation\":false,\"WebGLVertexArrayObject\":false,\"WebSocket\":false,\"WheelEvent\":false,\"window\":false,\"Window\":false,\"Worker\":false,\"WritableStream\":false,\"WritableStreamDefaultController\":false,\"WritableStreamDefaultWriter\":false,\"XMLDocument\":false,\"XMLHttpRequest\":false,\"XMLHttpRequestEventTarget\":false,\"XMLHttpRequestUpload\":false,\"XMLSerializer\":false,\"XPathEvaluator\":false,\"XPathExpression\":false,\"XPathResult\":false,\"XRAnchor\":false,\"XRBoundedReferenceSpace\":false,\"XRCPUDepthInformation\":false,\"XRDepthInformation\":false,\"XRFrame\":false,\"XRInputSource\":false,\"XRInputSourceArray\":false,\"XRInputSourceEvent\":false,\"XRInputSourcesChangeEvent\":false,\"XRPose\":false,\"XRReferenceSpace\":false,\"XRReferenceSpaceEvent\":false,\"XRRenderState\":false,\"XRRigidTransform\":false,\"XRSession\":false,\"XRSessionEvent\":false,\"XRSpace\":false,\"XRSystem\":false,\"XRView\":false,\"XRViewerPose\":false,\"XRViewport\":false,\"XRWebGLBinding\":false,\"XRWebGLDepthInformation\":false,\"XRWebGLLayer\":false,\"XSLTProcessor\":false}");
3747
+ worker = {
3748
+ "addEventListener": false,
3749
+ "applicationCache": false,
3750
+ "atob": false,
3751
+ "Blob": false,
3752
+ "BroadcastChannel": false,
3753
+ "btoa": false,
3754
+ "ByteLengthQueuingStrategy": false,
3755
+ "Cache": false,
3756
+ "caches": false,
3757
+ "clearInterval": false,
3758
+ "clearTimeout": false,
3759
+ "close": true,
3760
+ "CompressionStream": false,
3761
+ "console": false,
3762
+ "CountQueuingStrategy": false,
3763
+ "crypto": false,
3764
+ "Crypto": false,
3765
+ "CryptoKey": false,
3766
+ "CustomEvent": false,
3767
+ "DecompressionStream": false,
3768
+ "ErrorEvent": false,
3769
+ "Event": false,
3770
+ "fetch": false,
3771
+ "File": false,
3772
+ "FileReaderSync": false,
3773
+ "FormData": false,
3774
+ "Headers": false,
3775
+ "IDBCursor": false,
3776
+ "IDBCursorWithValue": false,
3777
+ "IDBDatabase": false,
3778
+ "IDBFactory": false,
3779
+ "IDBIndex": false,
3780
+ "IDBKeyRange": false,
3781
+ "IDBObjectStore": false,
3782
+ "IDBOpenDBRequest": false,
3783
+ "IDBRequest": false,
3784
+ "IDBTransaction": false,
3785
+ "IDBVersionChangeEvent": false,
3786
+ "ImageData": false,
3787
+ "importScripts": true,
3788
+ "indexedDB": false,
3789
+ "location": false,
3790
+ "MessageChannel": false,
3791
+ "MessageEvent": false,
3792
+ "MessagePort": false,
3793
+ "name": false,
3794
+ "navigator": false,
3795
+ "Notification": false,
3796
+ "onclose": true,
3797
+ "onconnect": true,
3798
+ "onerror": true,
3799
+ "onlanguagechange": true,
3800
+ "onmessage": true,
3801
+ "onoffline": true,
3802
+ "ononline": true,
3803
+ "onrejectionhandled": true,
3804
+ "onunhandledrejection": true,
3805
+ "performance": false,
3806
+ "Performance": false,
3807
+ "PerformanceEntry": false,
3808
+ "PerformanceMark": false,
3809
+ "PerformanceMeasure": false,
3810
+ "PerformanceNavigation": false,
3811
+ "PerformanceObserver": false,
3812
+ "PerformanceObserverEntryList": false,
3813
+ "PerformanceResourceTiming": false,
3814
+ "PerformanceTiming": false,
3815
+ "postMessage": true,
3816
+ "Promise": false,
3817
+ "queueMicrotask": false,
3818
+ "ReadableByteStreamController": false,
3819
+ "ReadableStream": false,
3820
+ "ReadableStreamBYOBReader": false,
3821
+ "ReadableStreamBYOBRequest": false,
3822
+ "ReadableStreamDefaultController": false,
3823
+ "ReadableStreamDefaultReader": false,
3824
+ "removeEventListener": false,
3825
+ "reportError": false,
3826
+ "Request": false,
3827
+ "Response": false,
3828
+ "self": true,
3829
+ "ServiceWorkerRegistration": false,
3830
+ "setInterval": false,
3831
+ "setTimeout": false,
3832
+ "SubtleCrypto": false,
3833
+ "TextDecoder": false,
3834
+ "TextDecoderStream": false,
3835
+ "TextEncoder": false,
3836
+ "TextEncoderStream": false,
3837
+ "TransformStream": false,
3838
+ "TransformStreamDefaultController": false,
3839
+ "URL": false,
3840
+ "URLSearchParams": false,
3841
+ "WebAssembly": false,
3842
+ "WebSocket": false,
3843
+ "Worker": false,
3844
+ "WorkerGlobalScope": false,
3845
+ "WritableStream": false,
3846
+ "WritableStreamDefaultController": false,
3847
+ "WritableStreamDefaultWriter": false,
3848
+ "XMLHttpRequest": false
3849
+ };
3850
+ node = {
3851
+ "__dirname": false,
3852
+ "__filename": false,
3853
+ "AbortController": false,
3854
+ "AbortSignal": false,
3855
+ "atob": false,
3856
+ "Blob": false,
3857
+ "BroadcastChannel": false,
3858
+ "btoa": false,
3859
+ "Buffer": false,
3860
+ "ByteLengthQueuingStrategy": false,
3861
+ "clearImmediate": false,
3862
+ "clearInterval": false,
3863
+ "clearTimeout": false,
3864
+ "CompressionStream": false,
3865
+ "console": false,
3866
+ "CountQueuingStrategy": false,
3867
+ "crypto": false,
3868
+ "Crypto": false,
3869
+ "CryptoKey": false,
3870
+ "CustomEvent": false,
3871
+ "DecompressionStream": false,
3872
+ "DOMException": false,
3873
+ "Event": false,
3874
+ "EventTarget": false,
3875
+ "exports": true,
3876
+ "fetch": false,
3877
+ "File": false,
3878
+ "FormData": false,
3879
+ "global": false,
3880
+ "Headers": false,
3881
+ "Intl": false,
3882
+ "MessageChannel": false,
3883
+ "MessageEvent": false,
3884
+ "MessagePort": false,
3885
+ "module": false,
3886
+ "performance": false,
3887
+ "PerformanceEntry": false,
3888
+ "PerformanceMark": false,
3889
+ "PerformanceMeasure": false,
3890
+ "PerformanceObserver": false,
3891
+ "PerformanceObserverEntryList": false,
3892
+ "PerformanceResourceTiming": false,
3893
+ "process": false,
3894
+ "queueMicrotask": false,
3895
+ "ReadableByteStreamController": false,
3896
+ "ReadableStream": false,
3897
+ "ReadableStreamBYOBReader": false,
3898
+ "ReadableStreamBYOBRequest": false,
3899
+ "ReadableStreamDefaultController": false,
3900
+ "ReadableStreamDefaultReader": false,
3901
+ "Request": false,
3902
+ "require": false,
3903
+ "Response": false,
3904
+ "setImmediate": false,
3905
+ "setInterval": false,
3906
+ "setTimeout": false,
3907
+ "structuredClone": false,
3908
+ "SubtleCrypto": false,
3909
+ "TextDecoder": false,
3910
+ "TextDecoderStream": false,
3911
+ "TextEncoder": false,
3912
+ "TextEncoderStream": false,
3913
+ "TransformStream": false,
3914
+ "TransformStreamDefaultController": false,
3915
+ "URL": false,
3916
+ "URLSearchParams": false,
3917
+ "WebAssembly": false,
3918
+ "WritableStream": false,
3919
+ "WritableStreamDefaultController": false,
3920
+ "WritableStreamDefaultWriter": false
3921
+ };
3922
+ nodeBuiltin = {
3923
+ "AbortController": false,
3924
+ "AbortSignal": false,
3925
+ "atob": false,
3926
+ "Blob": false,
3927
+ "BroadcastChannel": false,
3928
+ "btoa": false,
3929
+ "Buffer": false,
3930
+ "ByteLengthQueuingStrategy": false,
3931
+ "clearImmediate": false,
3932
+ "clearInterval": false,
3933
+ "clearTimeout": false,
3934
+ "CompressionStream": false,
3935
+ "console": false,
3936
+ "CountQueuingStrategy": false,
3937
+ "crypto": false,
3938
+ "Crypto": false,
3939
+ "CryptoKey": false,
3940
+ "CustomEvent": false,
3941
+ "DecompressionStream": false,
3942
+ "DOMException": false,
3943
+ "Event": false,
3944
+ "EventTarget": false,
3945
+ "fetch": false,
3946
+ "File": false,
3947
+ "FormData": false,
3948
+ "global": false,
3949
+ "Headers": false,
3950
+ "Intl": false,
3951
+ "MessageChannel": false,
3952
+ "MessageEvent": false,
3953
+ "MessagePort": false,
3954
+ "performance": false,
3955
+ "PerformanceEntry": false,
3956
+ "PerformanceMark": false,
3957
+ "PerformanceMeasure": false,
3958
+ "PerformanceObserver": false,
3959
+ "PerformanceObserverEntryList": false,
3960
+ "PerformanceResourceTiming": false,
3961
+ "process": false,
3962
+ "queueMicrotask": false,
3963
+ "ReadableByteStreamController": false,
3964
+ "ReadableStream": false,
3965
+ "ReadableStreamBYOBReader": false,
3966
+ "ReadableStreamBYOBRequest": false,
3967
+ "ReadableStreamDefaultController": false,
3968
+ "ReadableStreamDefaultReader": false,
3969
+ "Request": false,
3970
+ "Response": false,
3971
+ "setImmediate": false,
3972
+ "setInterval": false,
3973
+ "setTimeout": false,
3974
+ "structuredClone": false,
3975
+ "SubtleCrypto": false,
3976
+ "TextDecoder": false,
3977
+ "TextDecoderStream": false,
3978
+ "TextEncoder": false,
3979
+ "TextEncoderStream": false,
3980
+ "TransformStream": false,
3981
+ "TransformStreamDefaultController": false,
3982
+ "URL": false,
3983
+ "URLSearchParams": false,
3984
+ "WebAssembly": false,
3985
+ "WritableStream": false,
3986
+ "WritableStreamDefaultController": false,
3987
+ "WritableStreamDefaultWriter": false
3988
+ };
3989
+ commonjs = {
3990
+ "exports": true,
3991
+ "global": false,
3992
+ "module": false,
3993
+ "require": false
3994
+ };
3995
+ amd = {
3996
+ "define": false,
3997
+ "require": false
3998
+ };
3999
+ mocha = {
4000
+ "after": false,
4001
+ "afterEach": false,
4002
+ "before": false,
4003
+ "beforeEach": false,
4004
+ "context": false,
4005
+ "describe": false,
4006
+ "it": false,
4007
+ "mocha": false,
4008
+ "run": false,
4009
+ "setup": false,
4010
+ "specify": false,
4011
+ "suite": false,
4012
+ "suiteSetup": false,
4013
+ "suiteTeardown": false,
4014
+ "teardown": false,
4015
+ "test": false,
4016
+ "xcontext": false,
4017
+ "xdescribe": false,
4018
+ "xit": false,
4019
+ "xspecify": false
4020
+ };
4021
+ jasmine = {
4022
+ "afterAll": false,
4023
+ "afterEach": false,
4024
+ "beforeAll": false,
4025
+ "beforeEach": false,
4026
+ "describe": false,
4027
+ "expect": false,
4028
+ "expectAsync": false,
4029
+ "fail": false,
4030
+ "fdescribe": false,
4031
+ "fit": false,
4032
+ "it": false,
4033
+ "jasmine": false,
4034
+ "pending": false,
4035
+ "runs": false,
4036
+ "spyOn": false,
4037
+ "spyOnAllFunctions": false,
4038
+ "spyOnProperty": false,
4039
+ "waits": false,
4040
+ "waitsFor": false,
4041
+ "xdescribe": false,
4042
+ "xit": false
4043
+ };
4044
+ jest = {
4045
+ "afterAll": false,
4046
+ "afterEach": false,
4047
+ "beforeAll": false,
4048
+ "beforeEach": false,
4049
+ "describe": false,
4050
+ "expect": false,
4051
+ "fdescribe": false,
4052
+ "fit": false,
4053
+ "it": false,
4054
+ "jest": false,
4055
+ "pit": false,
4056
+ "require": false,
4057
+ "test": false,
4058
+ "xdescribe": false,
4059
+ "xit": false,
4060
+ "xtest": false
4061
+ };
4062
+ qunit = {
4063
+ "asyncTest": false,
4064
+ "deepEqual": false,
4065
+ "equal": false,
4066
+ "expect": false,
4067
+ "module": false,
4068
+ "notDeepEqual": false,
4069
+ "notEqual": false,
4070
+ "notOk": false,
4071
+ "notPropEqual": false,
4072
+ "notStrictEqual": false,
4073
+ "ok": false,
4074
+ "propEqual": false,
4075
+ "QUnit": false,
4076
+ "raises": false,
4077
+ "start": false,
4078
+ "stop": false,
4079
+ "strictEqual": false,
4080
+ "test": false,
4081
+ "throws": false
4082
+ };
4083
+ phantomjs = {
4084
+ "console": true,
4085
+ "exports": true,
4086
+ "phantom": true,
4087
+ "require": true,
4088
+ "WebPage": true
4089
+ };
4090
+ couch = {
4091
+ "emit": false,
4092
+ "exports": false,
4093
+ "getRow": false,
4094
+ "log": false,
4095
+ "module": false,
4096
+ "provides": false,
4097
+ "require": false,
4098
+ "respond": false,
4099
+ "send": false,
4100
+ "start": false,
4101
+ "sum": false
4102
+ };
4103
+ rhino = {
4104
+ "defineClass": false,
4105
+ "deserialize": false,
4106
+ "gc": false,
4107
+ "help": false,
4108
+ "importClass": false,
4109
+ "importPackage": false,
4110
+ "java": false,
4111
+ "load": false,
4112
+ "loadClass": false,
4113
+ "Packages": false,
4114
+ "print": false,
4115
+ "quit": false,
4116
+ "readFile": false,
4117
+ "readUrl": false,
4118
+ "runCommand": false,
4119
+ "seal": false,
4120
+ "serialize": false,
4121
+ "spawn": false,
4122
+ "sync": false,
4123
+ "toint32": false,
4124
+ "version": false
4125
+ };
4126
+ nashorn = {
4127
+ "__DIR__": false,
4128
+ "__FILE__": false,
4129
+ "__LINE__": false,
4130
+ "com": false,
4131
+ "edu": false,
4132
+ "exit": false,
4133
+ "java": false,
4134
+ "Java": false,
4135
+ "javafx": false,
4136
+ "JavaImporter": false,
4137
+ "javax": false,
4138
+ "JSAdapter": false,
4139
+ "load": false,
4140
+ "loadWithNewGlobal": false,
4141
+ "org": false,
4142
+ "Packages": false,
4143
+ "print": false,
4144
+ "quit": false
4145
+ };
4146
+ wsh = {
4147
+ "ActiveXObject": false,
4148
+ "CollectGarbage": false,
4149
+ "Debug": false,
4150
+ "Enumerator": false,
4151
+ "GetObject": false,
4152
+ "RuntimeObject": false,
4153
+ "ScriptEngine": false,
4154
+ "ScriptEngineBuildVersion": false,
4155
+ "ScriptEngineMajorVersion": false,
4156
+ "ScriptEngineMinorVersion": false,
4157
+ "VBArray": false,
4158
+ "WScript": false,
4159
+ "WSH": false
4160
+ };
4161
+ jquery = {
4162
+ "$": false,
4163
+ "jQuery": false
4164
+ };
4165
+ yui = {
4166
+ "YAHOO": false,
4167
+ "YAHOO_config": false,
4168
+ "YUI": false,
4169
+ "YUI_config": false
4170
+ };
4171
+ shelljs = {
4172
+ "cat": false,
4173
+ "cd": false,
4174
+ "chmod": false,
4175
+ "config": false,
4176
+ "cp": false,
4177
+ "dirs": false,
4178
+ "echo": false,
4179
+ "env": false,
4180
+ "error": false,
4181
+ "exec": false,
4182
+ "exit": false,
4183
+ "find": false,
4184
+ "grep": false,
4185
+ "ln": false,
4186
+ "ls": false,
4187
+ "mkdir": false,
4188
+ "mv": false,
4189
+ "popd": false,
4190
+ "pushd": false,
4191
+ "pwd": false,
4192
+ "rm": false,
4193
+ "sed": false,
4194
+ "set": false,
4195
+ "target": false,
4196
+ "tempdir": false,
4197
+ "test": false,
4198
+ "touch": false,
4199
+ "which": false
4200
+ };
4201
+ prototypejs = {
4202
+ "$": false,
4203
+ "$$": false,
4204
+ "$A": false,
4205
+ "$break": false,
4206
+ "$continue": false,
4207
+ "$F": false,
4208
+ "$H": false,
4209
+ "$R": false,
4210
+ "$w": false,
4211
+ "Abstract": false,
4212
+ "Ajax": false,
4213
+ "Autocompleter": false,
4214
+ "Builder": false,
4215
+ "Class": false,
4216
+ "Control": false,
4217
+ "Draggable": false,
4218
+ "Draggables": false,
4219
+ "Droppables": false,
4220
+ "Effect": false,
4221
+ "Element": false,
4222
+ "Enumerable": false,
4223
+ "Event": false,
4224
+ "Field": false,
4225
+ "Form": false,
4226
+ "Hash": false,
4227
+ "Insertion": false,
4228
+ "ObjectRange": false,
4229
+ "PeriodicalExecuter": false,
4230
+ "Position": false,
4231
+ "Prototype": false,
4232
+ "Scriptaculous": false,
4233
+ "Selector": false,
4234
+ "Sortable": false,
4235
+ "SortableObserver": false,
4236
+ "Sound": false,
4237
+ "Template": false,
4238
+ "Toggle": false,
4239
+ "Try": false
4240
+ };
4241
+ meteor = {
4242
+ "$": false,
4243
+ "Accounts": false,
4244
+ "AccountsClient": false,
4245
+ "AccountsCommon": false,
4246
+ "AccountsServer": false,
4247
+ "App": false,
4248
+ "Assets": false,
4249
+ "Blaze": false,
4250
+ "check": false,
4251
+ "Cordova": false,
4252
+ "DDP": false,
4253
+ "DDPRateLimiter": false,
4254
+ "DDPServer": false,
4255
+ "Deps": false,
4256
+ "EJSON": false,
4257
+ "Email": false,
4258
+ "HTTP": false,
4259
+ "Log": false,
4260
+ "Match": false,
4261
+ "Meteor": false,
4262
+ "Mongo": false,
4263
+ "MongoInternals": false,
4264
+ "Npm": false,
4265
+ "Package": false,
4266
+ "Plugin": false,
4267
+ "process": false,
4268
+ "Random": false,
4269
+ "ReactiveDict": false,
4270
+ "ReactiveVar": false,
4271
+ "Router": false,
4272
+ "ServiceConfiguration": false,
4273
+ "Session": false,
4274
+ "share": false,
4275
+ "Spacebars": false,
4276
+ "Template": false,
4277
+ "Tinytest": false,
4278
+ "Tracker": false,
4279
+ "UI": false,
4280
+ "Utils": false,
4281
+ "WebApp": false,
4282
+ "WebAppInternals": false
4283
+ };
4284
+ mongo = {
4285
+ "_isWindows": false,
4286
+ "_rand": false,
4287
+ "BulkWriteResult": false,
4288
+ "cat": false,
4289
+ "cd": false,
4290
+ "connect": false,
4291
+ "db": false,
4292
+ "getHostName": false,
4293
+ "getMemInfo": false,
4294
+ "hostname": false,
4295
+ "ISODate": false,
4296
+ "listFiles": false,
4297
+ "load": false,
4298
+ "ls": false,
4299
+ "md5sumFile": false,
4300
+ "mkdir": false,
4301
+ "Mongo": false,
4302
+ "NumberInt": false,
4303
+ "NumberLong": false,
4304
+ "ObjectId": false,
4305
+ "PlanCache": false,
4306
+ "print": false,
4307
+ "printjson": false,
4308
+ "pwd": false,
4309
+ "quit": false,
4310
+ "removeFile": false,
4311
+ "rs": false,
4312
+ "sh": false,
4313
+ "UUID": false,
4314
+ "version": false,
4315
+ "WriteResult": false
4316
+ };
4317
+ applescript = {
4318
+ "$": false,
4319
+ "Application": false,
4320
+ "Automation": false,
4321
+ "console": false,
4322
+ "delay": false,
4323
+ "Library": false,
4324
+ "ObjC": false,
4325
+ "ObjectSpecifier": false,
4326
+ "Path": false,
4327
+ "Progress": false,
4328
+ "Ref": false
4329
+ };
4330
+ serviceworker = {
4331
+ "addEventListener": false,
4332
+ "applicationCache": false,
4333
+ "atob": false,
4334
+ "Blob": false,
4335
+ "BroadcastChannel": false,
4336
+ "btoa": false,
4337
+ "ByteLengthQueuingStrategy": false,
4338
+ "Cache": false,
4339
+ "caches": false,
4340
+ "CacheStorage": false,
4341
+ "clearInterval": false,
4342
+ "clearTimeout": false,
4343
+ "Client": false,
4344
+ "clients": false,
4345
+ "Clients": false,
4346
+ "close": true,
4347
+ "CompressionStream": false,
4348
+ "console": false,
4349
+ "CountQueuingStrategy": false,
4350
+ "crypto": false,
4351
+ "Crypto": false,
4352
+ "CryptoKey": false,
4353
+ "CustomEvent": false,
4354
+ "DecompressionStream": false,
4355
+ "ErrorEvent": false,
4356
+ "Event": false,
4357
+ "ExtendableEvent": false,
4358
+ "ExtendableMessageEvent": false,
4359
+ "fetch": false,
4360
+ "FetchEvent": false,
4361
+ "File": false,
4362
+ "FileReaderSync": false,
4363
+ "FormData": false,
4364
+ "Headers": false,
4365
+ "IDBCursor": false,
4366
+ "IDBCursorWithValue": false,
4367
+ "IDBDatabase": false,
4368
+ "IDBFactory": false,
4369
+ "IDBIndex": false,
4370
+ "IDBKeyRange": false,
4371
+ "IDBObjectStore": false,
4372
+ "IDBOpenDBRequest": false,
4373
+ "IDBRequest": false,
4374
+ "IDBTransaction": false,
4375
+ "IDBVersionChangeEvent": false,
4376
+ "ImageData": false,
4377
+ "importScripts": false,
4378
+ "indexedDB": false,
4379
+ "location": false,
4380
+ "MessageChannel": false,
4381
+ "MessageEvent": false,
4382
+ "MessagePort": false,
4383
+ "name": false,
4384
+ "navigator": false,
4385
+ "Notification": false,
4386
+ "onclose": true,
4387
+ "onconnect": true,
4388
+ "onerror": true,
4389
+ "onfetch": true,
4390
+ "oninstall": true,
4391
+ "onlanguagechange": true,
4392
+ "onmessage": true,
4393
+ "onmessageerror": true,
4394
+ "onnotificationclick": true,
4395
+ "onnotificationclose": true,
4396
+ "onoffline": true,
4397
+ "ononline": true,
4398
+ "onpush": true,
4399
+ "onpushsubscriptionchange": true,
4400
+ "onrejectionhandled": true,
4401
+ "onsync": true,
4402
+ "onunhandledrejection": true,
4403
+ "performance": false,
4404
+ "Performance": false,
4405
+ "PerformanceEntry": false,
4406
+ "PerformanceMark": false,
4407
+ "PerformanceMeasure": false,
4408
+ "PerformanceNavigation": false,
4409
+ "PerformanceObserver": false,
4410
+ "PerformanceObserverEntryList": false,
4411
+ "PerformanceResourceTiming": false,
4412
+ "PerformanceTiming": false,
4413
+ "postMessage": true,
4414
+ "Promise": false,
4415
+ "queueMicrotask": false,
4416
+ "ReadableByteStreamController": false,
4417
+ "ReadableStream": false,
4418
+ "ReadableStreamBYOBReader": false,
4419
+ "ReadableStreamBYOBRequest": false,
4420
+ "ReadableStreamDefaultController": false,
4421
+ "ReadableStreamDefaultReader": false,
4422
+ "registration": false,
4423
+ "removeEventListener": false,
4424
+ "Request": false,
4425
+ "Response": false,
4426
+ "self": false,
4427
+ "ServiceWorker": false,
4428
+ "ServiceWorkerContainer": false,
4429
+ "ServiceWorkerGlobalScope": false,
4430
+ "ServiceWorkerMessageEvent": false,
4431
+ "ServiceWorkerRegistration": false,
4432
+ "setInterval": false,
4433
+ "setTimeout": false,
4434
+ "skipWaiting": false,
4435
+ "SubtleCrypto": false,
4436
+ "TextDecoder": false,
4437
+ "TextDecoderStream": false,
4438
+ "TextEncoder": false,
4439
+ "TextEncoderStream": false,
4440
+ "TransformStream": false,
4441
+ "TransformStreamDefaultController": false,
4442
+ "URL": false,
4443
+ "URLSearchParams": false,
4444
+ "WebAssembly": false,
4445
+ "WebSocket": false,
4446
+ "WindowClient": false,
4447
+ "Worker": false,
4448
+ "WorkerGlobalScope": false,
4449
+ "WritableStream": false,
4450
+ "WritableStreamDefaultController": false,
4451
+ "WritableStreamDefaultWriter": false,
4452
+ "XMLHttpRequest": false
4453
+ };
4454
+ atomtest = {
4455
+ "advanceClock": false,
4456
+ "atom": false,
4457
+ "fakeClearInterval": false,
4458
+ "fakeClearTimeout": false,
4459
+ "fakeSetInterval": false,
4460
+ "fakeSetTimeout": false,
4461
+ "resetTimeouts": false,
4462
+ "waitsForPromise": false
4463
+ };
4464
+ embertest = {
4465
+ "andThen": false,
4466
+ "click": false,
4467
+ "currentPath": false,
4468
+ "currentRouteName": false,
4469
+ "currentURL": false,
4470
+ "fillIn": false,
4471
+ "find": false,
4472
+ "findAll": false,
4473
+ "findWithAssert": false,
4474
+ "keyEvent": false,
4475
+ "pauseTest": false,
4476
+ "resumeTest": false,
4477
+ "triggerEvent": false,
4478
+ "visit": false,
4479
+ "wait": false
4480
+ };
4481
+ protractor = {
4482
+ "$": false,
4483
+ "$$": false,
4484
+ "browser": false,
4485
+ "by": false,
4486
+ "By": false,
4487
+ "DartObject": false,
4488
+ "element": false,
4489
+ "protractor": false
4490
+ };
4491
+ webextensions = {
4492
+ "browser": false,
4493
+ "chrome": false,
4494
+ "opr": false
4495
+ };
4496
+ greasemonkey = {
4497
+ "cloneInto": false,
4498
+ "createObjectIn": false,
4499
+ "exportFunction": false,
4500
+ "GM": false,
4501
+ "GM_addElement": false,
4502
+ "GM_addStyle": false,
4503
+ "GM_addValueChangeListener": false,
4504
+ "GM_deleteValue": false,
4505
+ "GM_download": false,
4506
+ "GM_getResourceText": false,
4507
+ "GM_getResourceURL": false,
4508
+ "GM_getTab": false,
4509
+ "GM_getTabs": false,
4510
+ "GM_getValue": false,
4511
+ "GM_info": false,
4512
+ "GM_listValues": false,
4513
+ "GM_log": false,
4514
+ "GM_notification": false,
4515
+ "GM_openInTab": false,
4516
+ "GM_registerMenuCommand": false,
4517
+ "GM_removeValueChangeListener": false,
4518
+ "GM_saveTab": false,
4519
+ "GM_setClipboard": false,
4520
+ "GM_setValue": false,
4521
+ "GM_unregisterMenuCommand": false,
4522
+ "GM_xmlhttpRequest": false,
4523
+ "unsafeWindow": false
4524
+ };
4525
+ devtools = {
4526
+ "$": false,
4527
+ "$_": false,
4528
+ "$$": false,
4529
+ "$0": false,
4530
+ "$1": false,
4531
+ "$2": false,
4532
+ "$3": false,
4533
+ "$4": false,
4534
+ "$x": false,
4535
+ "chrome": false,
4536
+ "clear": false,
4537
+ "copy": false,
4538
+ "debug": false,
4539
+ "dir": false,
4540
+ "dirxml": false,
4541
+ "getEventListeners": false,
4542
+ "inspect": false,
4543
+ "keys": false,
4544
+ "monitor": false,
4545
+ "monitorEvents": false,
4546
+ "profile": false,
4547
+ "profileEnd": false,
4548
+ "queryObjects": false,
4549
+ "table": false,
4550
+ "undebug": false,
4551
+ "unmonitor": false,
4552
+ "unmonitorEvents": false,
4553
+ "values": false
4554
+ };
4555
+ globals_default = {
4556
+ builtin,
4557
+ es5,
4558
+ es2015,
4559
+ es2017,
4560
+ es2020,
4561
+ es2021,
4562
+ browser,
4563
+ worker,
4564
+ node,
4565
+ nodeBuiltin,
4566
+ commonjs,
4567
+ amd,
4568
+ mocha,
4569
+ jasmine,
4570
+ jest,
4571
+ qunit,
4572
+ phantomjs,
4573
+ couch,
4574
+ rhino,
4575
+ nashorn,
4576
+ wsh,
4577
+ jquery,
4578
+ yui,
4579
+ shelljs,
4580
+ prototypejs,
4581
+ meteor,
4582
+ mongo,
4583
+ applescript,
4584
+ serviceworker,
4585
+ atomtest,
4586
+ embertest,
4587
+ protractor,
4588
+ "shared-node-browser": {
4589
+ "AbortController": false,
4590
+ "AbortSignal": false,
4591
+ "atob": false,
4592
+ "Blob": false,
4593
+ "BroadcastChannel": false,
4594
+ "btoa": false,
4595
+ "ByteLengthQueuingStrategy": false,
4596
+ "clearInterval": false,
4597
+ "clearTimeout": false,
4598
+ "CompressionStream": false,
4599
+ "console": false,
4600
+ "CountQueuingStrategy": false,
4601
+ "crypto": false,
4602
+ "Crypto": false,
4603
+ "CryptoKey": false,
4604
+ "CustomEvent": false,
4605
+ "DecompressionStream": false,
4606
+ "DOMException": false,
4607
+ "Event": false,
4608
+ "EventTarget": false,
4609
+ "fetch": false,
4610
+ "File": false,
4611
+ "FormData": false,
4612
+ "Headers": false,
4613
+ "Intl": false,
4614
+ "MessageChannel": false,
4615
+ "MessageEvent": false,
4616
+ "MessagePort": false,
4617
+ "performance": false,
4618
+ "PerformanceEntry": false,
4619
+ "PerformanceMark": false,
4620
+ "PerformanceMeasure": false,
4621
+ "PerformanceObserver": false,
4622
+ "PerformanceObserverEntryList": false,
4623
+ "PerformanceResourceTiming": false,
4624
+ "queueMicrotask": false,
4625
+ "ReadableByteStreamController": false,
4626
+ "ReadableStream": false,
4627
+ "ReadableStreamBYOBReader": false,
4628
+ "ReadableStreamBYOBRequest": false,
4629
+ "ReadableStreamDefaultController": false,
4630
+ "ReadableStreamDefaultReader": false,
4631
+ "Request": false,
4632
+ "Response": false,
4633
+ "setInterval": false,
4634
+ "setTimeout": false,
4635
+ "structuredClone": false,
4636
+ "SubtleCrypto": false,
4637
+ "TextDecoder": false,
4638
+ "TextDecoderStream": false,
4639
+ "TextEncoder": false,
4640
+ "TextEncoderStream": false,
4641
+ "TransformStream": false,
4642
+ "TransformStreamDefaultController": false,
4643
+ "URL": false,
4644
+ "URLSearchParams": false,
4645
+ "WebAssembly": false,
4646
+ "WritableStream": false,
4647
+ "WritableStreamDefaultController": false,
4648
+ "WritableStreamDefaultWriter": false
4649
+ },
4650
+ webextensions,
4651
+ greasemonkey,
4652
+ devtools
4653
+ };
4654
+ }));
4655
+ var unicornRules = {
4656
+ languageOptions: { globals: { ...(/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
4657
+ module.exports = (init_globals(), __toCommonJS(globals_exports).default);
4658
+ })))())).default.builtin } },
4659
+ plugins: { unicorn: eslint_plugin_unicorn.default },
4660
+ rules: {
4661
+ "unicorn/better-regex": "error",
4662
+ "unicorn/catch-error-name": "error",
4663
+ "unicorn/consistent-date-clone": "error",
4664
+ "unicorn/consistent-destructuring": "error",
4665
+ "unicorn/escape-case": "error",
4666
+ "unicorn/no-array-for-each": "error",
4667
+ "unicorn/no-array-reduce": "error",
4668
+ "unicorn/no-await-in-promise-methods": "error",
4669
+ "unicorn/no-invalid-remove-event-listener": "error",
4670
+ "unicorn/no-new-array": "error",
4671
+ "unicorn/no-new-buffer": "error",
4672
+ "unicorn/no-object-as-default-parameter": "error",
4673
+ "unicorn/no-single-promise-in-promise-methods": "error",
4674
+ "unicorn/no-unnecessary-await": "error",
4675
+ "unicorn/no-unreadable-iife": "error",
4676
+ "unicorn/no-useless-collection-argument": "error",
4677
+ "unicorn/no-useless-error-capture-stack-trace": "error",
4678
+ "unicorn/no-useless-fallback-in-spread": "error",
4679
+ "unicorn/no-useless-promise-resolve-reject": "error",
4680
+ "unicorn/no-useless-spread": "error",
4681
+ "unicorn/no-useless-switch-case": "error",
4682
+ "unicorn/number-literal-case": "error",
4683
+ "unicorn/numeric-separators-style": "error",
4684
+ "unicorn/prefer-array-find": "error",
4685
+ "unicorn/prefer-array-flat": "error",
4686
+ "unicorn/prefer-array-flat-map": "error",
4687
+ "unicorn/prefer-array-index-of": "error",
4688
+ "unicorn/prefer-array-some": "error",
4689
+ "unicorn/prefer-bigint-literals": "error",
4690
+ "unicorn/prefer-blob-reading-methods": "error",
4691
+ "unicorn/prefer-date-now": "error",
4692
+ "unicorn/prefer-import-meta-properties": "error",
4693
+ "unicorn/prefer-includes": "error",
4694
+ "unicorn/prefer-logical-operator-over-ternary": "error",
4695
+ "unicorn/prefer-number-properties": "error",
4696
+ "unicorn/prefer-object-from-entries": "error",
4697
+ "unicorn/prefer-optional-catch-binding": "error",
4698
+ "unicorn/prefer-prototype-methods": "error",
4699
+ "unicorn/prefer-response-static-json": "error",
4700
+ "unicorn/prefer-set-has": "error",
4701
+ "unicorn/prefer-set-size": "error",
4702
+ "unicorn/prefer-string-raw": "error",
4703
+ "unicorn/prefer-string-replace-all": "error",
4704
+ "unicorn/prefer-string-starts-ends-with": "error",
4705
+ "unicorn/prefer-string-trim-start-end": "error",
4706
+ "unicorn/prefer-structured-clone": "error",
4707
+ "unicorn/prefer-switch": "error",
4708
+ "unicorn/require-module-attributes": "error",
4709
+ "unicorn/require-module-specifiers": "error",
4710
+ "unicorn/template-indent": "error"
4711
+ }
4712
+ };
4713
+ //#endregion
4714
+ //#region src/index.ts
4715
+ /**
4716
+ * The ESLint flat config used by Borela Tech projects.
4717
+ * @public
4718
+ */
4719
+ var config = [
4720
+ ignores,
4721
+ languageOptions,
4722
+ _eslint_js.default.configs.recommended,
4723
+ eslint_plugin_react.default.configs.flat.recommended,
4724
+ _stylistic_eslint_plugin.default.configs.recommended,
4725
+ ...typescript_eslint.default.configs.recommended,
4726
+ ...typescript_eslint.default.configs.stylistic,
4727
+ customRules,
4728
+ generalRules,
4729
+ perfectionistRules,
4730
+ reactHooks,
4731
+ stylisticRules,
4732
+ typescriptRules,
4733
+ unicornRules
4734
+ ];
4735
+ //#endregion
4736
+ exports.config = config;
4737
+
4738
+ //# sourceMappingURL=index.cjs.js.map