@coderwyd/eslint-config 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +12 -13
- package/dist/index.d.ts +184 -141
- package/dist/index.js +9 -6
- package/package.json +26 -26
- package/dist/dist-DYrxmIwK.js +0 -1887
package/dist/dist-DYrxmIwK.js
DELETED
|
@@ -1,1887 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __create$1 = Object.create;
|
|
5
|
-
var __defProp$1 = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames$1 = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf$1 = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __commonJS$1 = (cb, mod) => function() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
13
|
-
var __copyProps$1 = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
-
key = keys[i];
|
|
16
|
-
if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
|
|
17
|
-
get: ((k) => from[k]).bind(null, key),
|
|
18
|
-
enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
|
|
24
|
-
value: mod,
|
|
25
|
-
enumerable: true
|
|
26
|
-
}) : target, mod));
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/rolldown-runtime.js
|
|
30
|
-
var __create = Object.create;
|
|
31
|
-
var __defProp = Object.defineProperty;
|
|
32
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
33
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
34
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
35
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
36
|
-
var __esm = (fn, res) => function() {
|
|
37
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
38
|
-
};
|
|
39
|
-
var __commonJS = (cb, mod) => function() {
|
|
40
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
41
|
-
};
|
|
42
|
-
var __export = (target, all) => {
|
|
43
|
-
for (var name in all) __defProp(target, name, {
|
|
44
|
-
get: all[name],
|
|
45
|
-
enumerable: true
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
var __copyProps = (to, from, except, desc) => {
|
|
49
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
50
|
-
key = keys[i];
|
|
51
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
52
|
-
get: ((k) => from[k]).bind(null, key),
|
|
53
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return to;
|
|
57
|
-
};
|
|
58
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
59
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
60
|
-
value: mod,
|
|
61
|
-
enumerable: true
|
|
62
|
-
}) : target, mod));
|
|
63
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/vender.js
|
|
67
|
-
var require_deepMerge = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js"(exports$1) {
|
|
68
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
69
|
-
exports$1.isObjectNotArray = isObjectNotArray;
|
|
70
|
-
exports$1.deepMerge = deepMerge;
|
|
71
|
-
/**
|
|
72
|
-
* Check if the variable contains an object strictly rejecting arrays
|
|
73
|
-
* @returns `true` if obj is an object
|
|
74
|
-
*/
|
|
75
|
-
function isObjectNotArray(obj) {
|
|
76
|
-
return typeof obj === "object" && obj != null && !Array.isArray(obj);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Pure function - doesn't mutate either parameter!
|
|
80
|
-
* Merges two objects together deeply, overwriting the properties in first with the properties in second
|
|
81
|
-
* @param first The first object
|
|
82
|
-
* @param second The second object
|
|
83
|
-
* @returns a new object
|
|
84
|
-
*/
|
|
85
|
-
function deepMerge(first = {}, second = {}) {
|
|
86
|
-
const keys = new Set([...Object.keys(first), ...Object.keys(second)]);
|
|
87
|
-
return Object.fromEntries([...keys].map((key) => {
|
|
88
|
-
const firstHasKey = key in first;
|
|
89
|
-
const secondHasKey = key in second;
|
|
90
|
-
const firstValue = first[key];
|
|
91
|
-
const secondValue = second[key];
|
|
92
|
-
let value;
|
|
93
|
-
if (firstHasKey && secondHasKey) if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) value = deepMerge(firstValue, secondValue);
|
|
94
|
-
else value = secondValue;
|
|
95
|
-
else if (firstHasKey) value = firstValue;
|
|
96
|
-
else value = secondValue;
|
|
97
|
-
return [key, value];
|
|
98
|
-
}));
|
|
99
|
-
}
|
|
100
|
-
} });
|
|
101
|
-
var require_applyDefault = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js"(exports$1) {
|
|
102
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
103
|
-
exports$1.applyDefault = applyDefault;
|
|
104
|
-
const deepMerge_1 = require_deepMerge();
|
|
105
|
-
/**
|
|
106
|
-
* Pure function - doesn't mutate either parameter!
|
|
107
|
-
* Uses the default options and overrides with the options provided by the user
|
|
108
|
-
* @param defaultOptions the defaults
|
|
109
|
-
* @param userOptions the user opts
|
|
110
|
-
* @returns the options with defaults
|
|
111
|
-
*/
|
|
112
|
-
function applyDefault(defaultOptions, userOptions) {
|
|
113
|
-
const options = structuredClone(defaultOptions);
|
|
114
|
-
if (userOptions == null) return options;
|
|
115
|
-
options.forEach((opt, i) => {
|
|
116
|
-
if (userOptions[i] !== void 0) {
|
|
117
|
-
const userOpt = userOptions[i];
|
|
118
|
-
if ((0, deepMerge_1.isObjectNotArray)(userOpt) && (0, deepMerge_1.isObjectNotArray)(opt)) options[i] = (0, deepMerge_1.deepMerge)(opt, userOpt);
|
|
119
|
-
else options[i] = userOpt;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
return options;
|
|
123
|
-
}
|
|
124
|
-
} });
|
|
125
|
-
var require_parserSeemsToBeTSESLint = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js"(exports$1) {
|
|
126
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
127
|
-
exports$1.parserSeemsToBeTSESLint = parserSeemsToBeTSESLint;
|
|
128
|
-
function parserSeemsToBeTSESLint(parser) {
|
|
129
|
-
return !!parser && /(?:typescript-eslint|\.\.)[\w/\\]*parser/.test(parser);
|
|
130
|
-
}
|
|
131
|
-
} });
|
|
132
|
-
var require_getParserServices = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js"(exports$1) {
|
|
133
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
134
|
-
exports$1.getParserServices = getParserServices;
|
|
135
|
-
const parserSeemsToBeTSESLint_1 = require_parserSeemsToBeTSESLint();
|
|
136
|
-
const ERROR_MESSAGE_REQUIRES_PARSER_SERVICES = "You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://typescript-eslint.io/getting-started/typed-linting for enabling linting with type information.";
|
|
137
|
-
const ERROR_MESSAGE_UNKNOWN_PARSER = "Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward \"parserOptions.project\" to @typescript-eslint/parser.";
|
|
138
|
-
function getParserServices(context, allowWithoutFullTypeInformation = false) {
|
|
139
|
-
const parser = context.parserPath || context.languageOptions.parser?.meta?.name;
|
|
140
|
-
if (context.sourceCode.parserServices?.esTreeNodeToTSNodeMap == null || context.sourceCode.parserServices.tsNodeToESTreeNodeMap == null) throwError(parser);
|
|
141
|
-
if (context.sourceCode.parserServices.program == null && !allowWithoutFullTypeInformation) throwError(parser);
|
|
142
|
-
return context.sourceCode.parserServices;
|
|
143
|
-
}
|
|
144
|
-
function throwError(parser) {
|
|
145
|
-
const messages = [
|
|
146
|
-
ERROR_MESSAGE_REQUIRES_PARSER_SERVICES,
|
|
147
|
-
`Parser: ${parser || "(unknown)"}`,
|
|
148
|
-
!(0, parserSeemsToBeTSESLint_1.parserSeemsToBeTSESLint)(parser) && ERROR_MESSAGE_UNKNOWN_PARSER
|
|
149
|
-
].filter(Boolean);
|
|
150
|
-
throw new Error(messages.join("\n"));
|
|
151
|
-
}
|
|
152
|
-
} });
|
|
153
|
-
var require_InferTypesFromRule = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js"(exports$1) {
|
|
154
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
155
|
-
} });
|
|
156
|
-
var require_nullThrows = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js"(exports$1) {
|
|
157
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
158
|
-
exports$1.NullThrowsReasons = void 0;
|
|
159
|
-
exports$1.nullThrows = nullThrows;
|
|
160
|
-
/**
|
|
161
|
-
* A set of common reasons for calling nullThrows
|
|
162
|
-
*/
|
|
163
|
-
exports$1.NullThrowsReasons = {
|
|
164
|
-
MissingParent: "Expected node to have a parent.",
|
|
165
|
-
MissingToken: (token, thing) => `Expected to find a ${token} for the ${thing}.`
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* Assert that a value must not be null or undefined.
|
|
169
|
-
* This is a nice explicit alternative to the non-null assertion operator.
|
|
170
|
-
*/
|
|
171
|
-
function nullThrows(value, message) {
|
|
172
|
-
if (value == null) throw new Error(`Non-null Assertion Failed: ${message}`);
|
|
173
|
-
return value;
|
|
174
|
-
}
|
|
175
|
-
} });
|
|
176
|
-
var require_RuleCreator = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js"(exports$1) {
|
|
177
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
178
|
-
exports$1.RuleCreator = RuleCreator;
|
|
179
|
-
const applyDefault_1 = require_applyDefault();
|
|
180
|
-
/**
|
|
181
|
-
* Creates reusable function to create rules with default options and docs URLs.
|
|
182
|
-
*
|
|
183
|
-
* @param urlCreator Creates a documentation URL for a given rule name.
|
|
184
|
-
* @returns Function to create a rule with the docs URL format.
|
|
185
|
-
*/
|
|
186
|
-
function RuleCreator(urlCreator) {
|
|
187
|
-
return function createNamedRule({ meta, name,...rule }) {
|
|
188
|
-
return createRule$1({
|
|
189
|
-
meta: {
|
|
190
|
-
...meta,
|
|
191
|
-
docs: {
|
|
192
|
-
...meta.docs,
|
|
193
|
-
url: urlCreator(name)
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
...rule
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function createRule$1({ create, defaultOptions, meta }) {
|
|
201
|
-
return {
|
|
202
|
-
create(context) {
|
|
203
|
-
const optionsWithDefault = (0, applyDefault_1.applyDefault)(defaultOptions, context.options);
|
|
204
|
-
return create(context, optionsWithDefault);
|
|
205
|
-
},
|
|
206
|
-
defaultOptions,
|
|
207
|
-
meta
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Creates a well-typed TSESLint custom ESLint rule without a docs URL.
|
|
212
|
-
*
|
|
213
|
-
* @returns Well-typed TSESLint custom ESLint rule.
|
|
214
|
-
* @remarks It is generally better to provide a docs URL function to RuleCreator.
|
|
215
|
-
*/
|
|
216
|
-
RuleCreator.withoutDocs = function withoutDocs(args) {
|
|
217
|
-
return createRule$1(args);
|
|
218
|
-
};
|
|
219
|
-
} });
|
|
220
|
-
var require_eslint_utils$1 = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js"(exports$1) {
|
|
221
|
-
var __createBinding$7 = Object.create ? function(o, m, k, k2) {
|
|
222
|
-
if (k2 === void 0) k2 = k;
|
|
223
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
224
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
225
|
-
enumerable: true,
|
|
226
|
-
get: function() {
|
|
227
|
-
return m[k];
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
Object.defineProperty(o, k2, desc);
|
|
231
|
-
} : function(o, m, k, k2) {
|
|
232
|
-
if (k2 === void 0) k2 = k;
|
|
233
|
-
o[k2] = m[k];
|
|
234
|
-
};
|
|
235
|
-
var __exportStar$2 = function(m, exports$1$1) {
|
|
236
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1$1, p)) __createBinding$7(exports$1$1, m, p);
|
|
237
|
-
};
|
|
238
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
239
|
-
__exportStar$2(require_applyDefault(), exports$1);
|
|
240
|
-
__exportStar$2(require_deepMerge(), exports$1);
|
|
241
|
-
__exportStar$2(require_getParserServices(), exports$1);
|
|
242
|
-
__exportStar$2(require_InferTypesFromRule(), exports$1);
|
|
243
|
-
__exportStar$2(require_nullThrows(), exports$1);
|
|
244
|
-
__exportStar$2(require_RuleCreator(), exports$1);
|
|
245
|
-
} });
|
|
246
|
-
var require_astUtilities = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.js"(exports$1) {
|
|
247
|
-
var __createBinding$6 = Object.create ? function(o, m, k, k2) {
|
|
248
|
-
if (k2 === void 0) k2 = k;
|
|
249
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
250
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
251
|
-
enumerable: true,
|
|
252
|
-
get: function() {
|
|
253
|
-
return m[k];
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
Object.defineProperty(o, k2, desc);
|
|
257
|
-
} : function(o, m, k, k2) {
|
|
258
|
-
if (k2 === void 0) k2 = k;
|
|
259
|
-
o[k2] = m[k];
|
|
260
|
-
};
|
|
261
|
-
var __setModuleDefault$4 = Object.create ? function(o, v) {
|
|
262
|
-
Object.defineProperty(o, "default", {
|
|
263
|
-
enumerable: true,
|
|
264
|
-
value: v
|
|
265
|
-
});
|
|
266
|
-
} : function(o, v) {
|
|
267
|
-
o["default"] = v;
|
|
268
|
-
};
|
|
269
|
-
var __importStar$4 = function() {
|
|
270
|
-
var ownKeys = function(o) {
|
|
271
|
-
ownKeys = Object.getOwnPropertyNames || function(o$1) {
|
|
272
|
-
var ar = [];
|
|
273
|
-
for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
|
|
274
|
-
return ar;
|
|
275
|
-
};
|
|
276
|
-
return ownKeys(o);
|
|
277
|
-
};
|
|
278
|
-
return function(mod) {
|
|
279
|
-
if (mod && mod.__esModule) return mod;
|
|
280
|
-
var result = {};
|
|
281
|
-
if (mod != null) {
|
|
282
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$6(result, mod, k[i]);
|
|
283
|
-
}
|
|
284
|
-
__setModuleDefault$4(result, mod);
|
|
285
|
-
return result;
|
|
286
|
-
};
|
|
287
|
-
}();
|
|
288
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
289
|
-
exports$1.isParenthesized = exports$1.hasSideEffect = exports$1.getStringIfConstant = exports$1.getStaticValue = exports$1.getPropertyName = exports$1.getFunctionNameWithKind = exports$1.getFunctionHeadLocation = void 0;
|
|
290
|
-
const eslintUtils$4 = __importStar$4(__require("@eslint-community/eslint-utils"));
|
|
291
|
-
/**
|
|
292
|
-
* Get the proper location of a given function node to report.
|
|
293
|
-
*
|
|
294
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation}
|
|
295
|
-
*/
|
|
296
|
-
exports$1.getFunctionHeadLocation = eslintUtils$4.getFunctionHeadLocation;
|
|
297
|
-
/**
|
|
298
|
-
* Get the name and kind of a given function node.
|
|
299
|
-
*
|
|
300
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind}
|
|
301
|
-
*/
|
|
302
|
-
exports$1.getFunctionNameWithKind = eslintUtils$4.getFunctionNameWithKind;
|
|
303
|
-
/**
|
|
304
|
-
* Get the property name of a given property node.
|
|
305
|
-
* If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
|
|
306
|
-
*
|
|
307
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname}
|
|
308
|
-
* @returns The property name of the node. If the property name is not constant then it returns `null`.
|
|
309
|
-
*/
|
|
310
|
-
exports$1.getPropertyName = eslintUtils$4.getPropertyName;
|
|
311
|
-
/**
|
|
312
|
-
* Get the value of a given node if it can decide the value statically.
|
|
313
|
-
* If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
|
|
314
|
-
* given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
|
|
315
|
-
* not been modified.
|
|
316
|
-
* For example, it considers `Symbol.iterator`, `Symbol.for('k')`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static, but `Symbol('k')` is not static.
|
|
317
|
-
*
|
|
318
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue}
|
|
319
|
-
* @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
|
|
320
|
-
* static value of the node, it returns `null`.
|
|
321
|
-
*/
|
|
322
|
-
exports$1.getStaticValue = eslintUtils$4.getStaticValue;
|
|
323
|
-
/**
|
|
324
|
-
* Get the string value of a given node.
|
|
325
|
-
* This function is a tiny wrapper of the getStaticValue function.
|
|
326
|
-
*
|
|
327
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant}
|
|
328
|
-
*/
|
|
329
|
-
exports$1.getStringIfConstant = eslintUtils$4.getStringIfConstant;
|
|
330
|
-
/**
|
|
331
|
-
* Check whether a given node has any side effect or not.
|
|
332
|
-
* The side effect means that it may modify a certain variable or object member. This function considers the node which
|
|
333
|
-
* contains the following types as the node which has side effects:
|
|
334
|
-
* - `AssignmentExpression`
|
|
335
|
-
* - `AwaitExpression`
|
|
336
|
-
* - `CallExpression`
|
|
337
|
-
* - `ImportExpression`
|
|
338
|
-
* - `NewExpression`
|
|
339
|
-
* - `UnaryExpression([operator = "delete"])`
|
|
340
|
-
* - `UpdateExpression`
|
|
341
|
-
* - `YieldExpression`
|
|
342
|
-
* - When `options.considerGetters` is `true`:
|
|
343
|
-
* - `MemberExpression`
|
|
344
|
-
* - When `options.considerImplicitTypeConversion` is `true`:
|
|
345
|
-
* - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
|
|
346
|
-
* - `MemberExpression([computed = true])`
|
|
347
|
-
* - `MethodDefinition([computed = true])`
|
|
348
|
-
* - `Property([computed = true])`
|
|
349
|
-
* - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
|
|
350
|
-
*
|
|
351
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect}
|
|
352
|
-
*/
|
|
353
|
-
exports$1.hasSideEffect = eslintUtils$4.hasSideEffect;
|
|
354
|
-
exports$1.isParenthesized = eslintUtils$4.isParenthesized;
|
|
355
|
-
} });
|
|
356
|
-
var require_PatternMatcher = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.js"(exports$1) {
|
|
357
|
-
var __createBinding$5 = Object.create ? function(o, m, k, k2) {
|
|
358
|
-
if (k2 === void 0) k2 = k;
|
|
359
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
360
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
361
|
-
enumerable: true,
|
|
362
|
-
get: function() {
|
|
363
|
-
return m[k];
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
Object.defineProperty(o, k2, desc);
|
|
367
|
-
} : function(o, m, k, k2) {
|
|
368
|
-
if (k2 === void 0) k2 = k;
|
|
369
|
-
o[k2] = m[k];
|
|
370
|
-
};
|
|
371
|
-
var __setModuleDefault$3 = Object.create ? function(o, v) {
|
|
372
|
-
Object.defineProperty(o, "default", {
|
|
373
|
-
enumerable: true,
|
|
374
|
-
value: v
|
|
375
|
-
});
|
|
376
|
-
} : function(o, v) {
|
|
377
|
-
o["default"] = v;
|
|
378
|
-
};
|
|
379
|
-
var __importStar$3 = function() {
|
|
380
|
-
var ownKeys = function(o) {
|
|
381
|
-
ownKeys = Object.getOwnPropertyNames || function(o$1) {
|
|
382
|
-
var ar = [];
|
|
383
|
-
for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
|
|
384
|
-
return ar;
|
|
385
|
-
};
|
|
386
|
-
return ownKeys(o);
|
|
387
|
-
};
|
|
388
|
-
return function(mod) {
|
|
389
|
-
if (mod && mod.__esModule) return mod;
|
|
390
|
-
var result = {};
|
|
391
|
-
if (mod != null) {
|
|
392
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$5(result, mod, k[i]);
|
|
393
|
-
}
|
|
394
|
-
__setModuleDefault$3(result, mod);
|
|
395
|
-
return result;
|
|
396
|
-
};
|
|
397
|
-
}();
|
|
398
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
399
|
-
exports$1.PatternMatcher = void 0;
|
|
400
|
-
const eslintUtils$3 = __importStar$3(__require("@eslint-community/eslint-utils"));
|
|
401
|
-
/**
|
|
402
|
-
* The class to find a pattern in strings as handling escape sequences.
|
|
403
|
-
* It ignores the found pattern if it's escaped with `\`.
|
|
404
|
-
*
|
|
405
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class}
|
|
406
|
-
*/
|
|
407
|
-
exports$1.PatternMatcher = eslintUtils$3.PatternMatcher;
|
|
408
|
-
} });
|
|
409
|
-
var require_predicates$1 = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.js"(exports$1) {
|
|
410
|
-
var __createBinding$4 = Object.create ? function(o, m, k, k2) {
|
|
411
|
-
if (k2 === void 0) k2 = k;
|
|
412
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
413
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
414
|
-
enumerable: true,
|
|
415
|
-
get: function() {
|
|
416
|
-
return m[k];
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
Object.defineProperty(o, k2, desc);
|
|
420
|
-
} : function(o, m, k, k2) {
|
|
421
|
-
if (k2 === void 0) k2 = k;
|
|
422
|
-
o[k2] = m[k];
|
|
423
|
-
};
|
|
424
|
-
var __setModuleDefault$2 = Object.create ? function(o, v) {
|
|
425
|
-
Object.defineProperty(o, "default", {
|
|
426
|
-
enumerable: true,
|
|
427
|
-
value: v
|
|
428
|
-
});
|
|
429
|
-
} : function(o, v) {
|
|
430
|
-
o["default"] = v;
|
|
431
|
-
};
|
|
432
|
-
var __importStar$2 = function() {
|
|
433
|
-
var ownKeys = function(o) {
|
|
434
|
-
ownKeys = Object.getOwnPropertyNames || function(o$1) {
|
|
435
|
-
var ar = [];
|
|
436
|
-
for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
|
|
437
|
-
return ar;
|
|
438
|
-
};
|
|
439
|
-
return ownKeys(o);
|
|
440
|
-
};
|
|
441
|
-
return function(mod) {
|
|
442
|
-
if (mod && mod.__esModule) return mod;
|
|
443
|
-
var result = {};
|
|
444
|
-
if (mod != null) {
|
|
445
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$4(result, mod, k[i]);
|
|
446
|
-
}
|
|
447
|
-
__setModuleDefault$2(result, mod);
|
|
448
|
-
return result;
|
|
449
|
-
};
|
|
450
|
-
}();
|
|
451
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
452
|
-
exports$1.isNotSemicolonToken = exports$1.isSemicolonToken = exports$1.isNotOpeningParenToken = exports$1.isOpeningParenToken = exports$1.isNotOpeningBracketToken = exports$1.isOpeningBracketToken = exports$1.isNotOpeningBraceToken = exports$1.isOpeningBraceToken = exports$1.isNotCommentToken = exports$1.isCommentToken = exports$1.isNotCommaToken = exports$1.isCommaToken = exports$1.isNotColonToken = exports$1.isColonToken = exports$1.isNotClosingParenToken = exports$1.isClosingParenToken = exports$1.isNotClosingBracketToken = exports$1.isClosingBracketToken = exports$1.isNotClosingBraceToken = exports$1.isClosingBraceToken = exports$1.isNotArrowToken = exports$1.isArrowToken = void 0;
|
|
453
|
-
const eslintUtils$2 = __importStar$2(__require("@eslint-community/eslint-utils"));
|
|
454
|
-
exports$1.isArrowToken = eslintUtils$2.isArrowToken;
|
|
455
|
-
exports$1.isNotArrowToken = eslintUtils$2.isNotArrowToken;
|
|
456
|
-
exports$1.isClosingBraceToken = eslintUtils$2.isClosingBraceToken;
|
|
457
|
-
exports$1.isNotClosingBraceToken = eslintUtils$2.isNotClosingBraceToken;
|
|
458
|
-
exports$1.isClosingBracketToken = eslintUtils$2.isClosingBracketToken;
|
|
459
|
-
exports$1.isNotClosingBracketToken = eslintUtils$2.isNotClosingBracketToken;
|
|
460
|
-
exports$1.isClosingParenToken = eslintUtils$2.isClosingParenToken;
|
|
461
|
-
exports$1.isNotClosingParenToken = eslintUtils$2.isNotClosingParenToken;
|
|
462
|
-
exports$1.isColonToken = eslintUtils$2.isColonToken;
|
|
463
|
-
exports$1.isNotColonToken = eslintUtils$2.isNotColonToken;
|
|
464
|
-
exports$1.isCommaToken = eslintUtils$2.isCommaToken;
|
|
465
|
-
exports$1.isNotCommaToken = eslintUtils$2.isNotCommaToken;
|
|
466
|
-
exports$1.isCommentToken = eslintUtils$2.isCommentToken;
|
|
467
|
-
exports$1.isNotCommentToken = eslintUtils$2.isNotCommentToken;
|
|
468
|
-
exports$1.isOpeningBraceToken = eslintUtils$2.isOpeningBraceToken;
|
|
469
|
-
exports$1.isNotOpeningBraceToken = eslintUtils$2.isNotOpeningBraceToken;
|
|
470
|
-
exports$1.isOpeningBracketToken = eslintUtils$2.isOpeningBracketToken;
|
|
471
|
-
exports$1.isNotOpeningBracketToken = eslintUtils$2.isNotOpeningBracketToken;
|
|
472
|
-
exports$1.isOpeningParenToken = eslintUtils$2.isOpeningParenToken;
|
|
473
|
-
exports$1.isNotOpeningParenToken = eslintUtils$2.isNotOpeningParenToken;
|
|
474
|
-
exports$1.isSemicolonToken = eslintUtils$2.isSemicolonToken;
|
|
475
|
-
exports$1.isNotSemicolonToken = eslintUtils$2.isNotSemicolonToken;
|
|
476
|
-
} });
|
|
477
|
-
var require_ReferenceTracker = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.js"(exports$1) {
|
|
478
|
-
var __createBinding$3 = Object.create ? function(o, m, k, k2) {
|
|
479
|
-
if (k2 === void 0) k2 = k;
|
|
480
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
481
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
482
|
-
enumerable: true,
|
|
483
|
-
get: function() {
|
|
484
|
-
return m[k];
|
|
485
|
-
}
|
|
486
|
-
};
|
|
487
|
-
Object.defineProperty(o, k2, desc);
|
|
488
|
-
} : function(o, m, k, k2) {
|
|
489
|
-
if (k2 === void 0) k2 = k;
|
|
490
|
-
o[k2] = m[k];
|
|
491
|
-
};
|
|
492
|
-
var __setModuleDefault$1 = Object.create ? function(o, v) {
|
|
493
|
-
Object.defineProperty(o, "default", {
|
|
494
|
-
enumerable: true,
|
|
495
|
-
value: v
|
|
496
|
-
});
|
|
497
|
-
} : function(o, v) {
|
|
498
|
-
o["default"] = v;
|
|
499
|
-
};
|
|
500
|
-
var __importStar$1 = function() {
|
|
501
|
-
var ownKeys = function(o) {
|
|
502
|
-
ownKeys = Object.getOwnPropertyNames || function(o$1) {
|
|
503
|
-
var ar = [];
|
|
504
|
-
for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
|
|
505
|
-
return ar;
|
|
506
|
-
};
|
|
507
|
-
return ownKeys(o);
|
|
508
|
-
};
|
|
509
|
-
return function(mod) {
|
|
510
|
-
if (mod && mod.__esModule) return mod;
|
|
511
|
-
var result = {};
|
|
512
|
-
if (mod != null) {
|
|
513
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$3(result, mod, k[i]);
|
|
514
|
-
}
|
|
515
|
-
__setModuleDefault$1(result, mod);
|
|
516
|
-
return result;
|
|
517
|
-
};
|
|
518
|
-
}();
|
|
519
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
520
|
-
exports$1.ReferenceTracker = void 0;
|
|
521
|
-
const eslintUtils$1 = __importStar$1(__require("@eslint-community/eslint-utils"));
|
|
522
|
-
const ReferenceTrackerREAD = eslintUtils$1.ReferenceTracker.READ;
|
|
523
|
-
const ReferenceTrackerCALL = eslintUtils$1.ReferenceTracker.CALL;
|
|
524
|
-
const ReferenceTrackerCONSTRUCT = eslintUtils$1.ReferenceTracker.CONSTRUCT;
|
|
525
|
-
const ReferenceTrackerESM = eslintUtils$1.ReferenceTracker.ESM;
|
|
526
|
-
/**
|
|
527
|
-
* The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
|
|
528
|
-
*
|
|
529
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class}
|
|
530
|
-
*/
|
|
531
|
-
exports$1.ReferenceTracker = eslintUtils$1.ReferenceTracker;
|
|
532
|
-
} });
|
|
533
|
-
var require_scopeAnalysis = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.js"(exports$1) {
|
|
534
|
-
var __createBinding$2 = Object.create ? function(o, m, k, k2) {
|
|
535
|
-
if (k2 === void 0) k2 = k;
|
|
536
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
537
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
538
|
-
enumerable: true,
|
|
539
|
-
get: function() {
|
|
540
|
-
return m[k];
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
|
-
Object.defineProperty(o, k2, desc);
|
|
544
|
-
} : function(o, m, k, k2) {
|
|
545
|
-
if (k2 === void 0) k2 = k;
|
|
546
|
-
o[k2] = m[k];
|
|
547
|
-
};
|
|
548
|
-
var __setModuleDefault$1 = Object.create ? function(o, v) {
|
|
549
|
-
Object.defineProperty(o, "default", {
|
|
550
|
-
enumerable: true,
|
|
551
|
-
value: v
|
|
552
|
-
});
|
|
553
|
-
} : function(o, v) {
|
|
554
|
-
o["default"] = v;
|
|
555
|
-
};
|
|
556
|
-
var __importStar$1 = function() {
|
|
557
|
-
var ownKeys = function(o) {
|
|
558
|
-
ownKeys = Object.getOwnPropertyNames || function(o$1) {
|
|
559
|
-
var ar = [];
|
|
560
|
-
for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
|
|
561
|
-
return ar;
|
|
562
|
-
};
|
|
563
|
-
return ownKeys(o);
|
|
564
|
-
};
|
|
565
|
-
return function(mod) {
|
|
566
|
-
if (mod && mod.__esModule) return mod;
|
|
567
|
-
var result = {};
|
|
568
|
-
if (mod != null) {
|
|
569
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$2(result, mod, k[i]);
|
|
570
|
-
}
|
|
571
|
-
__setModuleDefault$1(result, mod);
|
|
572
|
-
return result;
|
|
573
|
-
};
|
|
574
|
-
}();
|
|
575
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
576
|
-
exports$1.getInnermostScope = exports$1.findVariable = void 0;
|
|
577
|
-
const eslintUtils = __importStar$1(__require("@eslint-community/eslint-utils"));
|
|
578
|
-
/**
|
|
579
|
-
* Get the variable of a given name.
|
|
580
|
-
*
|
|
581
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#findvariable}
|
|
582
|
-
*/
|
|
583
|
-
exports$1.findVariable = eslintUtils.findVariable;
|
|
584
|
-
/**
|
|
585
|
-
* Get the innermost scope which contains a given node.
|
|
586
|
-
*
|
|
587
|
-
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#getinnermostscope}
|
|
588
|
-
* @returns The innermost scope which contains the given node.
|
|
589
|
-
* If such scope doesn't exist then it returns the 1st argument `initialScope`.
|
|
590
|
-
*/
|
|
591
|
-
exports$1.getInnermostScope = eslintUtils.getInnermostScope;
|
|
592
|
-
} });
|
|
593
|
-
var require_eslint_utils = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.js"(exports$1) {
|
|
594
|
-
var __createBinding$1$1 = Object.create ? function(o, m, k, k2) {
|
|
595
|
-
if (k2 === void 0) k2 = k;
|
|
596
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
597
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
598
|
-
enumerable: true,
|
|
599
|
-
get: function() {
|
|
600
|
-
return m[k];
|
|
601
|
-
}
|
|
602
|
-
};
|
|
603
|
-
Object.defineProperty(o, k2, desc);
|
|
604
|
-
} : function(o, m, k, k2) {
|
|
605
|
-
if (k2 === void 0) k2 = k;
|
|
606
|
-
o[k2] = m[k];
|
|
607
|
-
};
|
|
608
|
-
var __exportStar$1 = function(m, exports$1$1) {
|
|
609
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1$1, p)) __createBinding$1$1(exports$1$1, m, p);
|
|
610
|
-
};
|
|
611
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
612
|
-
__exportStar$1(require_astUtilities(), exports$1);
|
|
613
|
-
__exportStar$1(require_PatternMatcher(), exports$1);
|
|
614
|
-
__exportStar$1(require_predicates$1(), exports$1);
|
|
615
|
-
__exportStar$1(require_ReferenceTracker(), exports$1);
|
|
616
|
-
__exportStar$1(require_scopeAnalysis(), exports$1);
|
|
617
|
-
} });
|
|
618
|
-
var require_helpers = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.js"(exports$1) {
|
|
619
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
620
|
-
exports$1.isNotTokenOfTypeWithConditions = exports$1.isTokenOfTypeWithConditions = exports$1.isNodeOfTypeWithConditions = exports$1.isNodeOfTypes = exports$1.isNodeOfType = void 0;
|
|
621
|
-
const isNodeOfType = (nodeType) => (node) => node?.type === nodeType;
|
|
622
|
-
exports$1.isNodeOfType = isNodeOfType;
|
|
623
|
-
const isNodeOfTypes = (nodeTypes) => (node) => !!node && nodeTypes.includes(node.type);
|
|
624
|
-
exports$1.isNodeOfTypes = isNodeOfTypes;
|
|
625
|
-
const isNodeOfTypeWithConditions = (nodeType, conditions) => {
|
|
626
|
-
const entries = Object.entries(conditions);
|
|
627
|
-
return (node) => node?.type === nodeType && entries.every(([key, value]) => node[key] === value);
|
|
628
|
-
};
|
|
629
|
-
exports$1.isNodeOfTypeWithConditions = isNodeOfTypeWithConditions;
|
|
630
|
-
const isTokenOfTypeWithConditions = (tokenType, conditions) => {
|
|
631
|
-
const entries = Object.entries(conditions);
|
|
632
|
-
return (token) => token?.type === tokenType && entries.every(([key, value]) => token[key] === value);
|
|
633
|
-
};
|
|
634
|
-
exports$1.isTokenOfTypeWithConditions = isTokenOfTypeWithConditions;
|
|
635
|
-
const isNotTokenOfTypeWithConditions = (tokenType, conditions) => (token) => !(0, exports$1.isTokenOfTypeWithConditions)(tokenType, conditions)(token);
|
|
636
|
-
exports$1.isNotTokenOfTypeWithConditions = isNotTokenOfTypeWithConditions;
|
|
637
|
-
} });
|
|
638
|
-
var require_misc = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.js"(exports$1) {
|
|
639
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
640
|
-
exports$1.LINEBREAK_MATCHER = void 0;
|
|
641
|
-
exports$1.isTokenOnSameLine = isTokenOnSameLine;
|
|
642
|
-
exports$1.LINEBREAK_MATCHER = /\r\n|[\r\n\u2028\u2029]/;
|
|
643
|
-
/**
|
|
644
|
-
* Determines whether two adjacent tokens are on the same line
|
|
645
|
-
*/
|
|
646
|
-
function isTokenOnSameLine(left, right) {
|
|
647
|
-
return left.loc.end.line === right.loc.start.line;
|
|
648
|
-
}
|
|
649
|
-
} });
|
|
650
|
-
var require_ts_estree$1 = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ts-estree.js"(exports$1) {
|
|
651
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
652
|
-
exports$1.TSESTree = exports$1.AST_TOKEN_TYPES = exports$1.AST_NODE_TYPES = void 0;
|
|
653
|
-
var types_1 = __require("@typescript-eslint/types");
|
|
654
|
-
Object.defineProperty(exports$1, "AST_NODE_TYPES", {
|
|
655
|
-
enumerable: true,
|
|
656
|
-
get: function() {
|
|
657
|
-
return types_1.AST_NODE_TYPES;
|
|
658
|
-
}
|
|
659
|
-
});
|
|
660
|
-
Object.defineProperty(exports$1, "AST_TOKEN_TYPES", {
|
|
661
|
-
enumerable: true,
|
|
662
|
-
get: function() {
|
|
663
|
-
return types_1.AST_TOKEN_TYPES;
|
|
664
|
-
}
|
|
665
|
-
});
|
|
666
|
-
Object.defineProperty(exports$1, "TSESTree", {
|
|
667
|
-
enumerable: true,
|
|
668
|
-
get: function() {
|
|
669
|
-
return types_1.TSESTree;
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
} });
|
|
673
|
-
var require_predicates = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.js"(exports$1) {
|
|
674
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
675
|
-
exports$1.isLoop = exports$1.isImportKeyword = exports$1.isTypeKeyword = exports$1.isAwaitKeyword = exports$1.isAwaitExpression = exports$1.isIdentifier = exports$1.isConstructor = exports$1.isClassOrTypeElement = exports$1.isTSConstructorType = exports$1.isTSFunctionType = exports$1.isFunctionOrFunctionType = exports$1.isFunctionType = exports$1.isFunction = exports$1.isVariableDeclarator = exports$1.isTypeAssertion = exports$1.isLogicalOrOperator = exports$1.isOptionalCallExpression = exports$1.isNotNonNullAssertionPunctuator = exports$1.isNonNullAssertionPunctuator = exports$1.isNotOptionalChainPunctuator = exports$1.isOptionalChainPunctuator = void 0;
|
|
676
|
-
exports$1.isSetter = isSetter;
|
|
677
|
-
const ts_estree_1 = require_ts_estree$1();
|
|
678
|
-
const helpers_1 = require_helpers();
|
|
679
|
-
exports$1.isOptionalChainPunctuator = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: "?." });
|
|
680
|
-
exports$1.isNotOptionalChainPunctuator = (0, helpers_1.isNotTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: "?." });
|
|
681
|
-
exports$1.isNonNullAssertionPunctuator = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: "!" });
|
|
682
|
-
exports$1.isNotNonNullAssertionPunctuator = (0, helpers_1.isNotTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: "!" });
|
|
683
|
-
/**
|
|
684
|
-
* Returns true if and only if the node represents: foo?.() or foo.bar?.()
|
|
685
|
-
*/
|
|
686
|
-
exports$1.isOptionalCallExpression = (0, helpers_1.isNodeOfTypeWithConditions)(ts_estree_1.AST_NODE_TYPES.CallExpression, { optional: true });
|
|
687
|
-
/**
|
|
688
|
-
* Returns true if and only if the node represents logical OR
|
|
689
|
-
*/
|
|
690
|
-
exports$1.isLogicalOrOperator = (0, helpers_1.isNodeOfTypeWithConditions)(ts_estree_1.AST_NODE_TYPES.LogicalExpression, { operator: "||" });
|
|
691
|
-
/**
|
|
692
|
-
* Checks if a node is a type assertion:
|
|
693
|
-
* ```
|
|
694
|
-
* x as foo
|
|
695
|
-
* <foo>x
|
|
696
|
-
* ```
|
|
697
|
-
*/
|
|
698
|
-
exports$1.isTypeAssertion = (0, helpers_1.isNodeOfTypes)([ts_estree_1.AST_NODE_TYPES.TSAsExpression, ts_estree_1.AST_NODE_TYPES.TSTypeAssertion]);
|
|
699
|
-
exports$1.isVariableDeclarator = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.VariableDeclarator);
|
|
700
|
-
const functionTypes = [
|
|
701
|
-
ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression,
|
|
702
|
-
ts_estree_1.AST_NODE_TYPES.FunctionDeclaration,
|
|
703
|
-
ts_estree_1.AST_NODE_TYPES.FunctionExpression
|
|
704
|
-
];
|
|
705
|
-
exports$1.isFunction = (0, helpers_1.isNodeOfTypes)(functionTypes);
|
|
706
|
-
const functionTypeTypes = [
|
|
707
|
-
ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
|
|
708
|
-
ts_estree_1.AST_NODE_TYPES.TSConstructorType,
|
|
709
|
-
ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
|
|
710
|
-
ts_estree_1.AST_NODE_TYPES.TSDeclareFunction,
|
|
711
|
-
ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
|
|
712
|
-
ts_estree_1.AST_NODE_TYPES.TSFunctionType,
|
|
713
|
-
ts_estree_1.AST_NODE_TYPES.TSMethodSignature
|
|
714
|
-
];
|
|
715
|
-
exports$1.isFunctionType = (0, helpers_1.isNodeOfTypes)(functionTypeTypes);
|
|
716
|
-
exports$1.isFunctionOrFunctionType = (0, helpers_1.isNodeOfTypes)([...functionTypes, ...functionTypeTypes]);
|
|
717
|
-
exports$1.isTSFunctionType = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.TSFunctionType);
|
|
718
|
-
exports$1.isTSConstructorType = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.TSConstructorType);
|
|
719
|
-
exports$1.isClassOrTypeElement = (0, helpers_1.isNodeOfTypes)([
|
|
720
|
-
ts_estree_1.AST_NODE_TYPES.PropertyDefinition,
|
|
721
|
-
ts_estree_1.AST_NODE_TYPES.FunctionExpression,
|
|
722
|
-
ts_estree_1.AST_NODE_TYPES.MethodDefinition,
|
|
723
|
-
ts_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition,
|
|
724
|
-
ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition,
|
|
725
|
-
ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
|
|
726
|
-
ts_estree_1.AST_NODE_TYPES.TSIndexSignature,
|
|
727
|
-
ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
|
|
728
|
-
ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
|
|
729
|
-
ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
|
|
730
|
-
ts_estree_1.AST_NODE_TYPES.TSPropertySignature
|
|
731
|
-
]);
|
|
732
|
-
/**
|
|
733
|
-
* Checks if a node is a constructor method.
|
|
734
|
-
*/
|
|
735
|
-
exports$1.isConstructor = (0, helpers_1.isNodeOfTypeWithConditions)(ts_estree_1.AST_NODE_TYPES.MethodDefinition, { kind: "constructor" });
|
|
736
|
-
/**
|
|
737
|
-
* Checks if a node is a setter method.
|
|
738
|
-
*/
|
|
739
|
-
function isSetter(node) {
|
|
740
|
-
return !!node && (node.type === ts_estree_1.AST_NODE_TYPES.MethodDefinition || node.type === ts_estree_1.AST_NODE_TYPES.Property) && node.kind === "set";
|
|
741
|
-
}
|
|
742
|
-
exports$1.isIdentifier = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.Identifier);
|
|
743
|
-
/**
|
|
744
|
-
* Checks if a node represents an `await …` expression.
|
|
745
|
-
*/
|
|
746
|
-
exports$1.isAwaitExpression = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.AwaitExpression);
|
|
747
|
-
/**
|
|
748
|
-
* Checks if a possible token is the `await` keyword.
|
|
749
|
-
*/
|
|
750
|
-
exports$1.isAwaitKeyword = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Identifier, { value: "await" });
|
|
751
|
-
/**
|
|
752
|
-
* Checks if a possible token is the `type` keyword.
|
|
753
|
-
*/
|
|
754
|
-
exports$1.isTypeKeyword = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Identifier, { value: "type" });
|
|
755
|
-
/**
|
|
756
|
-
* Checks if a possible token is the `import` keyword.
|
|
757
|
-
*/
|
|
758
|
-
exports$1.isImportKeyword = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Keyword, { value: "import" });
|
|
759
|
-
exports$1.isLoop = (0, helpers_1.isNodeOfTypes)([
|
|
760
|
-
ts_estree_1.AST_NODE_TYPES.DoWhileStatement,
|
|
761
|
-
ts_estree_1.AST_NODE_TYPES.ForStatement,
|
|
762
|
-
ts_estree_1.AST_NODE_TYPES.ForInStatement,
|
|
763
|
-
ts_estree_1.AST_NODE_TYPES.ForOfStatement,
|
|
764
|
-
ts_estree_1.AST_NODE_TYPES.WhileStatement
|
|
765
|
-
]);
|
|
766
|
-
} });
|
|
767
|
-
var require_ast_utils = __commonJS({ "node_modules/.pnpm/@typescript-eslint+utils@8.34.0_eslint@9.28.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/utils/dist/ast-utils/index.js"(exports$1) {
|
|
768
|
-
var __createBinding$2 = Object.create ? function(o, m, k, k2) {
|
|
769
|
-
if (k2 === void 0) k2 = k;
|
|
770
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
771
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
772
|
-
enumerable: true,
|
|
773
|
-
get: function() {
|
|
774
|
-
return m[k];
|
|
775
|
-
}
|
|
776
|
-
};
|
|
777
|
-
Object.defineProperty(o, k2, desc);
|
|
778
|
-
} : function(o, m, k, k2) {
|
|
779
|
-
if (k2 === void 0) k2 = k;
|
|
780
|
-
o[k2] = m[k];
|
|
781
|
-
};
|
|
782
|
-
var __exportStar$1 = function(m, exports$1$1) {
|
|
783
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1$1, p)) __createBinding$2(exports$1$1, m, p);
|
|
784
|
-
};
|
|
785
|
-
Object.defineProperty(exports$1, "__esModule", { value: true });
|
|
786
|
-
__exportStar$1(require_eslint_utils(), exports$1);
|
|
787
|
-
__exportStar$1(require_helpers(), exports$1);
|
|
788
|
-
__exportStar$1(require_misc(), exports$1);
|
|
789
|
-
__exportStar$1(require_predicates(), exports$1);
|
|
790
|
-
} });
|
|
791
|
-
|
|
792
|
-
//#endregion
|
|
793
|
-
//#region node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js
|
|
794
|
-
var require_ast_spec = __commonJS$1({ "node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js"(exports) {
|
|
795
|
-
/**********************************************
|
|
796
|
-
* DO NOT MODIFY THIS FILE MANUALLY *
|
|
797
|
-
* *
|
|
798
|
-
* THIS FILE HAS BEEN COPIED FROM ast-spec. *
|
|
799
|
-
* ANY CHANGES WILL BE LOST ON THE NEXT BUILD *
|
|
800
|
-
* *
|
|
801
|
-
* MAKE CHANGES TO ast-spec AND THEN RUN *
|
|
802
|
-
* yarn build *
|
|
803
|
-
**********************************************/
|
|
804
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
805
|
-
exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0;
|
|
806
|
-
var AST_NODE_TYPES$2;
|
|
807
|
-
(function(AST_NODE_TYPES$3) {
|
|
808
|
-
AST_NODE_TYPES$3["AccessorProperty"] = "AccessorProperty";
|
|
809
|
-
AST_NODE_TYPES$3["ArrayExpression"] = "ArrayExpression";
|
|
810
|
-
AST_NODE_TYPES$3["ArrayPattern"] = "ArrayPattern";
|
|
811
|
-
AST_NODE_TYPES$3["ArrowFunctionExpression"] = "ArrowFunctionExpression";
|
|
812
|
-
AST_NODE_TYPES$3["AssignmentExpression"] = "AssignmentExpression";
|
|
813
|
-
AST_NODE_TYPES$3["AssignmentPattern"] = "AssignmentPattern";
|
|
814
|
-
AST_NODE_TYPES$3["AwaitExpression"] = "AwaitExpression";
|
|
815
|
-
AST_NODE_TYPES$3["BinaryExpression"] = "BinaryExpression";
|
|
816
|
-
AST_NODE_TYPES$3["BlockStatement"] = "BlockStatement";
|
|
817
|
-
AST_NODE_TYPES$3["BreakStatement"] = "BreakStatement";
|
|
818
|
-
AST_NODE_TYPES$3["CallExpression"] = "CallExpression";
|
|
819
|
-
AST_NODE_TYPES$3["CatchClause"] = "CatchClause";
|
|
820
|
-
AST_NODE_TYPES$3["ChainExpression"] = "ChainExpression";
|
|
821
|
-
AST_NODE_TYPES$3["ClassBody"] = "ClassBody";
|
|
822
|
-
AST_NODE_TYPES$3["ClassDeclaration"] = "ClassDeclaration";
|
|
823
|
-
AST_NODE_TYPES$3["ClassExpression"] = "ClassExpression";
|
|
824
|
-
AST_NODE_TYPES$3["ConditionalExpression"] = "ConditionalExpression";
|
|
825
|
-
AST_NODE_TYPES$3["ContinueStatement"] = "ContinueStatement";
|
|
826
|
-
AST_NODE_TYPES$3["DebuggerStatement"] = "DebuggerStatement";
|
|
827
|
-
AST_NODE_TYPES$3["Decorator"] = "Decorator";
|
|
828
|
-
AST_NODE_TYPES$3["DoWhileStatement"] = "DoWhileStatement";
|
|
829
|
-
AST_NODE_TYPES$3["EmptyStatement"] = "EmptyStatement";
|
|
830
|
-
AST_NODE_TYPES$3["ExportAllDeclaration"] = "ExportAllDeclaration";
|
|
831
|
-
AST_NODE_TYPES$3["ExportDefaultDeclaration"] = "ExportDefaultDeclaration";
|
|
832
|
-
AST_NODE_TYPES$3["ExportNamedDeclaration"] = "ExportNamedDeclaration";
|
|
833
|
-
AST_NODE_TYPES$3["ExportSpecifier"] = "ExportSpecifier";
|
|
834
|
-
AST_NODE_TYPES$3["ExpressionStatement"] = "ExpressionStatement";
|
|
835
|
-
AST_NODE_TYPES$3["ForInStatement"] = "ForInStatement";
|
|
836
|
-
AST_NODE_TYPES$3["ForOfStatement"] = "ForOfStatement";
|
|
837
|
-
AST_NODE_TYPES$3["ForStatement"] = "ForStatement";
|
|
838
|
-
AST_NODE_TYPES$3["FunctionDeclaration"] = "FunctionDeclaration";
|
|
839
|
-
AST_NODE_TYPES$3["FunctionExpression"] = "FunctionExpression";
|
|
840
|
-
AST_NODE_TYPES$3["Identifier"] = "Identifier";
|
|
841
|
-
AST_NODE_TYPES$3["IfStatement"] = "IfStatement";
|
|
842
|
-
AST_NODE_TYPES$3["ImportAttribute"] = "ImportAttribute";
|
|
843
|
-
AST_NODE_TYPES$3["ImportDeclaration"] = "ImportDeclaration";
|
|
844
|
-
AST_NODE_TYPES$3["ImportDefaultSpecifier"] = "ImportDefaultSpecifier";
|
|
845
|
-
AST_NODE_TYPES$3["ImportExpression"] = "ImportExpression";
|
|
846
|
-
AST_NODE_TYPES$3["ImportNamespaceSpecifier"] = "ImportNamespaceSpecifier";
|
|
847
|
-
AST_NODE_TYPES$3["ImportSpecifier"] = "ImportSpecifier";
|
|
848
|
-
AST_NODE_TYPES$3["JSXAttribute"] = "JSXAttribute";
|
|
849
|
-
AST_NODE_TYPES$3["JSXClosingElement"] = "JSXClosingElement";
|
|
850
|
-
AST_NODE_TYPES$3["JSXClosingFragment"] = "JSXClosingFragment";
|
|
851
|
-
AST_NODE_TYPES$3["JSXElement"] = "JSXElement";
|
|
852
|
-
AST_NODE_TYPES$3["JSXEmptyExpression"] = "JSXEmptyExpression";
|
|
853
|
-
AST_NODE_TYPES$3["JSXExpressionContainer"] = "JSXExpressionContainer";
|
|
854
|
-
AST_NODE_TYPES$3["JSXFragment"] = "JSXFragment";
|
|
855
|
-
AST_NODE_TYPES$3["JSXIdentifier"] = "JSXIdentifier";
|
|
856
|
-
AST_NODE_TYPES$3["JSXMemberExpression"] = "JSXMemberExpression";
|
|
857
|
-
AST_NODE_TYPES$3["JSXNamespacedName"] = "JSXNamespacedName";
|
|
858
|
-
AST_NODE_TYPES$3["JSXOpeningElement"] = "JSXOpeningElement";
|
|
859
|
-
AST_NODE_TYPES$3["JSXOpeningFragment"] = "JSXOpeningFragment";
|
|
860
|
-
AST_NODE_TYPES$3["JSXSpreadAttribute"] = "JSXSpreadAttribute";
|
|
861
|
-
AST_NODE_TYPES$3["JSXSpreadChild"] = "JSXSpreadChild";
|
|
862
|
-
AST_NODE_TYPES$3["JSXText"] = "JSXText";
|
|
863
|
-
AST_NODE_TYPES$3["LabeledStatement"] = "LabeledStatement";
|
|
864
|
-
AST_NODE_TYPES$3["Literal"] = "Literal";
|
|
865
|
-
AST_NODE_TYPES$3["LogicalExpression"] = "LogicalExpression";
|
|
866
|
-
AST_NODE_TYPES$3["MemberExpression"] = "MemberExpression";
|
|
867
|
-
AST_NODE_TYPES$3["MetaProperty"] = "MetaProperty";
|
|
868
|
-
AST_NODE_TYPES$3["MethodDefinition"] = "MethodDefinition";
|
|
869
|
-
AST_NODE_TYPES$3["NewExpression"] = "NewExpression";
|
|
870
|
-
AST_NODE_TYPES$3["ObjectExpression"] = "ObjectExpression";
|
|
871
|
-
AST_NODE_TYPES$3["ObjectPattern"] = "ObjectPattern";
|
|
872
|
-
AST_NODE_TYPES$3["PrivateIdentifier"] = "PrivateIdentifier";
|
|
873
|
-
AST_NODE_TYPES$3["Program"] = "Program";
|
|
874
|
-
AST_NODE_TYPES$3["Property"] = "Property";
|
|
875
|
-
AST_NODE_TYPES$3["PropertyDefinition"] = "PropertyDefinition";
|
|
876
|
-
AST_NODE_TYPES$3["RestElement"] = "RestElement";
|
|
877
|
-
AST_NODE_TYPES$3["ReturnStatement"] = "ReturnStatement";
|
|
878
|
-
AST_NODE_TYPES$3["SequenceExpression"] = "SequenceExpression";
|
|
879
|
-
AST_NODE_TYPES$3["SpreadElement"] = "SpreadElement";
|
|
880
|
-
AST_NODE_TYPES$3["StaticBlock"] = "StaticBlock";
|
|
881
|
-
AST_NODE_TYPES$3["Super"] = "Super";
|
|
882
|
-
AST_NODE_TYPES$3["SwitchCase"] = "SwitchCase";
|
|
883
|
-
AST_NODE_TYPES$3["SwitchStatement"] = "SwitchStatement";
|
|
884
|
-
AST_NODE_TYPES$3["TaggedTemplateExpression"] = "TaggedTemplateExpression";
|
|
885
|
-
AST_NODE_TYPES$3["TemplateElement"] = "TemplateElement";
|
|
886
|
-
AST_NODE_TYPES$3["TemplateLiteral"] = "TemplateLiteral";
|
|
887
|
-
AST_NODE_TYPES$3["ThisExpression"] = "ThisExpression";
|
|
888
|
-
AST_NODE_TYPES$3["ThrowStatement"] = "ThrowStatement";
|
|
889
|
-
AST_NODE_TYPES$3["TryStatement"] = "TryStatement";
|
|
890
|
-
AST_NODE_TYPES$3["UnaryExpression"] = "UnaryExpression";
|
|
891
|
-
AST_NODE_TYPES$3["UpdateExpression"] = "UpdateExpression";
|
|
892
|
-
AST_NODE_TYPES$3["VariableDeclaration"] = "VariableDeclaration";
|
|
893
|
-
AST_NODE_TYPES$3["VariableDeclarator"] = "VariableDeclarator";
|
|
894
|
-
AST_NODE_TYPES$3["WhileStatement"] = "WhileStatement";
|
|
895
|
-
AST_NODE_TYPES$3["WithStatement"] = "WithStatement";
|
|
896
|
-
AST_NODE_TYPES$3["YieldExpression"] = "YieldExpression";
|
|
897
|
-
AST_NODE_TYPES$3["TSAbstractAccessorProperty"] = "TSAbstractAccessorProperty";
|
|
898
|
-
AST_NODE_TYPES$3["TSAbstractKeyword"] = "TSAbstractKeyword";
|
|
899
|
-
AST_NODE_TYPES$3["TSAbstractMethodDefinition"] = "TSAbstractMethodDefinition";
|
|
900
|
-
AST_NODE_TYPES$3["TSAbstractPropertyDefinition"] = "TSAbstractPropertyDefinition";
|
|
901
|
-
AST_NODE_TYPES$3["TSAnyKeyword"] = "TSAnyKeyword";
|
|
902
|
-
AST_NODE_TYPES$3["TSArrayType"] = "TSArrayType";
|
|
903
|
-
AST_NODE_TYPES$3["TSAsExpression"] = "TSAsExpression";
|
|
904
|
-
AST_NODE_TYPES$3["TSAsyncKeyword"] = "TSAsyncKeyword";
|
|
905
|
-
AST_NODE_TYPES$3["TSBigIntKeyword"] = "TSBigIntKeyword";
|
|
906
|
-
AST_NODE_TYPES$3["TSBooleanKeyword"] = "TSBooleanKeyword";
|
|
907
|
-
AST_NODE_TYPES$3["TSCallSignatureDeclaration"] = "TSCallSignatureDeclaration";
|
|
908
|
-
AST_NODE_TYPES$3["TSClassImplements"] = "TSClassImplements";
|
|
909
|
-
AST_NODE_TYPES$3["TSConditionalType"] = "TSConditionalType";
|
|
910
|
-
AST_NODE_TYPES$3["TSConstructorType"] = "TSConstructorType";
|
|
911
|
-
AST_NODE_TYPES$3["TSConstructSignatureDeclaration"] = "TSConstructSignatureDeclaration";
|
|
912
|
-
AST_NODE_TYPES$3["TSDeclareFunction"] = "TSDeclareFunction";
|
|
913
|
-
AST_NODE_TYPES$3["TSDeclareKeyword"] = "TSDeclareKeyword";
|
|
914
|
-
AST_NODE_TYPES$3["TSEmptyBodyFunctionExpression"] = "TSEmptyBodyFunctionExpression";
|
|
915
|
-
AST_NODE_TYPES$3["TSEnumBody"] = "TSEnumBody";
|
|
916
|
-
AST_NODE_TYPES$3["TSEnumDeclaration"] = "TSEnumDeclaration";
|
|
917
|
-
AST_NODE_TYPES$3["TSEnumMember"] = "TSEnumMember";
|
|
918
|
-
AST_NODE_TYPES$3["TSExportAssignment"] = "TSExportAssignment";
|
|
919
|
-
AST_NODE_TYPES$3["TSExportKeyword"] = "TSExportKeyword";
|
|
920
|
-
AST_NODE_TYPES$3["TSExternalModuleReference"] = "TSExternalModuleReference";
|
|
921
|
-
AST_NODE_TYPES$3["TSFunctionType"] = "TSFunctionType";
|
|
922
|
-
AST_NODE_TYPES$3["TSImportEqualsDeclaration"] = "TSImportEqualsDeclaration";
|
|
923
|
-
AST_NODE_TYPES$3["TSImportType"] = "TSImportType";
|
|
924
|
-
AST_NODE_TYPES$3["TSIndexedAccessType"] = "TSIndexedAccessType";
|
|
925
|
-
AST_NODE_TYPES$3["TSIndexSignature"] = "TSIndexSignature";
|
|
926
|
-
AST_NODE_TYPES$3["TSInferType"] = "TSInferType";
|
|
927
|
-
AST_NODE_TYPES$3["TSInstantiationExpression"] = "TSInstantiationExpression";
|
|
928
|
-
AST_NODE_TYPES$3["TSInterfaceBody"] = "TSInterfaceBody";
|
|
929
|
-
AST_NODE_TYPES$3["TSInterfaceDeclaration"] = "TSInterfaceDeclaration";
|
|
930
|
-
AST_NODE_TYPES$3["TSInterfaceHeritage"] = "TSInterfaceHeritage";
|
|
931
|
-
AST_NODE_TYPES$3["TSIntersectionType"] = "TSIntersectionType";
|
|
932
|
-
AST_NODE_TYPES$3["TSIntrinsicKeyword"] = "TSIntrinsicKeyword";
|
|
933
|
-
AST_NODE_TYPES$3["TSLiteralType"] = "TSLiteralType";
|
|
934
|
-
AST_NODE_TYPES$3["TSMappedType"] = "TSMappedType";
|
|
935
|
-
AST_NODE_TYPES$3["TSMethodSignature"] = "TSMethodSignature";
|
|
936
|
-
AST_NODE_TYPES$3["TSModuleBlock"] = "TSModuleBlock";
|
|
937
|
-
AST_NODE_TYPES$3["TSModuleDeclaration"] = "TSModuleDeclaration";
|
|
938
|
-
AST_NODE_TYPES$3["TSNamedTupleMember"] = "TSNamedTupleMember";
|
|
939
|
-
AST_NODE_TYPES$3["TSNamespaceExportDeclaration"] = "TSNamespaceExportDeclaration";
|
|
940
|
-
AST_NODE_TYPES$3["TSNeverKeyword"] = "TSNeverKeyword";
|
|
941
|
-
AST_NODE_TYPES$3["TSNonNullExpression"] = "TSNonNullExpression";
|
|
942
|
-
AST_NODE_TYPES$3["TSNullKeyword"] = "TSNullKeyword";
|
|
943
|
-
AST_NODE_TYPES$3["TSNumberKeyword"] = "TSNumberKeyword";
|
|
944
|
-
AST_NODE_TYPES$3["TSObjectKeyword"] = "TSObjectKeyword";
|
|
945
|
-
AST_NODE_TYPES$3["TSOptionalType"] = "TSOptionalType";
|
|
946
|
-
AST_NODE_TYPES$3["TSParameterProperty"] = "TSParameterProperty";
|
|
947
|
-
AST_NODE_TYPES$3["TSPrivateKeyword"] = "TSPrivateKeyword";
|
|
948
|
-
AST_NODE_TYPES$3["TSPropertySignature"] = "TSPropertySignature";
|
|
949
|
-
AST_NODE_TYPES$3["TSProtectedKeyword"] = "TSProtectedKeyword";
|
|
950
|
-
AST_NODE_TYPES$3["TSPublicKeyword"] = "TSPublicKeyword";
|
|
951
|
-
AST_NODE_TYPES$3["TSQualifiedName"] = "TSQualifiedName";
|
|
952
|
-
AST_NODE_TYPES$3["TSReadonlyKeyword"] = "TSReadonlyKeyword";
|
|
953
|
-
AST_NODE_TYPES$3["TSRestType"] = "TSRestType";
|
|
954
|
-
AST_NODE_TYPES$3["TSSatisfiesExpression"] = "TSSatisfiesExpression";
|
|
955
|
-
AST_NODE_TYPES$3["TSStaticKeyword"] = "TSStaticKeyword";
|
|
956
|
-
AST_NODE_TYPES$3["TSStringKeyword"] = "TSStringKeyword";
|
|
957
|
-
AST_NODE_TYPES$3["TSSymbolKeyword"] = "TSSymbolKeyword";
|
|
958
|
-
AST_NODE_TYPES$3["TSTemplateLiteralType"] = "TSTemplateLiteralType";
|
|
959
|
-
AST_NODE_TYPES$3["TSThisType"] = "TSThisType";
|
|
960
|
-
AST_NODE_TYPES$3["TSTupleType"] = "TSTupleType";
|
|
961
|
-
AST_NODE_TYPES$3["TSTypeAliasDeclaration"] = "TSTypeAliasDeclaration";
|
|
962
|
-
AST_NODE_TYPES$3["TSTypeAnnotation"] = "TSTypeAnnotation";
|
|
963
|
-
AST_NODE_TYPES$3["TSTypeAssertion"] = "TSTypeAssertion";
|
|
964
|
-
AST_NODE_TYPES$3["TSTypeLiteral"] = "TSTypeLiteral";
|
|
965
|
-
AST_NODE_TYPES$3["TSTypeOperator"] = "TSTypeOperator";
|
|
966
|
-
AST_NODE_TYPES$3["TSTypeParameter"] = "TSTypeParameter";
|
|
967
|
-
AST_NODE_TYPES$3["TSTypeParameterDeclaration"] = "TSTypeParameterDeclaration";
|
|
968
|
-
AST_NODE_TYPES$3["TSTypeParameterInstantiation"] = "TSTypeParameterInstantiation";
|
|
969
|
-
AST_NODE_TYPES$3["TSTypePredicate"] = "TSTypePredicate";
|
|
970
|
-
AST_NODE_TYPES$3["TSTypeQuery"] = "TSTypeQuery";
|
|
971
|
-
AST_NODE_TYPES$3["TSTypeReference"] = "TSTypeReference";
|
|
972
|
-
AST_NODE_TYPES$3["TSUndefinedKeyword"] = "TSUndefinedKeyword";
|
|
973
|
-
AST_NODE_TYPES$3["TSUnionType"] = "TSUnionType";
|
|
974
|
-
AST_NODE_TYPES$3["TSUnknownKeyword"] = "TSUnknownKeyword";
|
|
975
|
-
AST_NODE_TYPES$3["TSVoidKeyword"] = "TSVoidKeyword";
|
|
976
|
-
})(AST_NODE_TYPES$2 || (exports.AST_NODE_TYPES = AST_NODE_TYPES$2 = {}));
|
|
977
|
-
var AST_TOKEN_TYPES$1;
|
|
978
|
-
(function(AST_TOKEN_TYPES$2) {
|
|
979
|
-
AST_TOKEN_TYPES$2["Boolean"] = "Boolean";
|
|
980
|
-
AST_TOKEN_TYPES$2["Identifier"] = "Identifier";
|
|
981
|
-
AST_TOKEN_TYPES$2["JSXIdentifier"] = "JSXIdentifier";
|
|
982
|
-
AST_TOKEN_TYPES$2["PrivateIdentifier"] = "PrivateIdentifier";
|
|
983
|
-
AST_TOKEN_TYPES$2["JSXText"] = "JSXText";
|
|
984
|
-
AST_TOKEN_TYPES$2["Keyword"] = "Keyword";
|
|
985
|
-
AST_TOKEN_TYPES$2["Null"] = "Null";
|
|
986
|
-
AST_TOKEN_TYPES$2["Numeric"] = "Numeric";
|
|
987
|
-
AST_TOKEN_TYPES$2["Punctuator"] = "Punctuator";
|
|
988
|
-
AST_TOKEN_TYPES$2["RegularExpression"] = "RegularExpression";
|
|
989
|
-
AST_TOKEN_TYPES$2["String"] = "String";
|
|
990
|
-
AST_TOKEN_TYPES$2["Template"] = "Template";
|
|
991
|
-
AST_TOKEN_TYPES$2["Block"] = "Block";
|
|
992
|
-
AST_TOKEN_TYPES$2["Line"] = "Line";
|
|
993
|
-
})(AST_TOKEN_TYPES$1 || (exports.AST_TOKEN_TYPES = AST_TOKEN_TYPES$1 = {}));
|
|
994
|
-
} });
|
|
995
|
-
|
|
996
|
-
//#endregion
|
|
997
|
-
//#region node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/lib.js
|
|
998
|
-
var require_lib = __commonJS$1({ "node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/lib.js"(exports) {
|
|
999
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1000
|
-
} });
|
|
1001
|
-
|
|
1002
|
-
//#endregion
|
|
1003
|
-
//#region node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/parser-options.js
|
|
1004
|
-
var require_parser_options = __commonJS$1({ "node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/parser-options.js"(exports) {
|
|
1005
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1006
|
-
} });
|
|
1007
|
-
|
|
1008
|
-
//#endregion
|
|
1009
|
-
//#region node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/ts-estree.js
|
|
1010
|
-
var require_ts_estree = __commonJS$1({ "node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/ts-estree.js"(exports) {
|
|
1011
|
-
var __createBinding$1 = void 0 && (void 0).__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1012
|
-
if (k2 === void 0) k2 = k;
|
|
1013
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1014
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
1015
|
-
enumerable: true,
|
|
1016
|
-
get: function() {
|
|
1017
|
-
return m[k];
|
|
1018
|
-
}
|
|
1019
|
-
};
|
|
1020
|
-
Object.defineProperty(o, k2, desc);
|
|
1021
|
-
} : function(o, m, k, k2) {
|
|
1022
|
-
if (k2 === void 0) k2 = k;
|
|
1023
|
-
o[k2] = m[k];
|
|
1024
|
-
});
|
|
1025
|
-
var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function(o, v) {
|
|
1026
|
-
Object.defineProperty(o, "default", {
|
|
1027
|
-
enumerable: true,
|
|
1028
|
-
value: v
|
|
1029
|
-
});
|
|
1030
|
-
} : function(o, v) {
|
|
1031
|
-
o["default"] = v;
|
|
1032
|
-
});
|
|
1033
|
-
var __importStar = void 0 && (void 0).__importStar || function() {
|
|
1034
|
-
var ownKeys = function(o) {
|
|
1035
|
-
ownKeys = Object.getOwnPropertyNames || function(o$1) {
|
|
1036
|
-
var ar = [];
|
|
1037
|
-
for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
|
|
1038
|
-
return ar;
|
|
1039
|
-
};
|
|
1040
|
-
return ownKeys(o);
|
|
1041
|
-
};
|
|
1042
|
-
return function(mod) {
|
|
1043
|
-
if (mod && mod.__esModule) return mod;
|
|
1044
|
-
var result = {};
|
|
1045
|
-
if (mod != null) {
|
|
1046
|
-
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$1(result, mod, k[i]);
|
|
1047
|
-
}
|
|
1048
|
-
__setModuleDefault(result, mod);
|
|
1049
|
-
return result;
|
|
1050
|
-
};
|
|
1051
|
-
}();
|
|
1052
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1053
|
-
exports.TSESTree = void 0;
|
|
1054
|
-
exports.TSESTree = __importStar(require_ast_spec());
|
|
1055
|
-
} });
|
|
1056
|
-
|
|
1057
|
-
//#endregion
|
|
1058
|
-
//#region node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/index.js
|
|
1059
|
-
var require_dist = __commonJS$1({ "node_modules/.pnpm/@typescript-eslint+types@8.34.0/node_modules/@typescript-eslint/types/dist/index.js"(exports) {
|
|
1060
|
-
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
1061
|
-
if (k2 === void 0) k2 = k;
|
|
1062
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1063
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
1064
|
-
enumerable: true,
|
|
1065
|
-
get: function() {
|
|
1066
|
-
return m[k];
|
|
1067
|
-
}
|
|
1068
|
-
};
|
|
1069
|
-
Object.defineProperty(o, k2, desc);
|
|
1070
|
-
} : function(o, m, k, k2) {
|
|
1071
|
-
if (k2 === void 0) k2 = k;
|
|
1072
|
-
o[k2] = m[k];
|
|
1073
|
-
});
|
|
1074
|
-
var __exportStar = void 0 && (void 0).__exportStar || function(m, exports$1) {
|
|
1075
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
1076
|
-
};
|
|
1077
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1078
|
-
exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0;
|
|
1079
|
-
var ast_spec_1 = require_ast_spec();
|
|
1080
|
-
Object.defineProperty(exports, "AST_NODE_TYPES", {
|
|
1081
|
-
enumerable: true,
|
|
1082
|
-
get: function() {
|
|
1083
|
-
return ast_spec_1.AST_NODE_TYPES;
|
|
1084
|
-
}
|
|
1085
|
-
});
|
|
1086
|
-
Object.defineProperty(exports, "AST_TOKEN_TYPES", {
|
|
1087
|
-
enumerable: true,
|
|
1088
|
-
get: function() {
|
|
1089
|
-
return ast_spec_1.AST_TOKEN_TYPES;
|
|
1090
|
-
}
|
|
1091
|
-
});
|
|
1092
|
-
__exportStar(require_lib(), exports);
|
|
1093
|
-
__exportStar(require_parser_options(), exports);
|
|
1094
|
-
__exportStar(require_ts_estree(), exports);
|
|
1095
|
-
} });
|
|
1096
|
-
|
|
1097
|
-
//#endregion
|
|
1098
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/utils.js
|
|
1099
|
-
var import_dist = __toESM$1(require_dist(), 1);
|
|
1100
|
-
function createRule({ name, create, defaultOptions = [], meta }) {
|
|
1101
|
-
return {
|
|
1102
|
-
create: (context) => {
|
|
1103
|
-
const optionsCount = Math.max(context.options.length, defaultOptions.length);
|
|
1104
|
-
const optionsWithDefault = Array.from({ length: optionsCount }, (_, i) => {
|
|
1105
|
-
if ((0, import_eslint_utils.isObjectNotArray)(context.options[i]) && (0, import_eslint_utils.isObjectNotArray)(defaultOptions[i])) return (0, import_eslint_utils.deepMerge)(defaultOptions[i], context.options[i]);
|
|
1106
|
-
return context.options[i] ?? defaultOptions[i];
|
|
1107
|
-
});
|
|
1108
|
-
return create(context, optionsWithDefault);
|
|
1109
|
-
},
|
|
1110
|
-
defaultOptions,
|
|
1111
|
-
meta: {
|
|
1112
|
-
...meta,
|
|
1113
|
-
docs: {
|
|
1114
|
-
...meta.docs,
|
|
1115
|
-
url: `https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/${name}/README.md`
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
};
|
|
1119
|
-
}
|
|
1120
|
-
function sourceType(context) {
|
|
1121
|
-
if ("sourceType" in context.parserOptions) return context.parserOptions.sourceType;
|
|
1122
|
-
if ("languageOptions" in context && context.languageOptions) return context.languageOptions.sourceType;
|
|
1123
|
-
}
|
|
1124
|
-
var import_eslint_utils;
|
|
1125
|
-
var init_utils = __esm({ "src/utils/index.ts"() {
|
|
1126
|
-
import_eslint_utils = __toESM(require_eslint_utils$1(), 1);
|
|
1127
|
-
} });
|
|
1128
|
-
var ast_exports = {};
|
|
1129
|
-
__export(ast_exports, {
|
|
1130
|
-
AST_NODE_TYPES: () => import_dist.AST_NODE_TYPES,
|
|
1131
|
-
AST_TOKEN_TYPES: () => import_dist.AST_TOKEN_TYPES,
|
|
1132
|
-
getValue: () => getValue
|
|
1133
|
-
});
|
|
1134
|
-
function getValue(node) {
|
|
1135
|
-
switch (node.type) {
|
|
1136
|
-
case import_dist.AST_NODE_TYPES.Identifier: return node.name;
|
|
1137
|
-
case import_dist.AST_NODE_TYPES.Literal: return node.value;
|
|
1138
|
-
default: throw new Error(`Unsupported node type: ${node.type}`);
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
var init_ast = __esm({ "src/utils/ast.ts"() {
|
|
1142
|
-
__reExport(ast_exports, __toESM(require_ast_utils(), 1));
|
|
1143
|
-
} });
|
|
1144
|
-
|
|
1145
|
-
//#endregion
|
|
1146
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/rules/consistent-type-specifier-style.js
|
|
1147
|
-
function getImportText(node, sourceCode, specifiers) {
|
|
1148
|
-
const sourceString = sourceCode.getText(node.source);
|
|
1149
|
-
if (specifiers.length === 0) return "";
|
|
1150
|
-
const names = specifiers.map((s) => {
|
|
1151
|
-
const importedName = getValue(s.imported);
|
|
1152
|
-
if (importedName === s.local.name) return importedName;
|
|
1153
|
-
return `${importedName} as ${s.local.name}`;
|
|
1154
|
-
});
|
|
1155
|
-
return `import type {${names.join(", ")}} from ${sourceString};`;
|
|
1156
|
-
}
|
|
1157
|
-
var consistent_type_specifier_style_default;
|
|
1158
|
-
var init_consistent_type_specifier_style = __esm({ "src/rules/consistent-type-specifier-style/consistent-type-specifier-style.ts"() {
|
|
1159
|
-
init_utils();
|
|
1160
|
-
init_ast();
|
|
1161
|
-
consistent_type_specifier_style_default = createRule({
|
|
1162
|
-
name: "consistent-type-specifier-style",
|
|
1163
|
-
meta: {
|
|
1164
|
-
type: "suggestion",
|
|
1165
|
-
docs: { description: "Enforce or ban the use of inline type-only markers for named imports." },
|
|
1166
|
-
fixable: "code",
|
|
1167
|
-
schema: [{
|
|
1168
|
-
type: "string",
|
|
1169
|
-
enum: [
|
|
1170
|
-
"top-level",
|
|
1171
|
-
"inline",
|
|
1172
|
-
"prefer-top-level"
|
|
1173
|
-
],
|
|
1174
|
-
default: "top-level"
|
|
1175
|
-
}],
|
|
1176
|
-
messages: {
|
|
1177
|
-
inline: "Prefer using inline {{kind}} specifiers instead of a top-level {{kind}}-only import.",
|
|
1178
|
-
topLevel: "Prefer using a top-level {{kind}}-only import instead of inline {{kind}} specifiers."
|
|
1179
|
-
}
|
|
1180
|
-
},
|
|
1181
|
-
defaultOptions: ["top-level"],
|
|
1182
|
-
create(context, [options]) {
|
|
1183
|
-
const { sourceCode } = context;
|
|
1184
|
-
if (options === "inline") return { ImportDeclaration(node) {
|
|
1185
|
-
if (node.importKind === "value" || node.importKind == null) return;
|
|
1186
|
-
if (node.specifiers.length === 0 || node.specifiers.length === 1 && (node.specifiers[0].type === "ImportDefaultSpecifier" || node.specifiers[0].type === "ImportNamespaceSpecifier")) return;
|
|
1187
|
-
context.report({
|
|
1188
|
-
node,
|
|
1189
|
-
messageId: "inline",
|
|
1190
|
-
data: { kind: node.importKind },
|
|
1191
|
-
fix(fixer) {
|
|
1192
|
-
const kindToken = sourceCode.getFirstToken(node, { skip: 1 });
|
|
1193
|
-
return [kindToken ? fixer.remove(kindToken) : [], node.specifiers.map((specifier) => fixer.insertTextBefore(specifier, `${node.importKind} `))].flat();
|
|
1194
|
-
}
|
|
1195
|
-
});
|
|
1196
|
-
} };
|
|
1197
|
-
return { ImportDeclaration(node) {
|
|
1198
|
-
if (node.importKind === "type" || node.specifiers.length === 0 || node.specifiers.length === 1 && (node.specifiers[0].type === "ImportDefaultSpecifier" || node.specifiers[0].type === "ImportNamespaceSpecifier")) return;
|
|
1199
|
-
const typeSpecifiers = [];
|
|
1200
|
-
const valueSpecifiers = [];
|
|
1201
|
-
let defaultSpecifier = null;
|
|
1202
|
-
for (const specifier of node.specifiers) {
|
|
1203
|
-
if (specifier.type === "ImportDefaultSpecifier") {
|
|
1204
|
-
defaultSpecifier = specifier;
|
|
1205
|
-
continue;
|
|
1206
|
-
}
|
|
1207
|
-
if (!("importKind" in specifier)) continue;
|
|
1208
|
-
if (specifier.importKind === "type") typeSpecifiers.push(specifier);
|
|
1209
|
-
else if (specifier.importKind === "value" || specifier.importKind == null) valueSpecifiers.push(specifier);
|
|
1210
|
-
}
|
|
1211
|
-
const typeImport = getImportText(node, sourceCode, typeSpecifiers);
|
|
1212
|
-
if (typeSpecifiers.length === node.specifiers.length) context.report({
|
|
1213
|
-
node,
|
|
1214
|
-
messageId: "topLevel",
|
|
1215
|
-
data: { kind: "type" },
|
|
1216
|
-
fix(fixer) {
|
|
1217
|
-
return fixer.replaceText(node, typeImport);
|
|
1218
|
-
}
|
|
1219
|
-
});
|
|
1220
|
-
else if (options === "top-level") for (const specifier of typeSpecifiers) context.report({
|
|
1221
|
-
node: specifier,
|
|
1222
|
-
messageId: "topLevel",
|
|
1223
|
-
data: { kind: specifier.importKind },
|
|
1224
|
-
fix(fixer) {
|
|
1225
|
-
const fixes = [];
|
|
1226
|
-
if (valueSpecifiers.length > 0) {
|
|
1227
|
-
for (const specifier$1 of typeSpecifiers) {
|
|
1228
|
-
const token = sourceCode.getTokenAfter(specifier$1);
|
|
1229
|
-
if (token && (0, ast_exports.isCommaToken)(token)) fixes.push(fixer.remove(token));
|
|
1230
|
-
fixes.push(fixer.remove(specifier$1));
|
|
1231
|
-
}
|
|
1232
|
-
const maybeComma = sourceCode.getTokenAfter(valueSpecifiers[valueSpecifiers.length - 1]);
|
|
1233
|
-
if ((0, ast_exports.isCommaToken)(maybeComma)) fixes.push(fixer.remove(maybeComma));
|
|
1234
|
-
} else if (defaultSpecifier) {
|
|
1235
|
-
const comma = sourceCode.getTokenAfter(defaultSpecifier, ast_exports.isCommaToken);
|
|
1236
|
-
const closingBrace = sourceCode.getTokenAfter(node.specifiers[node.specifiers.length - 1], (token) => token.type === "Punctuator" && token.value === "}");
|
|
1237
|
-
fixes.push(fixer.removeRange([comma.range[0], closingBrace.range[1]]));
|
|
1238
|
-
}
|
|
1239
|
-
return [...fixes, fixer.insertTextAfter(node, `\n${typeImport}`)];
|
|
1240
|
-
}
|
|
1241
|
-
});
|
|
1242
|
-
} };
|
|
1243
|
-
}
|
|
1244
|
-
});
|
|
1245
|
-
} });
|
|
1246
|
-
|
|
1247
|
-
//#endregion
|
|
1248
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/rules/first.js
|
|
1249
|
-
function getImportValue(node) {
|
|
1250
|
-
return node.type === "ImportDeclaration" ? node.source.value : "moduleReference" in node && "expression" in node.moduleReference && "value" in node.moduleReference.expression && node.moduleReference.expression.value;
|
|
1251
|
-
}
|
|
1252
|
-
function isPossibleDirective(node) {
|
|
1253
|
-
return node.type === "ExpressionStatement" && node.expression.type === "Literal" && typeof node.expression.value === "string";
|
|
1254
|
-
}
|
|
1255
|
-
var first_default;
|
|
1256
|
-
var init_first = __esm({ "src/rules/first/first.ts"() {
|
|
1257
|
-
init_utils();
|
|
1258
|
-
first_default = createRule({
|
|
1259
|
-
name: "first",
|
|
1260
|
-
meta: {
|
|
1261
|
-
type: "suggestion",
|
|
1262
|
-
docs: { description: "Ensure all imports appear before other statements." },
|
|
1263
|
-
fixable: "code",
|
|
1264
|
-
schema: [{
|
|
1265
|
-
type: "string",
|
|
1266
|
-
enum: ["absolute-first", "disable-absolute-first"]
|
|
1267
|
-
}],
|
|
1268
|
-
messages: {
|
|
1269
|
-
absolute: "Absolute imports should come before relative imports.",
|
|
1270
|
-
order: "Import in body of module; reorder to top."
|
|
1271
|
-
}
|
|
1272
|
-
},
|
|
1273
|
-
defaultOptions: [],
|
|
1274
|
-
create(context, options) {
|
|
1275
|
-
return { Program(n) {
|
|
1276
|
-
const body = n.body;
|
|
1277
|
-
if (!body?.length) return;
|
|
1278
|
-
const absoluteFirst = options[0] === "absolute-first";
|
|
1279
|
-
const { sourceCode } = context;
|
|
1280
|
-
const originSourceCode = sourceCode.getText();
|
|
1281
|
-
let nonImportCount = 0;
|
|
1282
|
-
let anyExpressions = false;
|
|
1283
|
-
let anyRelative = false;
|
|
1284
|
-
let lastLegalImp = null;
|
|
1285
|
-
const errorInfos = [];
|
|
1286
|
-
let shouldSort = true;
|
|
1287
|
-
let lastSortNodesIndex = 0;
|
|
1288
|
-
for (const [index, node] of body.entries()) {
|
|
1289
|
-
if (!anyExpressions && isPossibleDirective(node)) continue;
|
|
1290
|
-
anyExpressions = true;
|
|
1291
|
-
if (node.type === "ImportDeclaration" || node.type === "TSImportEqualsDeclaration") {
|
|
1292
|
-
if (absoluteFirst) {
|
|
1293
|
-
const importValue = getImportValue(node);
|
|
1294
|
-
if (typeof importValue === "string" && /^\./.test(importValue)) anyRelative = true;
|
|
1295
|
-
else if (anyRelative) context.report({
|
|
1296
|
-
node: node.type === "ImportDeclaration" ? node.source : node.moduleReference,
|
|
1297
|
-
messageId: "absolute"
|
|
1298
|
-
});
|
|
1299
|
-
}
|
|
1300
|
-
if (nonImportCount > 0) {
|
|
1301
|
-
/** @see https://eslint.org/docs/next/use/migrate-to-9.0.0#-removed-multiple-context-methods */
|
|
1302
|
-
for (const variable of sourceCode.getDeclaredVariables(node)) {
|
|
1303
|
-
if (!shouldSort) break;
|
|
1304
|
-
for (const reference of variable.references) if (reference.identifier.range[0] < node.range[1]) {
|
|
1305
|
-
shouldSort = false;
|
|
1306
|
-
break;
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
if (shouldSort) lastSortNodesIndex = errorInfos.length;
|
|
1310
|
-
errorInfos.push({
|
|
1311
|
-
node,
|
|
1312
|
-
range: [body[index - 1].range[1], node.range[1]]
|
|
1313
|
-
});
|
|
1314
|
-
} else lastLegalImp = node;
|
|
1315
|
-
} else nonImportCount++;
|
|
1316
|
-
}
|
|
1317
|
-
if (errorInfos.length === 0) return;
|
|
1318
|
-
for (const [index, { node }] of errorInfos.entries()) {
|
|
1319
|
-
let fix;
|
|
1320
|
-
if (index < lastSortNodesIndex) fix = (fixer) => fixer.insertTextAfter(node, "");
|
|
1321
|
-
else if (index === lastSortNodesIndex) {
|
|
1322
|
-
const sortNodes = errorInfos.slice(0, lastSortNodesIndex + 1);
|
|
1323
|
-
fix = (fixer) => {
|
|
1324
|
-
const removeFixers = sortNodes.map(({ range: range$1 }) => fixer.removeRange(range$1));
|
|
1325
|
-
const range = [0, removeFixers[removeFixers.length - 1].range[1]];
|
|
1326
|
-
let insertSourceCode = sortNodes.map(({ range: range$1 }) => {
|
|
1327
|
-
const nodeSourceCode = originSourceCode.slice(...range$1);
|
|
1328
|
-
if (/\S/.test(nodeSourceCode[0])) return `\n${nodeSourceCode}`;
|
|
1329
|
-
return nodeSourceCode;
|
|
1330
|
-
}).join("");
|
|
1331
|
-
let replaceSourceCode = "";
|
|
1332
|
-
if (!lastLegalImp) insertSourceCode = insertSourceCode.trim() + insertSourceCode.match(/^(\s+)/)[0];
|
|
1333
|
-
const insertFixer = lastLegalImp ? fixer.insertTextAfter(lastLegalImp, insertSourceCode) : fixer.insertTextBefore(body[0], insertSourceCode);
|
|
1334
|
-
const fixers = [insertFixer, ...removeFixers];
|
|
1335
|
-
for (const [i, computedFixer] of fixers.entries()) replaceSourceCode += originSourceCode.slice(fixers[i - 1] ? fixers[i - 1].range[1] : 0, computedFixer.range[0]) + computedFixer.text;
|
|
1336
|
-
return fixer.replaceTextRange(range, replaceSourceCode);
|
|
1337
|
-
};
|
|
1338
|
-
}
|
|
1339
|
-
context.report({
|
|
1340
|
-
node,
|
|
1341
|
-
messageId: "order",
|
|
1342
|
-
fix
|
|
1343
|
-
});
|
|
1344
|
-
}
|
|
1345
|
-
} };
|
|
1346
|
-
}
|
|
1347
|
-
});
|
|
1348
|
-
} });
|
|
1349
|
-
|
|
1350
|
-
//#endregion
|
|
1351
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/rules/newline-after-import.js
|
|
1352
|
-
function isStaticRequire(node) {
|
|
1353
|
-
return node && node.callee && node.callee.type === "Identifier" && node.callee.name === "require" && node.arguments.length === 1 && node.arguments[0].type === "Literal" && typeof node.arguments[0].value === "string";
|
|
1354
|
-
}
|
|
1355
|
-
function containsNodeOrEqual(outerNode, innerNode) {
|
|
1356
|
-
return outerNode.range[0] <= innerNode.range[0] && outerNode.range[1] >= innerNode.range[1];
|
|
1357
|
-
}
|
|
1358
|
-
function getScopeBody(scope) {
|
|
1359
|
-
if (scope.block.type === "SwitchStatement") {
|
|
1360
|
-
console.log("SwitchStatement scopes not supported");
|
|
1361
|
-
return [];
|
|
1362
|
-
}
|
|
1363
|
-
const body = "body" in scope.block ? scope.block.body : null;
|
|
1364
|
-
if (body && "type" in body && body.type === "BlockStatement") return body.body;
|
|
1365
|
-
return Array.isArray(body) ? body : [];
|
|
1366
|
-
}
|
|
1367
|
-
function findNodeIndexInScopeBody(body, nodeToFind) {
|
|
1368
|
-
return body.findIndex((node) => containsNodeOrEqual(node, nodeToFind));
|
|
1369
|
-
}
|
|
1370
|
-
function getLineDifference(node, nextNode) {
|
|
1371
|
-
return nextNode.loc.start.line - node.loc.end.line;
|
|
1372
|
-
}
|
|
1373
|
-
function isClassWithDecorator(node) {
|
|
1374
|
-
return node.type === "ClassDeclaration" && !!node.decorators?.length;
|
|
1375
|
-
}
|
|
1376
|
-
function isExportDefaultClass(node) {
|
|
1377
|
-
return node.type === "ExportDefaultDeclaration" && node.declaration.type === "ClassDeclaration";
|
|
1378
|
-
}
|
|
1379
|
-
function isExportNameClass(node) {
|
|
1380
|
-
return node.type === "ExportNamedDeclaration" && node.declaration?.type === "ClassDeclaration";
|
|
1381
|
-
}
|
|
1382
|
-
var newline_after_import_default;
|
|
1383
|
-
var init_newline_after_import = __esm({ "src/rules/newline-after-import/newline-after-import.ts"() {
|
|
1384
|
-
init_utils();
|
|
1385
|
-
newline_after_import_default = createRule({
|
|
1386
|
-
name: "newline-after-import",
|
|
1387
|
-
meta: {
|
|
1388
|
-
type: "layout",
|
|
1389
|
-
docs: { description: "Enforce a newline after import statements." },
|
|
1390
|
-
fixable: "whitespace",
|
|
1391
|
-
schema: [{
|
|
1392
|
-
type: "object",
|
|
1393
|
-
properties: {
|
|
1394
|
-
count: {
|
|
1395
|
-
type: "integer",
|
|
1396
|
-
minimum: 1
|
|
1397
|
-
},
|
|
1398
|
-
exactCount: { type: "boolean" },
|
|
1399
|
-
considerComments: { type: "boolean" }
|
|
1400
|
-
},
|
|
1401
|
-
additionalProperties: false
|
|
1402
|
-
}],
|
|
1403
|
-
messages: { newline: "Expected {{count}} empty line{{lineSuffix}} after {{type}} statement not followed by another {{type}}." }
|
|
1404
|
-
},
|
|
1405
|
-
defaultOptions: [{
|
|
1406
|
-
count: 1,
|
|
1407
|
-
exactCount: false,
|
|
1408
|
-
considerComments: false
|
|
1409
|
-
}],
|
|
1410
|
-
create(context, [options]) {
|
|
1411
|
-
let level = 0;
|
|
1412
|
-
const requireCalls = [];
|
|
1413
|
-
function checkForNewLine(node, nextNode, type) {
|
|
1414
|
-
if (isExportDefaultClass(nextNode) || isExportNameClass(nextNode)) {
|
|
1415
|
-
const classNode = nextNode.declaration;
|
|
1416
|
-
if (isClassWithDecorator(classNode)) nextNode = classNode.decorators[0];
|
|
1417
|
-
} else if (isClassWithDecorator(nextNode)) nextNode = nextNode.decorators[0];
|
|
1418
|
-
const lineDifference = getLineDifference(node, nextNode);
|
|
1419
|
-
const EXPECTED_LINE_DIFFERENCE = options.count + 1;
|
|
1420
|
-
if (lineDifference < EXPECTED_LINE_DIFFERENCE || options.exactCount && lineDifference !== EXPECTED_LINE_DIFFERENCE) {
|
|
1421
|
-
let column = node.loc.start.column;
|
|
1422
|
-
if (node.loc.start.line !== node.loc.end.line) column = 0;
|
|
1423
|
-
context.report({
|
|
1424
|
-
loc: {
|
|
1425
|
-
line: node.loc.end.line,
|
|
1426
|
-
column
|
|
1427
|
-
},
|
|
1428
|
-
messageId: "newline",
|
|
1429
|
-
data: {
|
|
1430
|
-
count: options.count,
|
|
1431
|
-
lineSuffix: options.count > 1 ? "s" : "",
|
|
1432
|
-
type
|
|
1433
|
-
},
|
|
1434
|
-
fix: options.exactCount && EXPECTED_LINE_DIFFERENCE < lineDifference ? void 0 : (fixer) => fixer.insertTextAfter(node, "\n".repeat(EXPECTED_LINE_DIFFERENCE - lineDifference))
|
|
1435
|
-
});
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
function commentAfterImport(node, nextComment, type) {
|
|
1439
|
-
const lineDifference = getLineDifference(node, nextComment);
|
|
1440
|
-
const EXPECTED_LINE_DIFFERENCE = options.count + 1;
|
|
1441
|
-
if (lineDifference < EXPECTED_LINE_DIFFERENCE) {
|
|
1442
|
-
let column = node.loc.start.column;
|
|
1443
|
-
if (node.loc.start.line !== node.loc.end.line) column = 0;
|
|
1444
|
-
context.report({
|
|
1445
|
-
loc: {
|
|
1446
|
-
line: node.loc.end.line,
|
|
1447
|
-
column
|
|
1448
|
-
},
|
|
1449
|
-
messageId: "newline",
|
|
1450
|
-
data: {
|
|
1451
|
-
count: options.count,
|
|
1452
|
-
lineSuffix: options.count > 1 ? "s" : "",
|
|
1453
|
-
type
|
|
1454
|
-
},
|
|
1455
|
-
fix: options.exactCount && EXPECTED_LINE_DIFFERENCE < lineDifference ? void 0 : (fixer) => fixer.insertTextAfter(node, "\n".repeat(EXPECTED_LINE_DIFFERENCE - lineDifference))
|
|
1456
|
-
});
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
function incrementLevel() {
|
|
1460
|
-
level++;
|
|
1461
|
-
}
|
|
1462
|
-
function decrementLevel() {
|
|
1463
|
-
level--;
|
|
1464
|
-
}
|
|
1465
|
-
function checkImport(node) {
|
|
1466
|
-
const { parent } = node;
|
|
1467
|
-
if (!parent || !("body" in parent) || !parent.body) return;
|
|
1468
|
-
const root = parent;
|
|
1469
|
-
const nodePosition = root.body.indexOf(node);
|
|
1470
|
-
const nextNode = root.body[nodePosition + 1];
|
|
1471
|
-
const endLine = node.loc.end.line;
|
|
1472
|
-
let nextComment;
|
|
1473
|
-
if (root.comments !== void 0 && options.considerComments) nextComment = root.comments.find((o) => o.loc.start.line >= endLine && o.loc.start.line <= endLine + options.count + 1);
|
|
1474
|
-
if (node.type === "TSImportEqualsDeclaration" && node.isExport) return;
|
|
1475
|
-
if (nextComment) commentAfterImport(node, nextComment, "import");
|
|
1476
|
-
else if (nextNode && nextNode.type !== "ImportDeclaration" && (nextNode.type !== "TSImportEqualsDeclaration" || nextNode.isExport)) checkForNewLine(node, nextNode, "import");
|
|
1477
|
-
}
|
|
1478
|
-
return {
|
|
1479
|
-
"ImportDeclaration": checkImport,
|
|
1480
|
-
"TSImportEqualsDeclaration": checkImport,
|
|
1481
|
-
CallExpression(node) {
|
|
1482
|
-
if (isStaticRequire(node) && level === 0) requireCalls.push(node);
|
|
1483
|
-
},
|
|
1484
|
-
"Program:exit": function(node) {
|
|
1485
|
-
const scopeBody = getScopeBody(context.sourceCode.getScope(node));
|
|
1486
|
-
for (const [index, node$1] of requireCalls.entries()) {
|
|
1487
|
-
const nodePosition = findNodeIndexInScopeBody(scopeBody, node$1);
|
|
1488
|
-
const statementWithRequireCall = scopeBody[nodePosition];
|
|
1489
|
-
const nextStatement = scopeBody[nodePosition + 1];
|
|
1490
|
-
const nextRequireCall = requireCalls[index + 1];
|
|
1491
|
-
if (nextRequireCall && containsNodeOrEqual(statementWithRequireCall, nextRequireCall)) continue;
|
|
1492
|
-
if (nextStatement && (!nextRequireCall || !containsNodeOrEqual(nextStatement, nextRequireCall))) {
|
|
1493
|
-
let nextComment;
|
|
1494
|
-
if ("comments" in statementWithRequireCall.parent && statementWithRequireCall.parent.comments !== void 0 && options.considerComments) {
|
|
1495
|
-
const endLine = node$1.loc.end.line;
|
|
1496
|
-
nextComment = statementWithRequireCall.parent.comments.find((o) => o.loc.start.line >= endLine && o.loc.start.line <= endLine + options.count + 1);
|
|
1497
|
-
}
|
|
1498
|
-
if (nextComment && nextComment !== void 0) commentAfterImport(statementWithRequireCall, nextComment, "require");
|
|
1499
|
-
else checkForNewLine(statementWithRequireCall, nextStatement, "require");
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
|
-
},
|
|
1503
|
-
"FunctionDeclaration": incrementLevel,
|
|
1504
|
-
"FunctionExpression": incrementLevel,
|
|
1505
|
-
"ArrowFunctionExpression": incrementLevel,
|
|
1506
|
-
"BlockStatement": incrementLevel,
|
|
1507
|
-
"ObjectExpression": incrementLevel,
|
|
1508
|
-
"Decorator": incrementLevel,
|
|
1509
|
-
"FunctionDeclaration:exit": decrementLevel,
|
|
1510
|
-
"FunctionExpression:exit": decrementLevel,
|
|
1511
|
-
"ArrowFunctionExpression:exit": decrementLevel,
|
|
1512
|
-
"BlockStatement:exit": decrementLevel,
|
|
1513
|
-
"ObjectExpression:exit": decrementLevel,
|
|
1514
|
-
"Decorator:exit": decrementLevel
|
|
1515
|
-
};
|
|
1516
|
-
}
|
|
1517
|
-
});
|
|
1518
|
-
} });
|
|
1519
|
-
|
|
1520
|
-
//#endregion
|
|
1521
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/rules/no-default-export.js
|
|
1522
|
-
var no_default_export_default;
|
|
1523
|
-
var init_no_default_export = __esm({ "src/rules/no-default-export/no-default-export.ts"() {
|
|
1524
|
-
init_utils();
|
|
1525
|
-
init_ast();
|
|
1526
|
-
no_default_export_default = createRule({
|
|
1527
|
-
name: "no-default-export",
|
|
1528
|
-
meta: {
|
|
1529
|
-
type: "suggestion",
|
|
1530
|
-
docs: { description: "Forbid default exports." },
|
|
1531
|
-
schema: [],
|
|
1532
|
-
messages: {
|
|
1533
|
-
preferNamed: "Prefer named exports.",
|
|
1534
|
-
noAliasDefault: "Do not alias `{{local}}` as `default`. Just export `{{local}}` itself instead."
|
|
1535
|
-
}
|
|
1536
|
-
},
|
|
1537
|
-
defaultOptions: [],
|
|
1538
|
-
create(context) {
|
|
1539
|
-
if (sourceType(context) !== "module") return {};
|
|
1540
|
-
const { sourceCode } = context;
|
|
1541
|
-
return {
|
|
1542
|
-
ExportDefaultDeclaration(node) {
|
|
1543
|
-
const { loc } = sourceCode.getFirstTokens(node)[1] || {};
|
|
1544
|
-
context.report({
|
|
1545
|
-
node,
|
|
1546
|
-
messageId: "preferNamed",
|
|
1547
|
-
loc
|
|
1548
|
-
});
|
|
1549
|
-
},
|
|
1550
|
-
ExportNamedDeclaration(node) {
|
|
1551
|
-
for (const specifier of node.specifiers.filter((specifier$1) => getValue(specifier$1.exported) === "default")) {
|
|
1552
|
-
const { loc } = sourceCode.getFirstTokens(node)[1] || {};
|
|
1553
|
-
if (specifier.type === "ExportDefaultSpecifier") context.report({
|
|
1554
|
-
node,
|
|
1555
|
-
messageId: "preferNamed",
|
|
1556
|
-
loc
|
|
1557
|
-
});
|
|
1558
|
-
else if (specifier.type === "ExportSpecifier") context.report({
|
|
1559
|
-
node,
|
|
1560
|
-
messageId: "noAliasDefault",
|
|
1561
|
-
data: { local: getValue(specifier.local) },
|
|
1562
|
-
loc
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
}
|
|
1566
|
-
};
|
|
1567
|
-
}
|
|
1568
|
-
});
|
|
1569
|
-
} });
|
|
1570
|
-
|
|
1571
|
-
//#endregion
|
|
1572
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/rules/no-duplicates.js
|
|
1573
|
-
function checkImports(imported, context) {
|
|
1574
|
-
imported.forEach((nodes, module) => {
|
|
1575
|
-
if (nodes.length <= 1) return;
|
|
1576
|
-
for (let i = 0, len = nodes.length; i < len; i++) {
|
|
1577
|
-
const node = nodes[i];
|
|
1578
|
-
context.report({
|
|
1579
|
-
node: node.source,
|
|
1580
|
-
messageId: "duplicate",
|
|
1581
|
-
data: { module },
|
|
1582
|
-
fix: i === 0 ? getFix(nodes, context.sourceCode, context) : null
|
|
1583
|
-
});
|
|
1584
|
-
}
|
|
1585
|
-
});
|
|
1586
|
-
}
|
|
1587
|
-
function getFix(nodes, sourceCode, context) {
|
|
1588
|
-
const first = nodes[0];
|
|
1589
|
-
if (hasProblematicComments(first, sourceCode) || hasNamespace(first)) return null;
|
|
1590
|
-
const defaultImportNames = new Set(nodes.flatMap((x) => getDefaultImportName(x) || []));
|
|
1591
|
-
if (defaultImportNames.size > 1) return null;
|
|
1592
|
-
const rest = nodes.slice(1);
|
|
1593
|
-
const restWithoutCommentsAndNamespaces = rest.filter((node) => !hasProblematicComments(node, sourceCode) && !hasNamespace(node));
|
|
1594
|
-
const restWithoutCommentsAndNamespacesHasSpecifiers = restWithoutCommentsAndNamespaces.map(hasSpecifiers);
|
|
1595
|
-
const specifiers = restWithoutCommentsAndNamespaces.reduce((acc, node, nodeIndex) => {
|
|
1596
|
-
const tokens = sourceCode.getTokens(node);
|
|
1597
|
-
const openBrace = tokens.find((token) => isPunctuator(token, "{"));
|
|
1598
|
-
const closeBrace = tokens.find((token) => isPunctuator(token, "}"));
|
|
1599
|
-
if (openBrace == null || closeBrace == null) return acc;
|
|
1600
|
-
acc.push({
|
|
1601
|
-
importNode: node,
|
|
1602
|
-
identifiers: sourceCode.text.slice(openBrace.range[1], closeBrace.range[0]).split(","),
|
|
1603
|
-
isEmpty: !restWithoutCommentsAndNamespacesHasSpecifiers[nodeIndex]
|
|
1604
|
-
});
|
|
1605
|
-
return acc;
|
|
1606
|
-
}, []);
|
|
1607
|
-
const unnecessaryImports = restWithoutCommentsAndNamespaces.filter((node, nodeIndex) => !restWithoutCommentsAndNamespacesHasSpecifiers[nodeIndex] && !specifiers.some((specifier) => specifier.importNode === node));
|
|
1608
|
-
const shouldAddSpecifiers = specifiers.length > 0;
|
|
1609
|
-
const shouldRemoveUnnecessary = unnecessaryImports.length > 0;
|
|
1610
|
-
const shouldAddDefault = getDefaultImportName(first) == null && defaultImportNames.size === 1;
|
|
1611
|
-
if (!shouldAddSpecifiers && !shouldRemoveUnnecessary && !shouldAddDefault) return null;
|
|
1612
|
-
const preferInline = context.options[0] && context.options[0]["prefer-inline"];
|
|
1613
|
-
return (fixer) => {
|
|
1614
|
-
const tokens = sourceCode.getTokens(first);
|
|
1615
|
-
const openBrace = tokens.find((token) => isPunctuator(token, "{"));
|
|
1616
|
-
const closeBrace = tokens.find((token) => isPunctuator(token, "}"));
|
|
1617
|
-
const firstToken = sourceCode.getFirstToken(first);
|
|
1618
|
-
const [defaultImportName] = defaultImportNames;
|
|
1619
|
-
const firstHasTrailingComma = closeBrace != null && isPunctuator(sourceCode.getTokenBefore(closeBrace), ",");
|
|
1620
|
-
const firstIsEmpty = !hasSpecifiers(first);
|
|
1621
|
-
const firstExistingIdentifiers = firstIsEmpty ? /* @__PURE__ */ new Set() : new Set(sourceCode.text.slice(openBrace.range[1], closeBrace.range[0]).split(",").map((x) => x.split(" as ")[0].trim()));
|
|
1622
|
-
const [specifiersText] = specifiers.reduce(([result, needsComma, existingIdentifiers], specifier) => {
|
|
1623
|
-
const isTypeSpecifier = "importNode" in specifier && specifier.importNode.importKind === "type";
|
|
1624
|
-
const [specifierText, updatedExistingIdentifiers] = specifier.identifiers.reduce(([text, set], cur) => {
|
|
1625
|
-
const trimmed = cur.trim();
|
|
1626
|
-
if (trimmed.length === 0 || existingIdentifiers.has(trimmed)) return [text, set];
|
|
1627
|
-
const curWithType = preferInline && isTypeSpecifier ? cur.replace(/^(\s*)/, "$1type ") : cur;
|
|
1628
|
-
return [text.length > 0 ? `${text},${curWithType}` : curWithType, set.add(trimmed)];
|
|
1629
|
-
}, ["", existingIdentifiers]);
|
|
1630
|
-
return [
|
|
1631
|
-
needsComma && !specifier.isEmpty && specifierText.length > 0 ? `${result},${specifierText}` : `${result}${specifierText}`,
|
|
1632
|
-
specifier.isEmpty ? needsComma : true,
|
|
1633
|
-
updatedExistingIdentifiers
|
|
1634
|
-
];
|
|
1635
|
-
}, [
|
|
1636
|
-
"",
|
|
1637
|
-
!firstHasTrailingComma && !firstIsEmpty,
|
|
1638
|
-
firstExistingIdentifiers
|
|
1639
|
-
]);
|
|
1640
|
-
const fixes = [];
|
|
1641
|
-
if (shouldAddSpecifiers && preferInline && first.importKind === "type") {
|
|
1642
|
-
const typeIdentifierToken = tokens.find((token) => token.type === "Identifier" && token.value === "type");
|
|
1643
|
-
if (typeIdentifierToken) fixes.push(fixer.removeRange([typeIdentifierToken.range[0], typeIdentifierToken.range[1] + 1]));
|
|
1644
|
-
for (const identifier of tokens.filter((token) => firstExistingIdentifiers.has(token.value))) fixes.push(fixer.replaceTextRange([identifier.range[0], identifier.range[1]], `type ${identifier.value}`));
|
|
1645
|
-
}
|
|
1646
|
-
if (openBrace == null && shouldAddSpecifiers && shouldAddDefault) fixes.push(fixer.insertTextAfter(firstToken, ` ${defaultImportName}, {${specifiersText}} from`));
|
|
1647
|
-
else if (openBrace == null && !shouldAddSpecifiers && shouldAddDefault) fixes.push(fixer.insertTextAfter(firstToken, ` ${defaultImportName} from`));
|
|
1648
|
-
else if (openBrace != null && closeBrace != null && shouldAddDefault) {
|
|
1649
|
-
fixes.push(fixer.insertTextAfter(firstToken, ` ${defaultImportName},`));
|
|
1650
|
-
if (shouldAddSpecifiers) fixes.push(fixer.insertTextBefore(closeBrace, specifiersText));
|
|
1651
|
-
} else if (openBrace == null && shouldAddSpecifiers && !shouldAddDefault) if (first.specifiers.length === 0) fixes.push(fixer.insertTextAfter(firstToken, ` {${specifiersText}} from`));
|
|
1652
|
-
else fixes.push(fixer.insertTextAfter(first.specifiers[0], `, {${specifiersText}}`));
|
|
1653
|
-
else if (openBrace != null && closeBrace != null && !shouldAddDefault) {
|
|
1654
|
-
const tokenBefore = sourceCode.getTokenBefore(closeBrace);
|
|
1655
|
-
fixes.push(fixer.insertTextAfter(tokenBefore, specifiersText));
|
|
1656
|
-
}
|
|
1657
|
-
for (const specifier of specifiers) {
|
|
1658
|
-
const importNode = specifier.importNode;
|
|
1659
|
-
fixes.push(fixer.remove(importNode));
|
|
1660
|
-
const charAfterImportRange = [importNode.range[1], importNode.range[1] + 1];
|
|
1661
|
-
const charAfterImport = sourceCode.text.slice(charAfterImportRange[0], charAfterImportRange[1]);
|
|
1662
|
-
if (charAfterImport === "\n") fixes.push(fixer.removeRange(charAfterImportRange));
|
|
1663
|
-
}
|
|
1664
|
-
for (const node of unnecessaryImports) {
|
|
1665
|
-
fixes.push(fixer.remove(node));
|
|
1666
|
-
const charAfterImportRange = [node.range[1], node.range[1] + 1];
|
|
1667
|
-
const charAfterImport = sourceCode.text.slice(charAfterImportRange[0], charAfterImportRange[1]);
|
|
1668
|
-
if (charAfterImport === "\n") fixes.push(fixer.removeRange(charAfterImportRange));
|
|
1669
|
-
}
|
|
1670
|
-
return fixes;
|
|
1671
|
-
};
|
|
1672
|
-
}
|
|
1673
|
-
function isPunctuator(node, value) {
|
|
1674
|
-
return node.type === "Punctuator" && node.value === value;
|
|
1675
|
-
}
|
|
1676
|
-
function getDefaultImportName(node) {
|
|
1677
|
-
const defaultSpecifier = node.specifiers.find((specifier) => specifier.type === "ImportDefaultSpecifier");
|
|
1678
|
-
return defaultSpecifier?.local.name;
|
|
1679
|
-
}
|
|
1680
|
-
function hasNamespace(node) {
|
|
1681
|
-
return node.specifiers.some((specifier) => specifier.type === "ImportNamespaceSpecifier");
|
|
1682
|
-
}
|
|
1683
|
-
function hasSpecifiers(node) {
|
|
1684
|
-
return node.specifiers.some((specifier) => specifier.type === "ImportSpecifier");
|
|
1685
|
-
}
|
|
1686
|
-
function hasProblematicComments(node, sourceCode) {
|
|
1687
|
-
return hasCommentBefore(node, sourceCode) || hasCommentAfter(node, sourceCode) || hasCommentInsideNonSpecifiers(node, sourceCode);
|
|
1688
|
-
}
|
|
1689
|
-
function hasCommentBefore(node, sourceCode) {
|
|
1690
|
-
return sourceCode.getCommentsBefore(node).some((comment) => comment.loc.end.line >= node.loc.start.line - 1);
|
|
1691
|
-
}
|
|
1692
|
-
function hasCommentAfter(node, sourceCode) {
|
|
1693
|
-
return sourceCode.getCommentsAfter(node).some((comment) => comment.loc.start.line === node.loc.end.line);
|
|
1694
|
-
}
|
|
1695
|
-
function hasCommentInsideNonSpecifiers(node, sourceCode) {
|
|
1696
|
-
const tokens = sourceCode.getTokens(node);
|
|
1697
|
-
const openBraceIndex = tokens.findIndex((token) => isPunctuator(token, "{"));
|
|
1698
|
-
const closeBraceIndex = tokens.findIndex((token) => isPunctuator(token, "}"));
|
|
1699
|
-
const someTokens = openBraceIndex !== -1 && closeBraceIndex !== -1 ? [...tokens.slice(1, openBraceIndex + 1), ...tokens.slice(closeBraceIndex + 1)] : tokens.slice(1);
|
|
1700
|
-
return someTokens.some((token) => sourceCode.getCommentsBefore(token).length > 0);
|
|
1701
|
-
}
|
|
1702
|
-
var no_duplicates_default;
|
|
1703
|
-
var init_no_duplicates = __esm({ "src/rules/no-duplicates/no-duplicates.ts"() {
|
|
1704
|
-
init_utils();
|
|
1705
|
-
no_duplicates_default = createRule({
|
|
1706
|
-
name: "no-duplicates",
|
|
1707
|
-
meta: {
|
|
1708
|
-
type: "problem",
|
|
1709
|
-
docs: {
|
|
1710
|
-
recommended: true,
|
|
1711
|
-
description: "Forbid repeated import of the same module in multiple places."
|
|
1712
|
-
},
|
|
1713
|
-
fixable: "code",
|
|
1714
|
-
schema: [{
|
|
1715
|
-
type: "object",
|
|
1716
|
-
properties: { "prefer-inline": { type: "boolean" } },
|
|
1717
|
-
additionalProperties: false
|
|
1718
|
-
}],
|
|
1719
|
-
messages: { duplicate: "'{{module}}' imported multiple times." }
|
|
1720
|
-
},
|
|
1721
|
-
defaultOptions: [],
|
|
1722
|
-
create(context) {
|
|
1723
|
-
const preferInline = context.options[0]?.["prefer-inline"];
|
|
1724
|
-
const moduleMaps = /* @__PURE__ */ new Map();
|
|
1725
|
-
function getImportMap(n) {
|
|
1726
|
-
const parent = n.parent;
|
|
1727
|
-
let map;
|
|
1728
|
-
if (moduleMaps.has(parent)) map = moduleMaps.get(parent);
|
|
1729
|
-
else {
|
|
1730
|
-
map = {
|
|
1731
|
-
imported: /* @__PURE__ */ new Map(),
|
|
1732
|
-
nsImported: /* @__PURE__ */ new Map(),
|
|
1733
|
-
defaultTypesImported: /* @__PURE__ */ new Map(),
|
|
1734
|
-
namespaceTypesImported: /* @__PURE__ */ new Map(),
|
|
1735
|
-
namedTypesImported: /* @__PURE__ */ new Map()
|
|
1736
|
-
};
|
|
1737
|
-
moduleMaps.set(parent, map);
|
|
1738
|
-
}
|
|
1739
|
-
if (n.importKind === "type") {
|
|
1740
|
-
if (n.specifiers.length > 0 && n.specifiers[0].type === "ImportDefaultSpecifier") return map.defaultTypesImported;
|
|
1741
|
-
if (n.specifiers.length > 0 && n.specifiers[0].type === "ImportNamespaceSpecifier") return map.namespaceTypesImported;
|
|
1742
|
-
if (!preferInline) return map.namedTypesImported;
|
|
1743
|
-
}
|
|
1744
|
-
if (!preferInline && n.specifiers.some((spec) => "importKind" in spec && spec.importKind === "type")) return map.namedTypesImported;
|
|
1745
|
-
return hasNamespace(n) ? map.nsImported : map.imported;
|
|
1746
|
-
}
|
|
1747
|
-
return {
|
|
1748
|
-
ImportDeclaration(n) {
|
|
1749
|
-
const resolvedPath = n.source.value;
|
|
1750
|
-
const importMap = getImportMap(n);
|
|
1751
|
-
if (importMap.has(resolvedPath)) importMap.get(resolvedPath).push(n);
|
|
1752
|
-
else importMap.set(resolvedPath, [n]);
|
|
1753
|
-
},
|
|
1754
|
-
"Program:exit": function() {
|
|
1755
|
-
for (const map of moduleMaps.values()) {
|
|
1756
|
-
checkImports(map.imported, context);
|
|
1757
|
-
checkImports(map.nsImported, context);
|
|
1758
|
-
checkImports(map.defaultTypesImported, context);
|
|
1759
|
-
checkImports(map.namedTypesImported, context);
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
};
|
|
1763
|
-
}
|
|
1764
|
-
});
|
|
1765
|
-
} });
|
|
1766
|
-
|
|
1767
|
-
//#endregion
|
|
1768
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/rules/no-mutable-exports.js
|
|
1769
|
-
var no_mutable_exports_default;
|
|
1770
|
-
var init_no_mutable_exports = __esm({ "src/rules/no-mutable-exports/no-mutable-exports.ts"() {
|
|
1771
|
-
init_utils();
|
|
1772
|
-
no_mutable_exports_default = createRule({
|
|
1773
|
-
name: "no-mutable-exports",
|
|
1774
|
-
meta: {
|
|
1775
|
-
type: "suggestion",
|
|
1776
|
-
docs: { description: "Forbid the use of mutable exports with `var` or `let`." },
|
|
1777
|
-
schema: [],
|
|
1778
|
-
messages: { noMutable: "Exporting mutable '{{kind}}' binding, use 'const' instead." }
|
|
1779
|
-
},
|
|
1780
|
-
defaultOptions: [],
|
|
1781
|
-
create(context) {
|
|
1782
|
-
function checkDeclaration(node) {
|
|
1783
|
-
if ("kind" in node && (node.kind === "var" || node.kind === "let")) context.report({
|
|
1784
|
-
node,
|
|
1785
|
-
messageId: "noMutable",
|
|
1786
|
-
data: { kind: node.kind }
|
|
1787
|
-
});
|
|
1788
|
-
}
|
|
1789
|
-
function checkDeclarationsInScope({ variables }, name) {
|
|
1790
|
-
for (const variable of variables) if (variable.name === name) {
|
|
1791
|
-
for (const def of variable.defs) if (def.type === "Variable" && def.parent) checkDeclaration(def.parent);
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
return {
|
|
1795
|
-
ExportDefaultDeclaration(node) {
|
|
1796
|
-
const scope = context.sourceCode.getScope(node);
|
|
1797
|
-
if ("name" in node.declaration) checkDeclarationsInScope(scope, node.declaration.name);
|
|
1798
|
-
},
|
|
1799
|
-
ExportNamedDeclaration(node) {
|
|
1800
|
-
const scope = context.sourceCode.getScope(node);
|
|
1801
|
-
if (node.declaration) checkDeclaration(node.declaration);
|
|
1802
|
-
else if (!node.source) for (const specifier of node.specifiers) checkDeclarationsInScope(scope, specifier.local.name);
|
|
1803
|
-
}
|
|
1804
|
-
};
|
|
1805
|
-
}
|
|
1806
|
-
});
|
|
1807
|
-
} });
|
|
1808
|
-
|
|
1809
|
-
//#endregion
|
|
1810
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/rules/no-named-default.js
|
|
1811
|
-
var no_named_default_default;
|
|
1812
|
-
var init_no_named_default = __esm({ "src/rules/no-named-default/no-named-default.ts"() {
|
|
1813
|
-
init_utils();
|
|
1814
|
-
init_ast();
|
|
1815
|
-
no_named_default_default = createRule({
|
|
1816
|
-
name: "no-named-default",
|
|
1817
|
-
meta: {
|
|
1818
|
-
type: "suggestion",
|
|
1819
|
-
docs: { description: "Forbid named default exports." },
|
|
1820
|
-
schema: [],
|
|
1821
|
-
messages: { default: `Use default import syntax to import '{{importName}}'.` }
|
|
1822
|
-
},
|
|
1823
|
-
defaultOptions: [],
|
|
1824
|
-
create(context) {
|
|
1825
|
-
return { ImportDeclaration(node) {
|
|
1826
|
-
for (const im of node.specifiers) {
|
|
1827
|
-
if ("importKind" in im && im.importKind === "type") continue;
|
|
1828
|
-
if (im.type === "ImportSpecifier" && getValue(im.imported) === "default") context.report({
|
|
1829
|
-
node: im.local,
|
|
1830
|
-
messageId: "default",
|
|
1831
|
-
data: { importName: im.local.name }
|
|
1832
|
-
});
|
|
1833
|
-
}
|
|
1834
|
-
} };
|
|
1835
|
-
}
|
|
1836
|
-
});
|
|
1837
|
-
} });
|
|
1838
|
-
|
|
1839
|
-
//#endregion
|
|
1840
|
-
//#region node_modules/.pnpm/eslint-plugin-import-lite@0_c838f1a32201d76532b4c7682b426a35/node_modules/eslint-plugin-import-lite/dist/index.js
|
|
1841
|
-
var rules;
|
|
1842
|
-
var init_rules = __esm({ "src/rules/index.ts"() {
|
|
1843
|
-
init_consistent_type_specifier_style();
|
|
1844
|
-
init_first();
|
|
1845
|
-
init_newline_after_import();
|
|
1846
|
-
init_no_default_export();
|
|
1847
|
-
init_no_duplicates();
|
|
1848
|
-
init_no_mutable_exports();
|
|
1849
|
-
init_no_named_default();
|
|
1850
|
-
rules = {
|
|
1851
|
-
"consistent-type-specifier-style": consistent_type_specifier_style_default,
|
|
1852
|
-
"first": first_default,
|
|
1853
|
-
"newline-after-import": newline_after_import_default,
|
|
1854
|
-
"no-default-export": no_default_export_default,
|
|
1855
|
-
"no-duplicates": no_duplicates_default,
|
|
1856
|
-
"no-mutable-exports": no_mutable_exports_default,
|
|
1857
|
-
"no-named-default": no_named_default_default
|
|
1858
|
-
};
|
|
1859
|
-
} });
|
|
1860
|
-
function generateConfig(name, filter) {
|
|
1861
|
-
let ruleMeta = Object.entries(rules).filter(([_, rule]) => !rule.meta?.deprecated);
|
|
1862
|
-
if (filter) ruleMeta = ruleMeta.filter(([ruleName, rule]) => filter(ruleName, rule));
|
|
1863
|
-
return {
|
|
1864
|
-
name: `${pluginName}/${name}`,
|
|
1865
|
-
plugins: { [pluginName]: {
|
|
1866
|
-
name: pluginName,
|
|
1867
|
-
rules
|
|
1868
|
-
} },
|
|
1869
|
-
rules: Object.fromEntries(ruleMeta.map(([ruleName]) => [`${pluginName}/${ruleName}`, "error"]))
|
|
1870
|
-
};
|
|
1871
|
-
}
|
|
1872
|
-
var pluginName, src_default;
|
|
1873
|
-
var init_src = __esm({ "src/index.ts"() {
|
|
1874
|
-
init_rules();
|
|
1875
|
-
pluginName = "import-lite";
|
|
1876
|
-
src_default = {
|
|
1877
|
-
rules,
|
|
1878
|
-
configs: {
|
|
1879
|
-
recommended: generateConfig("recommended", (_, rule) => !!rule.meta?.docs?.recommended),
|
|
1880
|
-
all: generateConfig("all")
|
|
1881
|
-
}
|
|
1882
|
-
};
|
|
1883
|
-
} });
|
|
1884
|
-
init_src();
|
|
1885
|
-
|
|
1886
|
-
//#endregion
|
|
1887
|
-
export { src_default as default };
|