@plugjs/eslint-plugin 0.2.13 → 0.2.15
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/bundles/eslint-import-resolver-typescript.cjs +3 -2
- package/bundles/eslint-plugin-import-x.cjs +872 -401
- package/bundles/stylistic-eslint-plugin.cjs +13689 -15196
- package/package.json +14 -11
|
@@ -25,6 +25,141 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
|
|
28
|
+
// node_modules/eslint-plugin-import-x/package.json
|
|
29
|
+
var require_package = __commonJS({
|
|
30
|
+
"node_modules/eslint-plugin-import-x/package.json"(exports2, module2) {
|
|
31
|
+
module2.exports = {
|
|
32
|
+
name: "eslint-plugin-import-x",
|
|
33
|
+
version: "4.1.1",
|
|
34
|
+
description: "Import with sanity.",
|
|
35
|
+
repository: "git+https://github.com/un-ts/eslint-plugin-import-x",
|
|
36
|
+
author: "JounQin <admin@1stg.me> (https://www.1stG.me)",
|
|
37
|
+
license: "MIT",
|
|
38
|
+
packageManager: "yarn@1.22.19",
|
|
39
|
+
engines: {
|
|
40
|
+
node: "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
41
|
+
},
|
|
42
|
+
main: "lib/index.js",
|
|
43
|
+
exports: {
|
|
44
|
+
".": "./lib/index.js",
|
|
45
|
+
"./package.json": "./package.json",
|
|
46
|
+
"./*": "./lib/*"
|
|
47
|
+
},
|
|
48
|
+
files: [
|
|
49
|
+
"lib",
|
|
50
|
+
"!lib/*.tsbuildinfo"
|
|
51
|
+
],
|
|
52
|
+
keywords: [
|
|
53
|
+
"eslint",
|
|
54
|
+
"eslintplugin",
|
|
55
|
+
"eslint-plugin",
|
|
56
|
+
"es6",
|
|
57
|
+
"jsnext",
|
|
58
|
+
"modules",
|
|
59
|
+
"import",
|
|
60
|
+
"export"
|
|
61
|
+
],
|
|
62
|
+
scripts: {
|
|
63
|
+
build: "tsc -p src",
|
|
64
|
+
clean: "rimraf lib",
|
|
65
|
+
"codesandbox:install": "yarn --ignore-engines",
|
|
66
|
+
lint: "run-p lint:*",
|
|
67
|
+
"lint:docs": "yarn update:eslint-docs --check",
|
|
68
|
+
"lint:es": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint . --cache",
|
|
69
|
+
"lint:tsc": "tsc -p tsconfig.base.json --noEmit",
|
|
70
|
+
prepare: "patch-package",
|
|
71
|
+
release: "changeset publish",
|
|
72
|
+
test: "jest",
|
|
73
|
+
"test-compiled": "yarn build && cross-env TEST_COMPILED=1 jest",
|
|
74
|
+
"update:eslint-docs": "eslint-doc-generator --rule-doc-title-format prefix-name --rule-doc-section-options false --rule-list-split meta.docs.category --ignore-config stage-0 --config-emoji recommended,\u2611\uFE0F",
|
|
75
|
+
watch: "yarn test --watch"
|
|
76
|
+
},
|
|
77
|
+
peerDependencies: {
|
|
78
|
+
eslint: "^8.57.0 || ^9.0.0"
|
|
79
|
+
},
|
|
80
|
+
dependencies: {
|
|
81
|
+
"@typescript-eslint/typescript-estree": "^8.1.0",
|
|
82
|
+
"@typescript-eslint/utils": "^8.1.0",
|
|
83
|
+
debug: "^4.3.4",
|
|
84
|
+
doctrine: "^3.0.0",
|
|
85
|
+
"eslint-import-resolver-node": "^0.3.9",
|
|
86
|
+
"get-tsconfig": "^4.7.3",
|
|
87
|
+
"is-glob": "^4.0.3",
|
|
88
|
+
minimatch: "^9.0.3",
|
|
89
|
+
semver: "^7.6.3",
|
|
90
|
+
"stable-hash": "^0.0.4",
|
|
91
|
+
tslib: "^2.6.3"
|
|
92
|
+
},
|
|
93
|
+
devDependencies: {
|
|
94
|
+
"@1stg/prettier-config": "^4.0.1",
|
|
95
|
+
"@1stg/tsconfig": "^2.3.3",
|
|
96
|
+
"@angular-eslint/template-parser": "^17.5.2",
|
|
97
|
+
"@babel/core": "^7.25.2",
|
|
98
|
+
"@babel/eslint-parser": "^7.25.1",
|
|
99
|
+
"@babel/plugin-proposal-decorators": "^7.24.7",
|
|
100
|
+
"@babel/plugin-proposal-export-default-from": "^7.24.7",
|
|
101
|
+
"@babel/preset-env": "^7.25.3",
|
|
102
|
+
"@babel/preset-flow": "^7.24.7",
|
|
103
|
+
"@babel/preset-react": "^7.24.7",
|
|
104
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
105
|
+
"@babel/register": "^7.24.6",
|
|
106
|
+
"@changesets/changelog-github": "^0.5.0",
|
|
107
|
+
"@changesets/cli": "^2.27.1",
|
|
108
|
+
"@eslint/import-test-order-redirect-scoped": "link:./test/fixtures/order-redirect-scoped",
|
|
109
|
+
"@swc-node/jest": "^1.8.12",
|
|
110
|
+
"@swc/core": "^1.7.6",
|
|
111
|
+
"@swc/helpers": "^0.5.12",
|
|
112
|
+
"@test-scope/some-module": "link:./test/fixtures/symlinked-module",
|
|
113
|
+
"@total-typescript/ts-reset": "^0.5.1",
|
|
114
|
+
"@types/debug": "^4.1.12",
|
|
115
|
+
"@types/doctrine": "^0.0.9",
|
|
116
|
+
"@types/eslint": "^9.6.0",
|
|
117
|
+
"@types/eslint8.56": "npm:@types/eslint@^8.56.11",
|
|
118
|
+
"@types/eslint9": "npm:@types/eslint@^9.6.0",
|
|
119
|
+
"@types/is-glob": "^4.0.4",
|
|
120
|
+
"@types/jest": "^29.5.12",
|
|
121
|
+
"@types/json-schema": "^7.0.15",
|
|
122
|
+
"@types/klaw-sync": "^6.0.5",
|
|
123
|
+
"@types/node": "^20.11.30",
|
|
124
|
+
"@typescript-eslint/eslint-plugin": "^8.1.0",
|
|
125
|
+
"@typescript-eslint/parser": "^8.1.0",
|
|
126
|
+
"@typescript-eslint/rule-tester": "^8.1.0",
|
|
127
|
+
"@unts/patch-package": "^8.0.0",
|
|
128
|
+
"cross-env": "^7.0.3",
|
|
129
|
+
"enhanced-resolve": "^5.16.0",
|
|
130
|
+
escope: "^4.0.0",
|
|
131
|
+
eslint: "^9.9.0",
|
|
132
|
+
"eslint-config-prettier": "^9.1.0",
|
|
133
|
+
"eslint-doc-generator": "^1.7.1",
|
|
134
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
135
|
+
"eslint-import-resolver-webpack": "^0.13.8",
|
|
136
|
+
"eslint-import-test-order-redirect": "link:./test/fixtures/order-redirect",
|
|
137
|
+
"eslint-plugin-eslint-plugin": "^5.4.1",
|
|
138
|
+
"eslint-plugin-import-x": "link:.",
|
|
139
|
+
"eslint-plugin-jest": "^27.9.0",
|
|
140
|
+
"eslint-plugin-json": "^3.1.0",
|
|
141
|
+
"eslint-plugin-n": "^16.6.2",
|
|
142
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
143
|
+
"eslint-plugin-unicorn": "^51.0.1",
|
|
144
|
+
"eslint8.56": "npm:eslint@^8.56.0",
|
|
145
|
+
eslint9: "npm:eslint@^9.8.0",
|
|
146
|
+
"hermes-eslint": "^0.23.1",
|
|
147
|
+
jest: "^29.7.0",
|
|
148
|
+
"klaw-sync": "^6.0.0",
|
|
149
|
+
"npm-run-all2": "^6.1.2",
|
|
150
|
+
prettier: "^3.2.5",
|
|
151
|
+
redux: "^5.0.1",
|
|
152
|
+
rimraf: "^5.0.10",
|
|
153
|
+
svelte: "^4.2.12",
|
|
154
|
+
"ts-node": "^10.9.2",
|
|
155
|
+
"type-fest": "^4.14.0",
|
|
156
|
+
typescript: "^5.5.4",
|
|
157
|
+
zod: "^3.23.8"
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
28
163
|
// node_modules/eslint-plugin-import-x/lib/config/electron.js
|
|
29
164
|
var require_electron = __commonJS({
|
|
30
165
|
"node_modules/eslint-plugin-import-x/lib/config/electron.js"(exports2, module2) {
|
|
@@ -54,17 +189,172 @@ var require_errors = __commonJS({
|
|
|
54
189
|
}
|
|
55
190
|
});
|
|
56
191
|
|
|
57
|
-
// node_modules/eslint-plugin-import-x/lib/config/
|
|
192
|
+
// node_modules/eslint-plugin-import-x/lib/config/flat/electron.js
|
|
193
|
+
var require_electron2 = __commonJS({
|
|
194
|
+
"node_modules/eslint-plugin-import-x/lib/config/flat/electron.js"(exports2) {
|
|
195
|
+
"use strict";
|
|
196
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
197
|
+
exports2.default = {
|
|
198
|
+
settings: {
|
|
199
|
+
"import-x/core-modules": ["electron"]
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
// node_modules/eslint-plugin-import-x/lib/config/flat/errors.js
|
|
206
|
+
var require_errors2 = __commonJS({
|
|
207
|
+
"node_modules/eslint-plugin-import-x/lib/config/flat/errors.js"(exports2) {
|
|
208
|
+
"use strict";
|
|
209
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
210
|
+
exports2.default = {
|
|
211
|
+
rules: {
|
|
212
|
+
"import-x/no-unresolved": 2,
|
|
213
|
+
"import-x/named": 2,
|
|
214
|
+
"import-x/namespace": 2,
|
|
215
|
+
"import-x/default": 2,
|
|
216
|
+
"import-x/export": 2
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// node_modules/eslint-plugin-import-x/lib/config/flat/react.js
|
|
58
223
|
var require_react = __commonJS({
|
|
224
|
+
"node_modules/eslint-plugin-import-x/lib/config/flat/react.js"(exports2) {
|
|
225
|
+
"use strict";
|
|
226
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
227
|
+
exports2.default = {
|
|
228
|
+
settings: {
|
|
229
|
+
"import-x/extensions": [".js", ".jsx", ".mjs", ".cjs"]
|
|
230
|
+
},
|
|
231
|
+
languageOptions: {
|
|
232
|
+
parserOptions: {
|
|
233
|
+
ecmaFeatures: {
|
|
234
|
+
jsx: true
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// node_modules/eslint-plugin-import-x/lib/config/flat/react-native.js
|
|
243
|
+
var require_react_native = __commonJS({
|
|
244
|
+
"node_modules/eslint-plugin-import-x/lib/config/flat/react-native.js"(exports2) {
|
|
245
|
+
"use strict";
|
|
246
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
247
|
+
exports2.default = {
|
|
248
|
+
settings: {
|
|
249
|
+
"import-x/resolver": {
|
|
250
|
+
node: {
|
|
251
|
+
extensions: [".js", ".web.js", ".ios.js", ".android.js"]
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// node_modules/eslint-plugin-import-x/lib/config/flat/recommended.js
|
|
260
|
+
var require_recommended = __commonJS({
|
|
261
|
+
"node_modules/eslint-plugin-import-x/lib/config/flat/recommended.js"(exports2) {
|
|
262
|
+
"use strict";
|
|
263
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
264
|
+
exports2.default = {
|
|
265
|
+
rules: {
|
|
266
|
+
"import-x/no-unresolved": "error",
|
|
267
|
+
"import-x/named": "error",
|
|
268
|
+
"import-x/namespace": "error",
|
|
269
|
+
"import-x/default": "error",
|
|
270
|
+
"import-x/export": "error",
|
|
271
|
+
"import-x/no-named-as-default": "warn",
|
|
272
|
+
"import-x/no-named-as-default-member": "warn",
|
|
273
|
+
"import-x/no-duplicates": "warn"
|
|
274
|
+
},
|
|
275
|
+
languageOptions: {
|
|
276
|
+
ecmaVersion: 2018,
|
|
277
|
+
sourceType: "module"
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
// node_modules/eslint-plugin-import-x/lib/config/flat/stage-0.js
|
|
284
|
+
var require_stage_0 = __commonJS({
|
|
285
|
+
"node_modules/eslint-plugin-import-x/lib/config/flat/stage-0.js"(exports2) {
|
|
286
|
+
"use strict";
|
|
287
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
288
|
+
exports2.default = {
|
|
289
|
+
rules: {
|
|
290
|
+
"import-x/no-deprecated": 1
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
// node_modules/eslint-plugin-import-x/lib/config/flat/typescript.js
|
|
297
|
+
var require_typescript = __commonJS({
|
|
298
|
+
"node_modules/eslint-plugin-import-x/lib/config/flat/typescript.js"(exports2) {
|
|
299
|
+
"use strict";
|
|
300
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
301
|
+
var typeScriptExtensions = [".ts", ".tsx", ".cts", ".mts"];
|
|
302
|
+
var allExtensions = [
|
|
303
|
+
...typeScriptExtensions,
|
|
304
|
+
".js",
|
|
305
|
+
".jsx",
|
|
306
|
+
".cjs",
|
|
307
|
+
".mjs"
|
|
308
|
+
];
|
|
309
|
+
exports2.default = {
|
|
310
|
+
settings: {
|
|
311
|
+
"import-x/extensions": allExtensions,
|
|
312
|
+
"import-x/external-module-folders": ["node_modules", "node_modules/@types"],
|
|
313
|
+
"import-x/parsers": {
|
|
314
|
+
"@typescript-eslint/parser": [...typeScriptExtensions]
|
|
315
|
+
},
|
|
316
|
+
"import-x/resolver": {
|
|
317
|
+
node: {
|
|
318
|
+
extensions: allExtensions
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
rules: {
|
|
323
|
+
"import-x/named": "off"
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
// node_modules/eslint-plugin-import-x/lib/config/flat/warnings.js
|
|
330
|
+
var require_warnings = __commonJS({
|
|
331
|
+
"node_modules/eslint-plugin-import-x/lib/config/flat/warnings.js"(exports2) {
|
|
332
|
+
"use strict";
|
|
333
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
334
|
+
exports2.default = {
|
|
335
|
+
rules: {
|
|
336
|
+
"import-x/no-named-as-default": 1,
|
|
337
|
+
"import-x/no-named-as-default-member": 1,
|
|
338
|
+
"import-x/no-rename-default": 1,
|
|
339
|
+
"import-x/no-duplicates": 1
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// node_modules/eslint-plugin-import-x/lib/config/react.js
|
|
346
|
+
var require_react2 = __commonJS({
|
|
59
347
|
"node_modules/eslint-plugin-import-x/lib/config/react.js"(exports2, module2) {
|
|
60
348
|
"use strict";
|
|
61
349
|
module2.exports = {
|
|
62
350
|
settings: {
|
|
63
351
|
"import-x/extensions": [".js", ".jsx"]
|
|
64
352
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
353
|
+
languageOptions: {
|
|
354
|
+
parserOptions: {
|
|
355
|
+
ecmaFeatures: {
|
|
356
|
+
jsx: true
|
|
357
|
+
}
|
|
68
358
|
}
|
|
69
359
|
}
|
|
70
360
|
};
|
|
@@ -72,7 +362,7 @@ var require_react = __commonJS({
|
|
|
72
362
|
});
|
|
73
363
|
|
|
74
364
|
// node_modules/eslint-plugin-import-x/lib/config/react-native.js
|
|
75
|
-
var
|
|
365
|
+
var require_react_native2 = __commonJS({
|
|
76
366
|
"node_modules/eslint-plugin-import-x/lib/config/react-native.js"(exports2, module2) {
|
|
77
367
|
"use strict";
|
|
78
368
|
module2.exports = {
|
|
@@ -88,7 +378,7 @@ var require_react_native = __commonJS({
|
|
|
88
378
|
});
|
|
89
379
|
|
|
90
380
|
// node_modules/eslint-plugin-import-x/lib/config/recommended.js
|
|
91
|
-
var
|
|
381
|
+
var require_recommended2 = __commonJS({
|
|
92
382
|
"node_modules/eslint-plugin-import-x/lib/config/recommended.js"(exports2, module2) {
|
|
93
383
|
"use strict";
|
|
94
384
|
module2.exports = {
|
|
@@ -112,7 +402,7 @@ var require_recommended = __commonJS({
|
|
|
112
402
|
});
|
|
113
403
|
|
|
114
404
|
// node_modules/eslint-plugin-import-x/lib/config/stage-0.js
|
|
115
|
-
var
|
|
405
|
+
var require_stage_02 = __commonJS({
|
|
116
406
|
"node_modules/eslint-plugin-import-x/lib/config/stage-0.js"(exports2, module2) {
|
|
117
407
|
"use strict";
|
|
118
408
|
module2.exports = {
|
|
@@ -125,17 +415,23 @@ var require_stage_0 = __commonJS({
|
|
|
125
415
|
});
|
|
126
416
|
|
|
127
417
|
// node_modules/eslint-plugin-import-x/lib/config/typescript.js
|
|
128
|
-
var
|
|
418
|
+
var require_typescript2 = __commonJS({
|
|
129
419
|
"node_modules/eslint-plugin-import-x/lib/config/typescript.js"(exports2, module2) {
|
|
130
420
|
"use strict";
|
|
131
|
-
var typeScriptExtensions = [".ts", ".tsx"];
|
|
132
|
-
var allExtensions = [
|
|
421
|
+
var typeScriptExtensions = [".ts", ".tsx", ".cts", ".mts"];
|
|
422
|
+
var allExtensions = [
|
|
423
|
+
...typeScriptExtensions,
|
|
424
|
+
".js",
|
|
425
|
+
".jsx",
|
|
426
|
+
".cjs",
|
|
427
|
+
".mjs"
|
|
428
|
+
];
|
|
133
429
|
module2.exports = {
|
|
134
430
|
settings: {
|
|
135
431
|
"import-x/extensions": allExtensions,
|
|
136
432
|
"import-x/external-module-folders": ["node_modules", "node_modules/@types"],
|
|
137
433
|
"import-x/parsers": {
|
|
138
|
-
"@typescript-eslint/parser": [...typeScriptExtensions
|
|
434
|
+
"@typescript-eslint/parser": [...typeScriptExtensions]
|
|
139
435
|
},
|
|
140
436
|
"import-x/resolver": {
|
|
141
437
|
node: {
|
|
@@ -151,7 +447,7 @@ var require_typescript = __commonJS({
|
|
|
151
447
|
});
|
|
152
448
|
|
|
153
449
|
// node_modules/eslint-plugin-import-x/lib/config/warnings.js
|
|
154
|
-
var
|
|
450
|
+
var require_warnings2 = __commonJS({
|
|
155
451
|
"node_modules/eslint-plugin-import-x/lib/config/warnings.js"(exports2, module2) {
|
|
156
452
|
"use strict";
|
|
157
453
|
module2.exports = {
|
|
@@ -159,6 +455,7 @@ var require_warnings = __commonJS({
|
|
|
159
455
|
rules: {
|
|
160
456
|
"import-x/no-named-as-default": 1,
|
|
161
457
|
"import-x/no-named-as-default-member": 1,
|
|
458
|
+
"import-x/no-rename-default": 1,
|
|
162
459
|
"import-x/no-duplicates": 1
|
|
163
460
|
}
|
|
164
461
|
};
|
|
@@ -175,131 +472,6 @@ var require_constants = __commonJS({
|
|
|
175
472
|
}
|
|
176
473
|
});
|
|
177
474
|
|
|
178
|
-
// node_modules/eslint-plugin-import-x/package.json
|
|
179
|
-
var require_package = __commonJS({
|
|
180
|
-
"node_modules/eslint-plugin-import-x/package.json"(exports2, module2) {
|
|
181
|
-
module2.exports = {
|
|
182
|
-
name: "eslint-plugin-import-x",
|
|
183
|
-
version: "3.1.0",
|
|
184
|
-
description: "Import with sanity.",
|
|
185
|
-
repository: "git+https://github.com/un-ts/eslint-plugin-import-x",
|
|
186
|
-
author: "JounQin <admin@1stg.me> (https://www.1stG.me)",
|
|
187
|
-
license: "MIT",
|
|
188
|
-
packageManager: "yarn@1.22.19",
|
|
189
|
-
engines: {
|
|
190
|
-
node: ">=16"
|
|
191
|
-
},
|
|
192
|
-
main: "lib/index.js",
|
|
193
|
-
exports: {
|
|
194
|
-
".": "./lib/index.js",
|
|
195
|
-
"./package.json": "./package.json",
|
|
196
|
-
"./*": "./lib/*"
|
|
197
|
-
},
|
|
198
|
-
files: [
|
|
199
|
-
"lib",
|
|
200
|
-
"!lib/*.tsbuildinfo"
|
|
201
|
-
],
|
|
202
|
-
keywords: [
|
|
203
|
-
"eslint",
|
|
204
|
-
"eslintplugin",
|
|
205
|
-
"eslint-plugin",
|
|
206
|
-
"es6",
|
|
207
|
-
"jsnext",
|
|
208
|
-
"modules",
|
|
209
|
-
"import",
|
|
210
|
-
"export"
|
|
211
|
-
],
|
|
212
|
-
scripts: {
|
|
213
|
-
build: "tsc -p src",
|
|
214
|
-
clean: "rimraf lib",
|
|
215
|
-
"codesandbox:install": "yarn --ignore-engines",
|
|
216
|
-
lint: "run-p lint:*",
|
|
217
|
-
"lint:docs": "yarn update:eslint-docs --check",
|
|
218
|
-
"lint:es": "eslint . --cache",
|
|
219
|
-
"lint:tsc": "tsc -p tsconfig.base.json --noEmit",
|
|
220
|
-
prepare: "patch-package",
|
|
221
|
-
release: "changeset publish",
|
|
222
|
-
test: "jest",
|
|
223
|
-
"test-compiled": "yarn build && cross-env TEST_COMPILED=1 jest",
|
|
224
|
-
"update:eslint-docs": "eslint-doc-generator --rule-doc-title-format prefix-name --rule-doc-section-options false --rule-list-split meta.docs.category --ignore-config stage-0 --config-emoji recommended,\u2611\uFE0F",
|
|
225
|
-
watch: "yarn test --watch"
|
|
226
|
-
},
|
|
227
|
-
peerDependencies: {
|
|
228
|
-
eslint: "^8.56.0 || ^9.0.0-0"
|
|
229
|
-
},
|
|
230
|
-
dependencies: {
|
|
231
|
-
"@typescript-eslint/utils": "^7.4.0",
|
|
232
|
-
debug: "^4.3.4",
|
|
233
|
-
doctrine: "^3.0.0",
|
|
234
|
-
"eslint-import-resolver-node": "^0.3.9",
|
|
235
|
-
"get-tsconfig": "^4.7.3",
|
|
236
|
-
"is-glob": "^4.0.3",
|
|
237
|
-
minimatch: "^9.0.3",
|
|
238
|
-
semver: "^7.6.0",
|
|
239
|
-
"stable-hash": "^0.0.4",
|
|
240
|
-
tslib: "^2.6.2"
|
|
241
|
-
},
|
|
242
|
-
devDependencies: {
|
|
243
|
-
"@1stg/prettier-config": "^4.0.1",
|
|
244
|
-
"@1stg/tsconfig": "^2.3.3",
|
|
245
|
-
"@angular-eslint/template-parser": "^17.3.0",
|
|
246
|
-
"@babel/core": "^7.24.3",
|
|
247
|
-
"@babel/eslint-parser": "^7.24.1",
|
|
248
|
-
"@babel/plugin-proposal-decorators": "^7.24.1",
|
|
249
|
-
"@babel/plugin-proposal-export-default-from": "^7.24.1",
|
|
250
|
-
"@babel/preset-env": "^7.24.3",
|
|
251
|
-
"@babel/preset-flow": "^7.24.1",
|
|
252
|
-
"@babel/preset-react": "^7.24.1",
|
|
253
|
-
"@babel/preset-typescript": "^7.24.1",
|
|
254
|
-
"@babel/register": "^7.23.7",
|
|
255
|
-
"@changesets/changelog-github": "^0.5.0",
|
|
256
|
-
"@changesets/cli": "^2.27.1",
|
|
257
|
-
"@eslint/import-test-order-redirect-scoped": "link:./test/fixtures/order-redirect-scoped",
|
|
258
|
-
"@swc-node/jest": "^1.8.0",
|
|
259
|
-
"@swc/core": "^1.4.11",
|
|
260
|
-
"@swc/helpers": "^0.5.7",
|
|
261
|
-
"@test-scope/some-module": "link:./test/fixtures/symlinked-module",
|
|
262
|
-
"@total-typescript/ts-reset": "^0.5.1",
|
|
263
|
-
"@types/debug": "^4.1.12",
|
|
264
|
-
"@types/doctrine": "^0.0.9",
|
|
265
|
-
"@types/eslint": "^8.56.6",
|
|
266
|
-
"@types/is-glob": "^4.0.4",
|
|
267
|
-
"@types/jest": "^29.5.12",
|
|
268
|
-
"@types/json-schema": "^7.0.15",
|
|
269
|
-
"@types/node": "^20.11.30",
|
|
270
|
-
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
271
|
-
"@typescript-eslint/parser": "^7.4.0",
|
|
272
|
-
"@unts/patch-package": "^8.0.0",
|
|
273
|
-
"cross-env": "^7.0.3",
|
|
274
|
-
"enhanced-resolve": "^5.16.0",
|
|
275
|
-
escope: "^4.0.0",
|
|
276
|
-
eslint: "^7.2.0 || ^8",
|
|
277
|
-
"eslint-config-prettier": "^9.1.0",
|
|
278
|
-
"eslint-doc-generator": "^1.7.0",
|
|
279
|
-
"eslint-import-resolver-typescript": "^3.6.1",
|
|
280
|
-
"eslint-import-resolver-webpack": "^0.13.8",
|
|
281
|
-
"eslint-import-test-order-redirect": "link:./test/fixtures/order-redirect",
|
|
282
|
-
"eslint-plugin-eslint-plugin": "^5.4.1",
|
|
283
|
-
"eslint-plugin-import-x": "link:.",
|
|
284
|
-
"eslint-plugin-jest": "^27.9.0",
|
|
285
|
-
"eslint-plugin-json": "^3.1.0",
|
|
286
|
-
"eslint-plugin-n": "^16.6.2",
|
|
287
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
288
|
-
"eslint-plugin-unicorn": "^51.0.1",
|
|
289
|
-
jest: "^29.7.0",
|
|
290
|
-
"npm-run-all2": "^6.1.2",
|
|
291
|
-
prettier: "^3.2.5",
|
|
292
|
-
redux: "^5.0.1",
|
|
293
|
-
rimraf: "^5.0.5",
|
|
294
|
-
svelte: "^4.2.12",
|
|
295
|
-
"ts-node": "^10.9.2",
|
|
296
|
-
"type-fest": "^4.14.0",
|
|
297
|
-
typescript: "^5.4.3"
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
|
|
303
475
|
// node_modules/eslint-plugin-import-x/lib/utils/docs-url.js
|
|
304
476
|
var require_docs_url = __commonJS({
|
|
305
477
|
"node_modules/eslint-plugin-import-x/lib/utils/docs-url.js"(exports2) {
|
|
@@ -307,9 +479,9 @@ var require_docs_url = __commonJS({
|
|
|
307
479
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
308
480
|
exports2.docsUrl = void 0;
|
|
309
481
|
var tslib_12 = require("tslib");
|
|
310
|
-
var
|
|
482
|
+
var package_json_12 = tslib_12.__importDefault(require_package());
|
|
311
483
|
var repoUrl = "https://github.com/un-ts/eslint-plugin-import-x";
|
|
312
|
-
var docsUrl = (ruleName, commitish = `v${
|
|
484
|
+
var docsUrl = (ruleName, commitish = `v${package_json_12.default.version}`) => `${repoUrl}/blob/${commitish}/docs/rules/${ruleName}.md`;
|
|
313
485
|
exports2.docsUrl = docsUrl;
|
|
314
486
|
}
|
|
315
487
|
});
|
|
@@ -331,7 +503,7 @@ var require_declared_scope = __commonJS({
|
|
|
331
503
|
"node_modules/eslint-plugin-import-x/lib/utils/declared-scope.js"(exports2) {
|
|
332
504
|
"use strict";
|
|
333
505
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
334
|
-
exports2.declaredScope =
|
|
506
|
+
exports2.declaredScope = declaredScope;
|
|
335
507
|
function declaredScope(context, node, name) {
|
|
336
508
|
const references = context.sourceCode.getScope(node).references;
|
|
337
509
|
const reference = references.find((x) => x.identifier.name === name);
|
|
@@ -340,7 +512,6 @@ var require_declared_scope = __commonJS({
|
|
|
340
512
|
}
|
|
341
513
|
return reference.resolved.scope.type;
|
|
342
514
|
}
|
|
343
|
-
exports2.declaredScope = declaredScope;
|
|
344
515
|
}
|
|
345
516
|
});
|
|
346
517
|
|
|
@@ -373,7 +544,9 @@ var require_ignore = __commonJS({
|
|
|
373
544
|
"node_modules/eslint-plugin-import-x/lib/utils/ignore.js"(exports2) {
|
|
374
545
|
"use strict";
|
|
375
546
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
376
|
-
exports2.
|
|
547
|
+
exports2.getFileExtensions = getFileExtensions;
|
|
548
|
+
exports2.ignore = ignore;
|
|
549
|
+
exports2.hasValidExtension = hasValidExtension;
|
|
377
550
|
var tslib_12 = require("tslib");
|
|
378
551
|
var node_path_1 = tslib_12.__importDefault(require("node:path"));
|
|
379
552
|
var debug_1 = tslib_12.__importDefault(require("debug"));
|
|
@@ -389,7 +562,7 @@ var require_ignore = __commonJS({
|
|
|
389
562
|
return cachedSet;
|
|
390
563
|
}
|
|
391
564
|
function getFileExtensions(settings) {
|
|
392
|
-
const exts = new Set(settings["import-x/extensions"] || [".js"]);
|
|
565
|
+
const exts = new Set(settings["import-x/extensions"] || [".js", ".mjs", ".cjs"]);
|
|
393
566
|
if ("import-x/parsers" in settings) {
|
|
394
567
|
for (const parser in settings["import-x/parsers"]) {
|
|
395
568
|
const parserSettings = settings["import-x/parsers"][parser];
|
|
@@ -402,13 +575,12 @@ var require_ignore = __commonJS({
|
|
|
402
575
|
}
|
|
403
576
|
return exts;
|
|
404
577
|
}
|
|
405
|
-
exports2.getFileExtensions = getFileExtensions;
|
|
406
578
|
function ignore(filepath, context, skipExtensionCheck = false) {
|
|
407
579
|
if (!skipExtensionCheck && !hasValidExtension(filepath, context)) {
|
|
408
580
|
return true;
|
|
409
581
|
}
|
|
410
582
|
const ignoreStrings = context.settings["import-x/ignore"];
|
|
411
|
-
if (!
|
|
583
|
+
if (!ignoreStrings?.length) {
|
|
412
584
|
return false;
|
|
413
585
|
}
|
|
414
586
|
for (let i = 0, len = ignoreStrings.length; i < len; i++) {
|
|
@@ -421,11 +593,9 @@ var require_ignore = __commonJS({
|
|
|
421
593
|
}
|
|
422
594
|
return false;
|
|
423
595
|
}
|
|
424
|
-
exports2.ignore = ignore;
|
|
425
596
|
function hasValidExtension(filepath, context) {
|
|
426
597
|
return validExtensions(context).has(node_path_1.default.extname(filepath));
|
|
427
598
|
}
|
|
428
|
-
exports2.hasValidExtension = hasValidExtension;
|
|
429
599
|
}
|
|
430
600
|
});
|
|
431
601
|
|
|
@@ -434,7 +604,8 @@ var require_lazy_value = __commonJS({
|
|
|
434
604
|
"node_modules/eslint-plugin-import-x/lib/utils/lazy-value.js"(exports2) {
|
|
435
605
|
"use strict";
|
|
436
606
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
437
|
-
exports2.
|
|
607
|
+
exports2.lazy = void 0;
|
|
608
|
+
exports2.defineLazyProperty = defineLazyProperty;
|
|
438
609
|
var lazy = (cb) => {
|
|
439
610
|
let isCalled = false;
|
|
440
611
|
let result;
|
|
@@ -467,7 +638,6 @@ var require_lazy_value = __commonJS({
|
|
|
467
638
|
});
|
|
468
639
|
return object;
|
|
469
640
|
}
|
|
470
|
-
exports2.defineLazyProperty = defineLazyProperty;
|
|
471
641
|
}
|
|
472
642
|
});
|
|
473
643
|
|
|
@@ -476,7 +646,7 @@ var require_module_require = __commonJS({
|
|
|
476
646
|
"node_modules/eslint-plugin-import-x/lib/utils/module-require.js"(exports2) {
|
|
477
647
|
"use strict";
|
|
478
648
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
479
|
-
exports2.moduleRequire =
|
|
649
|
+
exports2.moduleRequire = moduleRequire;
|
|
480
650
|
var tslib_12 = require("tslib");
|
|
481
651
|
var node_module_1 = tslib_12.__importDefault(require("node:module"));
|
|
482
652
|
var node_path_1 = tslib_12.__importDefault(require("node:path"));
|
|
@@ -491,15 +661,14 @@ var require_module_require = __commonJS({
|
|
|
491
661
|
const eslintPath = require.resolve("eslint");
|
|
492
662
|
const eslintModule = createModule(eslintPath);
|
|
493
663
|
return require(node_module_1.default._resolveFilename(p, eslintModule));
|
|
494
|
-
} catch
|
|
664
|
+
} catch {
|
|
495
665
|
}
|
|
496
666
|
try {
|
|
497
667
|
return require.main.require(p);
|
|
498
|
-
} catch
|
|
668
|
+
} catch {
|
|
499
669
|
}
|
|
500
670
|
return require(p);
|
|
501
671
|
}
|
|
502
|
-
exports2.moduleRequire = moduleRequire;
|
|
503
672
|
}
|
|
504
673
|
});
|
|
505
674
|
|
|
@@ -508,9 +677,10 @@ var require_parse = __commonJS({
|
|
|
508
677
|
"node_modules/eslint-plugin-import-x/lib/utils/parse.js"(exports2) {
|
|
509
678
|
"use strict";
|
|
510
679
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
511
|
-
exports2.parse =
|
|
680
|
+
exports2.parse = parse;
|
|
512
681
|
var tslib_12 = require("tslib");
|
|
513
682
|
var node_path_1 = tslib_12.__importDefault(require("node:path"));
|
|
683
|
+
var typescript_estree_1 = require("@typescript-eslint/typescript-estree");
|
|
514
684
|
var debug_1 = tslib_12.__importDefault(require("debug"));
|
|
515
685
|
var module_require_1 = require_module_require();
|
|
516
686
|
var log = (0, debug_1.default)("eslint-plugin-import-x:parse");
|
|
@@ -536,27 +706,23 @@ var require_parse = __commonJS({
|
|
|
536
706
|
return text.replace(/^#!([^\r\n]+)/u, (_, captured) => `//${captured}`);
|
|
537
707
|
}
|
|
538
708
|
function parse(path, content, context) {
|
|
539
|
-
var _a;
|
|
540
709
|
if (context == null) {
|
|
541
710
|
throw new Error("need context to parse properly");
|
|
542
711
|
}
|
|
543
|
-
let parserOptions = "languageOptions" in context &&
|
|
712
|
+
let parserOptions = "languageOptions" in context && context.languageOptions?.parserOptions || context.parserOptions;
|
|
544
713
|
const parserOrPath = getParser(path, context);
|
|
545
714
|
if (!parserOrPath) {
|
|
546
715
|
throw new Error("parserPath or languageOptions.parser is required!");
|
|
547
716
|
}
|
|
548
|
-
parserOptions =
|
|
549
|
-
parserOptions.ecmaFeatures =
|
|
717
|
+
parserOptions = { ...parserOptions };
|
|
718
|
+
parserOptions.ecmaFeatures = { ...parserOptions.ecmaFeatures };
|
|
550
719
|
parserOptions.comment = true;
|
|
551
720
|
parserOptions.attachComment = true;
|
|
552
721
|
parserOptions.tokens = true;
|
|
553
722
|
parserOptions.loc = true;
|
|
554
723
|
parserOptions.range = true;
|
|
555
724
|
parserOptions.filePath = path;
|
|
556
|
-
|
|
557
|
-
delete parserOptions.projectService;
|
|
558
|
-
delete parserOptions.project;
|
|
559
|
-
delete parserOptions.projects;
|
|
725
|
+
parserOptions = (0, typescript_estree_1.withoutProjectParserOptions)(parserOptions);
|
|
560
726
|
const parser = typeof parserOrPath === "string" ? (0, module_require_1.moduleRequire)(parserOrPath) : parserOrPath;
|
|
561
727
|
content = transformHashbang(stripUnicodeBOM(String(content)));
|
|
562
728
|
if ("parseForESLint" in parser && typeof parser.parseForESLint === "function") {
|
|
@@ -571,7 +737,7 @@ var require_parse = __commonJS({
|
|
|
571
737
|
console.warn(`Line ${error.lineNumber}, column ${error.column}: ${error.message}`);
|
|
572
738
|
}
|
|
573
739
|
if (!ast || typeof ast !== "object") {
|
|
574
|
-
console.warn(`\`parseForESLint\` from parser \`${typeof parserOrPath === "string" ? parserOrPath : "`context.languageOptions.parser`"}\` is invalid and will just be ignored
|
|
740
|
+
console.warn(`\`parseForESLint\` from parser \`${typeof parserOrPath === "string" ? parserOrPath : "`context.languageOptions.parser`"}\` is invalid and will just be ignored`, { content, parserMeta: parser.meta });
|
|
575
741
|
} else {
|
|
576
742
|
return makeParseReturn(ast, keysFromParser(parserOrPath, parser));
|
|
577
743
|
}
|
|
@@ -582,14 +748,12 @@ var require_parse = __commonJS({
|
|
|
582
748
|
}
|
|
583
749
|
throw new Error("Parser must expose a `parse` or `parseForESLint` method");
|
|
584
750
|
}
|
|
585
|
-
exports2.parse = parse;
|
|
586
751
|
function getParser(path, context) {
|
|
587
|
-
var _a;
|
|
588
752
|
const parserPath = getParserPath(path, context);
|
|
589
753
|
if (parserPath) {
|
|
590
754
|
return parserPath;
|
|
591
755
|
}
|
|
592
|
-
const parser = "languageOptions" in context &&
|
|
756
|
+
const parser = "languageOptions" in context && context.languageOptions?.parser;
|
|
593
757
|
if (parser && typeof parser !== "string" && ("parse" in parser && typeof parse === "function" || "parseForESLint" in parser && typeof parser.parseForESLint === "function")) {
|
|
594
758
|
return parser;
|
|
595
759
|
}
|
|
@@ -643,7 +807,10 @@ var require_module_cache = __commonJS({
|
|
|
643
807
|
}
|
|
644
808
|
}
|
|
645
809
|
static getSettings(settings) {
|
|
646
|
-
const cacheSettings =
|
|
810
|
+
const cacheSettings = {
|
|
811
|
+
lifetime: 30,
|
|
812
|
+
...settings["import-x/cache"]
|
|
813
|
+
};
|
|
647
814
|
if (typeof cacheSettings.lifetime === "string" && ["\u221E", "Infinity"].includes(cacheSettings.lifetime)) {
|
|
648
815
|
cacheSettings.lifetime = Number.POSITIVE_INFINITY;
|
|
649
816
|
}
|
|
@@ -659,7 +826,7 @@ var require_pkg_up = __commonJS({
|
|
|
659
826
|
"node_modules/eslint-plugin-import-x/lib/utils/pkg-up.js"(exports2) {
|
|
660
827
|
"use strict";
|
|
661
828
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
662
|
-
exports2.pkgUp =
|
|
829
|
+
exports2.pkgUp = pkgUp;
|
|
663
830
|
var tslib_12 = require("tslib");
|
|
664
831
|
var node_fs_1 = tslib_12.__importDefault(require("node:fs"));
|
|
665
832
|
var node_path_1 = tslib_12.__importDefault(require("node:path"));
|
|
@@ -681,7 +848,6 @@ var require_pkg_up = __commonJS({
|
|
|
681
848
|
function pkgUp(opts) {
|
|
682
849
|
return findUp("package.json", opts && opts.cwd);
|
|
683
850
|
}
|
|
684
|
-
exports2.pkgUp = pkgUp;
|
|
685
851
|
}
|
|
686
852
|
});
|
|
687
853
|
|
|
@@ -690,7 +856,7 @@ var require_pkg_dir = __commonJS({
|
|
|
690
856
|
"node_modules/eslint-plugin-import-x/lib/utils/pkg-dir.js"(exports2) {
|
|
691
857
|
"use strict";
|
|
692
858
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
693
|
-
exports2.pkgDir =
|
|
859
|
+
exports2.pkgDir = pkgDir;
|
|
694
860
|
var tslib_12 = require("tslib");
|
|
695
861
|
var node_path_1 = tslib_12.__importDefault(require("node:path"));
|
|
696
862
|
var pkg_up_1 = require_pkg_up();
|
|
@@ -698,7 +864,6 @@ var require_pkg_dir = __commonJS({
|
|
|
698
864
|
const fp = (0, pkg_up_1.pkgUp)({ cwd });
|
|
699
865
|
return fp ? node_path_1.default.dirname(fp) : null;
|
|
700
866
|
}
|
|
701
|
-
exports2.pkgDir = pkgDir;
|
|
702
867
|
}
|
|
703
868
|
});
|
|
704
869
|
|
|
@@ -707,7 +872,10 @@ var require_resolve = __commonJS({
|
|
|
707
872
|
"node_modules/eslint-plugin-import-x/lib/utils/resolve.js"(exports2) {
|
|
708
873
|
"use strict";
|
|
709
874
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
710
|
-
exports2.
|
|
875
|
+
exports2.CASE_SENSITIVE_FS = void 0;
|
|
876
|
+
exports2.fileExistsWithCaseSync = fileExistsWithCaseSync;
|
|
877
|
+
exports2.relative = relative;
|
|
878
|
+
exports2.resolve = resolve;
|
|
711
879
|
var tslib_12 = require("tslib");
|
|
712
880
|
var node_fs_1 = tslib_12.__importDefault(require("node:fs"));
|
|
713
881
|
var node_module_1 = require("node:module");
|
|
@@ -726,11 +894,11 @@ var require_resolve = __commonJS({
|
|
|
726
894
|
} else {
|
|
727
895
|
try {
|
|
728
896
|
resolved = (0, node_module_1.createRequire)(node_path_1.default.resolve(sourceFile)).resolve(target);
|
|
729
|
-
} catch
|
|
897
|
+
} catch {
|
|
730
898
|
resolved = require.resolve(target);
|
|
731
899
|
}
|
|
732
900
|
}
|
|
733
|
-
} catch
|
|
901
|
+
} catch {
|
|
734
902
|
return void 0;
|
|
735
903
|
}
|
|
736
904
|
return require(resolved);
|
|
@@ -760,7 +928,6 @@ var require_resolve = __commonJS({
|
|
|
760
928
|
fileExistsCache.set(filepath, result);
|
|
761
929
|
return result;
|
|
762
930
|
}
|
|
763
|
-
exports2.fileExistsWithCaseSync = fileExistsWithCaseSync;
|
|
764
931
|
var prevSettings = null;
|
|
765
932
|
var memoizedHash;
|
|
766
933
|
function fullResolve(modulePath, sourceFile, settings) {
|
|
@@ -800,7 +967,7 @@ var require_resolve = __commonJS({
|
|
|
800
967
|
found: true,
|
|
801
968
|
path: resolved
|
|
802
969
|
};
|
|
803
|
-
} catch
|
|
970
|
+
} catch {
|
|
804
971
|
return {
|
|
805
972
|
found: false
|
|
806
973
|
};
|
|
@@ -824,7 +991,6 @@ var require_resolve = __commonJS({
|
|
|
824
991
|
function relative(modulePath, sourceFile, settings) {
|
|
825
992
|
return fullResolve(modulePath, sourceFile, settings).path;
|
|
826
993
|
}
|
|
827
|
-
exports2.relative = relative;
|
|
828
994
|
function resolverReducer(resolvers, map) {
|
|
829
995
|
if (Array.isArray(resolvers)) {
|
|
830
996
|
for (const r of resolvers)
|
|
@@ -890,7 +1056,6 @@ var require_resolve = __commonJS({
|
|
|
890
1056
|
}
|
|
891
1057
|
}
|
|
892
1058
|
}
|
|
893
|
-
exports2.resolve = resolve;
|
|
894
1059
|
}
|
|
895
1060
|
});
|
|
896
1061
|
|
|
@@ -899,17 +1064,16 @@ var require_unambiguous = __commonJS({
|
|
|
899
1064
|
"node_modules/eslint-plugin-import-x/lib/utils/unambiguous.js"(exports2) {
|
|
900
1065
|
"use strict";
|
|
901
1066
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
902
|
-
exports2.
|
|
1067
|
+
exports2.isMaybeUnambiguousModule = isMaybeUnambiguousModule;
|
|
1068
|
+
exports2.isUnambiguousModule = isUnambiguousModule;
|
|
903
1069
|
var pattern = /(^|;)\s*(export|import)((\s+\w)|(\s*[*={]))|import\(/m;
|
|
904
1070
|
function isMaybeUnambiguousModule(content) {
|
|
905
1071
|
return pattern.test(content);
|
|
906
1072
|
}
|
|
907
|
-
exports2.isMaybeUnambiguousModule = isMaybeUnambiguousModule;
|
|
908
1073
|
var unambiguousNodeType = /^(?:(?:Exp|Imp)ort.*Declaration|TSExportAssignment)$/;
|
|
909
1074
|
function isUnambiguousModule(ast) {
|
|
910
1075
|
return ast.body && ast.body.some((node) => unambiguousNodeType.test(node.type));
|
|
911
1076
|
}
|
|
912
|
-
exports2.isUnambiguousModule = isUnambiguousModule;
|
|
913
1077
|
}
|
|
914
1078
|
});
|
|
915
1079
|
|
|
@@ -918,7 +1082,7 @@ var require_visit = __commonJS({
|
|
|
918
1082
|
"node_modules/eslint-plugin-import-x/lib/utils/visit.js"(exports2) {
|
|
919
1083
|
"use strict";
|
|
920
1084
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
921
|
-
exports2.visit =
|
|
1085
|
+
exports2.visit = visit;
|
|
922
1086
|
function visit(node, keys, visitorSpec) {
|
|
923
1087
|
if (!node || !keys) {
|
|
924
1088
|
return;
|
|
@@ -945,7 +1109,6 @@ var require_visit = __commonJS({
|
|
|
945
1109
|
exit(node);
|
|
946
1110
|
}
|
|
947
1111
|
}
|
|
948
|
-
exports2.visit = visit;
|
|
949
1112
|
}
|
|
950
1113
|
});
|
|
951
1114
|
|
|
@@ -954,7 +1117,8 @@ var require_export_map = __commonJS({
|
|
|
954
1117
|
"node_modules/eslint-plugin-import-x/lib/utils/export-map.js"(exports2) {
|
|
955
1118
|
"use strict";
|
|
956
1119
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
957
|
-
exports2.
|
|
1120
|
+
exports2.ExportMap = void 0;
|
|
1121
|
+
exports2.recursivePatternCapture = recursivePatternCapture;
|
|
958
1122
|
var tslib_12 = require("tslib");
|
|
959
1123
|
var node_fs_1 = tslib_12.__importDefault(require("node:fs"));
|
|
960
1124
|
var node_path_1 = tslib_12.__importDefault(require("node:path"));
|
|
@@ -1032,7 +1196,6 @@ var require_export_map = __commonJS({
|
|
|
1032
1196
|
return _ExportMap.for(childContext(path, context));
|
|
1033
1197
|
}
|
|
1034
1198
|
static parse(filepath, content, context) {
|
|
1035
|
-
var _a, _b;
|
|
1036
1199
|
const m = new _ExportMap(filepath);
|
|
1037
1200
|
const isEsModuleInteropTrue = (0, lazy_value_1.lazy)(isEsModuleInterop);
|
|
1038
1201
|
let ast;
|
|
@@ -1129,6 +1292,7 @@ var require_export_map = __commonJS({
|
|
|
1129
1292
|
break;
|
|
1130
1293
|
}
|
|
1131
1294
|
case "ExportNamespaceSpecifier": {
|
|
1295
|
+
m2.exports.set(s.exported.name, n);
|
|
1132
1296
|
m2.namespace.set(s.exported.name, Object.defineProperty(exportMeta, "namespace", {
|
|
1133
1297
|
get() {
|
|
1134
1298
|
return resolveImport(nsource);
|
|
@@ -1137,11 +1301,13 @@ var require_export_map = __commonJS({
|
|
|
1137
1301
|
return;
|
|
1138
1302
|
}
|
|
1139
1303
|
case "ExportAllDeclaration": {
|
|
1304
|
+
m2.exports.set((0, get_value_1.getValue)(s.exported), n);
|
|
1140
1305
|
m2.namespace.set((0, get_value_1.getValue)(s.exported), addNamespace(exportMeta, s.exported));
|
|
1141
1306
|
return;
|
|
1142
1307
|
}
|
|
1143
1308
|
case "ExportSpecifier": {
|
|
1144
1309
|
if (!("source" in n && n.source)) {
|
|
1310
|
+
m2.exports.set((0, get_value_1.getValue)(s.exported), n);
|
|
1145
1311
|
m2.namespace.set((0, get_value_1.getValue)(s.exported), addNamespace(exportMeta, s.local));
|
|
1146
1312
|
return;
|
|
1147
1313
|
}
|
|
@@ -1203,7 +1369,6 @@ var require_export_map = __commonJS({
|
|
|
1203
1369
|
}
|
|
1204
1370
|
const source = new eslint_1.SourceCode({ text: content, ast });
|
|
1205
1371
|
function isEsModuleInterop() {
|
|
1206
|
-
var _a2, _b2;
|
|
1207
1372
|
const parserOptions = context.parserOptions || {};
|
|
1208
1373
|
let tsconfigRootDir = parserOptions.tsconfigRootDir;
|
|
1209
1374
|
const project = parserOptions.project;
|
|
@@ -1228,7 +1393,7 @@ var require_export_map = __commonJS({
|
|
|
1228
1393
|
tsConfig = tsconfigResult && tsconfigResult.config || null;
|
|
1229
1394
|
tsconfigCache.set(cacheKey, tsConfig);
|
|
1230
1395
|
}
|
|
1231
|
-
return
|
|
1396
|
+
return tsConfig?.compilerOptions?.esModuleInterop ?? false;
|
|
1232
1397
|
}
|
|
1233
1398
|
for (const n of ast.body) {
|
|
1234
1399
|
if (n.type === "ExportDefaultDeclaration") {
|
|
@@ -1236,6 +1401,7 @@ var require_export_map = __commonJS({
|
|
|
1236
1401
|
if (n.declaration.type === "Identifier") {
|
|
1237
1402
|
addNamespace(exportMeta, n.declaration);
|
|
1238
1403
|
}
|
|
1404
|
+
m.exports.set("default", n);
|
|
1239
1405
|
m.namespace.set("default", exportMeta);
|
|
1240
1406
|
continue;
|
|
1241
1407
|
}
|
|
@@ -1274,12 +1440,16 @@ var require_export_map = __commonJS({
|
|
|
1274
1440
|
case "TSInterfaceDeclaration":
|
|
1275
1441
|
case "TSAbstractClassDeclaration":
|
|
1276
1442
|
case "TSModuleDeclaration": {
|
|
1443
|
+
m.exports.set(n.declaration.id.name, n);
|
|
1277
1444
|
m.namespace.set(n.declaration.id.name, captureDoc(source, docStyleParsers, n));
|
|
1278
1445
|
break;
|
|
1279
1446
|
}
|
|
1280
1447
|
case "VariableDeclaration": {
|
|
1281
1448
|
for (const d of n.declaration.declarations) {
|
|
1282
|
-
recursivePatternCapture(d.id, (id) =>
|
|
1449
|
+
recursivePatternCapture(d.id, (id) => {
|
|
1450
|
+
m.exports.set(id.name, n);
|
|
1451
|
+
m.namespace.set(id.name, captureDoc(source, docStyleParsers, d, n));
|
|
1452
|
+
});
|
|
1283
1453
|
}
|
|
1284
1454
|
break;
|
|
1285
1455
|
}
|
|
@@ -1306,16 +1476,19 @@ var require_export_map = __commonJS({
|
|
|
1306
1476
|
return declTypes.has(node.type) && ("id" in node && node.id && ("name" in node.id ? node.id.name === exportedName : "left" in node.id && getRoot(node.id).name === exportedName) || "declarations" in node && node.declarations.find((d) => "name" in d.id && d.id.name === exportedName));
|
|
1307
1477
|
});
|
|
1308
1478
|
if (exportedDecls.length === 0) {
|
|
1479
|
+
m.exports.set("default", n);
|
|
1309
1480
|
m.namespace.set("default", captureDoc(source, docStyleParsers, n));
|
|
1310
1481
|
continue;
|
|
1311
1482
|
}
|
|
1312
1483
|
if (isEsModuleInteropTrue() && !m.namespace.has("default")) {
|
|
1484
|
+
m.exports.set("default", n);
|
|
1313
1485
|
m.namespace.set("default", {});
|
|
1314
1486
|
}
|
|
1315
1487
|
for (const decl of exportedDecls) {
|
|
1316
1488
|
if (decl.type === "TSModuleDeclaration") {
|
|
1317
|
-
const type =
|
|
1489
|
+
const type = decl.body?.type;
|
|
1318
1490
|
if (type === "TSModuleDeclaration") {
|
|
1491
|
+
m.exports.set(decl.body.id.name, n);
|
|
1319
1492
|
m.namespace.set(decl.body.id.name, captureDoc(source, docStyleParsers, decl.body));
|
|
1320
1493
|
continue;
|
|
1321
1494
|
} else if (type === "TSModuleBlock" && decl.kind === "namespace") {
|
|
@@ -1326,19 +1499,24 @@ var require_export_map = __commonJS({
|
|
|
1326
1499
|
m.namespace.set(decl.id.right.name, metadata);
|
|
1327
1500
|
}
|
|
1328
1501
|
}
|
|
1329
|
-
if (
|
|
1502
|
+
if (decl.body?.body) {
|
|
1330
1503
|
for (const moduleBlockNode of decl.body.body) {
|
|
1331
1504
|
const namespaceDecl = moduleBlockNode.type === "ExportNamedDeclaration" ? moduleBlockNode.declaration : moduleBlockNode;
|
|
1332
1505
|
if (!namespaceDecl) {
|
|
1333
1506
|
} else if (namespaceDecl.type === "VariableDeclaration") {
|
|
1334
1507
|
for (const d of namespaceDecl.declarations)
|
|
1335
|
-
recursivePatternCapture(d.id, (id) =>
|
|
1508
|
+
recursivePatternCapture(d.id, (id) => {
|
|
1509
|
+
m.exports.set(id.name, n);
|
|
1510
|
+
m.namespace.set(id.name, captureDoc(source, docStyleParsers, decl, namespaceDecl, moduleBlockNode));
|
|
1511
|
+
});
|
|
1336
1512
|
} else if ("id" in namespaceDecl) {
|
|
1513
|
+
m.exports.set(namespaceDecl.id.name, n);
|
|
1337
1514
|
m.namespace.set(namespaceDecl.id.name, captureDoc(source, docStyleParsers, moduleBlockNode));
|
|
1338
1515
|
}
|
|
1339
1516
|
}
|
|
1340
1517
|
}
|
|
1341
1518
|
} else {
|
|
1519
|
+
m.exports.set("default", n);
|
|
1342
1520
|
m.namespace.set("default", captureDoc(source, docStyleParsers, decl));
|
|
1343
1521
|
}
|
|
1344
1522
|
}
|
|
@@ -1356,12 +1534,13 @@ var require_export_map = __commonJS({
|
|
|
1356
1534
|
if (doc.tags.some((t) => t.title === "module")) {
|
|
1357
1535
|
return doc;
|
|
1358
1536
|
}
|
|
1359
|
-
} catch
|
|
1537
|
+
} catch {
|
|
1360
1538
|
}
|
|
1361
1539
|
}
|
|
1362
1540
|
}
|
|
1363
1541
|
});
|
|
1364
1542
|
if (isEsModuleInteropTrue() && m.namespace.size > 0 && !m.namespace.has("default")) {
|
|
1543
|
+
m.exports.set("default", ast.body[0]);
|
|
1365
1544
|
m.namespace.set("default", {});
|
|
1366
1545
|
}
|
|
1367
1546
|
const prevParseGoal = m.parseGoal;
|
|
@@ -1379,6 +1558,7 @@ var require_export_map = __commonJS({
|
|
|
1379
1558
|
this.reexports = /* @__PURE__ */ new Map();
|
|
1380
1559
|
this.dependencies = /* @__PURE__ */ new Set();
|
|
1381
1560
|
this.imports = /* @__PURE__ */ new Map();
|
|
1561
|
+
this.exports = /* @__PURE__ */ new Map();
|
|
1382
1562
|
this.errors = [];
|
|
1383
1563
|
this.parseGoal = "ambiguous";
|
|
1384
1564
|
}
|
|
@@ -1491,7 +1671,7 @@ var require_export_map = __commonJS({
|
|
|
1491
1671
|
}
|
|
1492
1672
|
for (const [name, reexports] of this.reexports.entries()) {
|
|
1493
1673
|
const reexported = reexports.getImport();
|
|
1494
|
-
callback.call(thisArg, reexported
|
|
1674
|
+
callback.call(thisArg, reexported?.get(reexports.local), name, this);
|
|
1495
1675
|
}
|
|
1496
1676
|
this.dependencies.forEach((dep) => {
|
|
1497
1677
|
const d = dep();
|
|
@@ -1542,7 +1722,7 @@ var require_export_map = __commonJS({
|
|
|
1542
1722
|
}
|
|
1543
1723
|
}
|
|
1544
1724
|
return;
|
|
1545
|
-
} catch
|
|
1725
|
+
} catch {
|
|
1546
1726
|
continue;
|
|
1547
1727
|
}
|
|
1548
1728
|
}
|
|
@@ -1561,7 +1741,7 @@ var require_export_map = __commonJS({
|
|
|
1561
1741
|
}
|
|
1562
1742
|
try {
|
|
1563
1743
|
return doctrine_1.default.parse(comment.value, { unwrap: true });
|
|
1564
|
-
} catch
|
|
1744
|
+
} catch {
|
|
1565
1745
|
}
|
|
1566
1746
|
}
|
|
1567
1747
|
}
|
|
@@ -1629,7 +1809,6 @@ var require_export_map = __commonJS({
|
|
|
1629
1809
|
default:
|
|
1630
1810
|
}
|
|
1631
1811
|
}
|
|
1632
|
-
exports2.recursivePatternCapture = recursivePatternCapture;
|
|
1633
1812
|
function childContext(path, context) {
|
|
1634
1813
|
const { settings, parserOptions, parserPath, languageOptions } = context;
|
|
1635
1814
|
return {
|
|
@@ -1643,13 +1822,12 @@ var require_export_map = __commonJS({
|
|
|
1643
1822
|
};
|
|
1644
1823
|
}
|
|
1645
1824
|
function makeContextCacheKey(context) {
|
|
1646
|
-
var _a, _b, _c;
|
|
1647
1825
|
const { settings, parserPath, parserOptions, languageOptions } = context;
|
|
1648
|
-
let hash = (0, stable_hash_1.default)(settings) + (0, stable_hash_1.default)(
|
|
1826
|
+
let hash = (0, stable_hash_1.default)(settings) + (0, stable_hash_1.default)(languageOptions?.parserOptions ?? parserOptions);
|
|
1649
1827
|
if (languageOptions) {
|
|
1650
1828
|
hash += String(languageOptions.ecmaVersion) + String(languageOptions.sourceType);
|
|
1651
1829
|
}
|
|
1652
|
-
hash += (0, stable_hash_1.default)(
|
|
1830
|
+
hash += (0, stable_hash_1.default)(parserPath ?? languageOptions?.parser?.meta ?? languageOptions?.parser);
|
|
1653
1831
|
return hash;
|
|
1654
1832
|
}
|
|
1655
1833
|
}
|
|
@@ -1660,10 +1838,12 @@ var require_hash = __commonJS({
|
|
|
1660
1838
|
"node_modules/eslint-plugin-import-x/lib/utils/hash.js"(exports2) {
|
|
1661
1839
|
"use strict";
|
|
1662
1840
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1663
|
-
exports2.
|
|
1841
|
+
exports2.hashify = hashify;
|
|
1842
|
+
exports2.hashArray = hashArray;
|
|
1843
|
+
exports2.hashObject = hashObject;
|
|
1664
1844
|
var node_crypto_1 = require("node:crypto");
|
|
1665
1845
|
function hashify(value, hash) {
|
|
1666
|
-
hash
|
|
1846
|
+
hash ??= (0, node_crypto_1.createHash)("sha256");
|
|
1667
1847
|
if (Array.isArray(value)) {
|
|
1668
1848
|
hashArray(value, hash);
|
|
1669
1849
|
} else if (value instanceof Object) {
|
|
@@ -1673,9 +1853,8 @@ var require_hash = __commonJS({
|
|
|
1673
1853
|
}
|
|
1674
1854
|
return hash;
|
|
1675
1855
|
}
|
|
1676
|
-
exports2.hashify = hashify;
|
|
1677
1856
|
function hashArray(array, hash) {
|
|
1678
|
-
hash
|
|
1857
|
+
hash ??= (0, node_crypto_1.createHash)("sha256");
|
|
1679
1858
|
hash.update("[");
|
|
1680
1859
|
for (const element of array) {
|
|
1681
1860
|
hashify(element, hash);
|
|
@@ -1684,9 +1863,8 @@ var require_hash = __commonJS({
|
|
|
1684
1863
|
hash.update("]");
|
|
1685
1864
|
return hash;
|
|
1686
1865
|
}
|
|
1687
|
-
exports2.hashArray = hashArray;
|
|
1688
1866
|
function hashObject(object, hash) {
|
|
1689
|
-
hash
|
|
1867
|
+
hash ??= (0, node_crypto_1.createHash)("sha256");
|
|
1690
1868
|
hash.update("{");
|
|
1691
1869
|
for (const key of Object.keys(object).sort()) {
|
|
1692
1870
|
hash.update(JSON.stringify(key));
|
|
@@ -1697,7 +1875,6 @@ var require_hash = __commonJS({
|
|
|
1697
1875
|
hash.update("}");
|
|
1698
1876
|
return hash;
|
|
1699
1877
|
}
|
|
1700
|
-
exports2.hashObject = hashObject;
|
|
1701
1878
|
}
|
|
1702
1879
|
});
|
|
1703
1880
|
|
|
@@ -1720,7 +1897,7 @@ var require_read_pkg_up = __commonJS({
|
|
|
1720
1897
|
"node_modules/eslint-plugin-import-x/lib/utils/read-pkg-up.js"(exports2) {
|
|
1721
1898
|
"use strict";
|
|
1722
1899
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1723
|
-
exports2.readPkgUp =
|
|
1900
|
+
exports2.readPkgUp = readPkgUp;
|
|
1724
1901
|
var tslib_12 = require("tslib");
|
|
1725
1902
|
var node_fs_1 = tslib_12.__importDefault(require("node:fs"));
|
|
1726
1903
|
var pkg_up_1 = require_pkg_up();
|
|
@@ -1737,11 +1914,10 @@ var require_read_pkg_up = __commonJS({
|
|
|
1737
1914
|
pkg: JSON.parse(stripBOM(node_fs_1.default.readFileSync(fp, { encoding: "utf8" }))),
|
|
1738
1915
|
path: fp
|
|
1739
1916
|
};
|
|
1740
|
-
} catch
|
|
1917
|
+
} catch {
|
|
1741
1918
|
return {};
|
|
1742
1919
|
}
|
|
1743
1920
|
}
|
|
1744
|
-
exports2.readPkgUp = readPkgUp;
|
|
1745
1921
|
}
|
|
1746
1922
|
});
|
|
1747
1923
|
|
|
@@ -1750,7 +1926,9 @@ var require_package_path = __commonJS({
|
|
|
1750
1926
|
"node_modules/eslint-plugin-import-x/lib/utils/package-path.js"(exports2) {
|
|
1751
1927
|
"use strict";
|
|
1752
1928
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1753
|
-
exports2.
|
|
1929
|
+
exports2.getContextPackagePath = getContextPackagePath;
|
|
1930
|
+
exports2.getFilePackagePath = getFilePackagePath;
|
|
1931
|
+
exports2.getFilePackageName = getFilePackageName;
|
|
1754
1932
|
var tslib_12 = require("tslib");
|
|
1755
1933
|
var node_path_1 = tslib_12.__importDefault(require("node:path"));
|
|
1756
1934
|
var pkg_up_1 = require_pkg_up();
|
|
@@ -1758,11 +1936,9 @@ var require_package_path = __commonJS({
|
|
|
1758
1936
|
function getContextPackagePath(context) {
|
|
1759
1937
|
return getFilePackagePath(context.physicalFilename);
|
|
1760
1938
|
}
|
|
1761
|
-
exports2.getContextPackagePath = getContextPackagePath;
|
|
1762
1939
|
function getFilePackagePath(filename) {
|
|
1763
1940
|
return node_path_1.default.dirname((0, pkg_up_1.pkgUp)({ cwd: filename }));
|
|
1764
1941
|
}
|
|
1765
|
-
exports2.getFilePackagePath = getFilePackagePath;
|
|
1766
1942
|
function getFilePackageName(filename) {
|
|
1767
1943
|
const { pkg, path: pkgPath } = (0, read_pkg_up_1.readPkgUp)({ cwd: filename });
|
|
1768
1944
|
if (pkg) {
|
|
@@ -1770,7 +1946,6 @@ var require_package_path = __commonJS({
|
|
|
1770
1946
|
}
|
|
1771
1947
|
return null;
|
|
1772
1948
|
}
|
|
1773
|
-
exports2.getFilePackageName = getFilePackageName;
|
|
1774
1949
|
}
|
|
1775
1950
|
});
|
|
1776
1951
|
|
|
@@ -1779,7 +1954,13 @@ var require_import_type = __commonJS({
|
|
|
1779
1954
|
"node_modules/eslint-plugin-import-x/lib/utils/import-type.js"(exports2) {
|
|
1780
1955
|
"use strict";
|
|
1781
1956
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1782
|
-
exports2.
|
|
1957
|
+
exports2.isAbsolute = isAbsolute;
|
|
1958
|
+
exports2.isBuiltIn = isBuiltIn;
|
|
1959
|
+
exports2.isExternalModule = isExternalModule;
|
|
1960
|
+
exports2.isExternalModuleMain = isExternalModuleMain;
|
|
1961
|
+
exports2.isScoped = isScoped;
|
|
1962
|
+
exports2.isScopedMain = isScopedMain;
|
|
1963
|
+
exports2.importType = importType;
|
|
1783
1964
|
var tslib_12 = require("tslib");
|
|
1784
1965
|
var node_module_1 = require("node:module");
|
|
1785
1966
|
var node_path_1 = tslib_12.__importDefault(require("node:path"));
|
|
@@ -1794,13 +1975,12 @@ var require_import_type = __commonJS({
|
|
|
1794
1975
|
return pkg;
|
|
1795
1976
|
}
|
|
1796
1977
|
function isInternalRegexMatch(name, settings) {
|
|
1797
|
-
const internalScope = settings
|
|
1978
|
+
const internalScope = settings?.["import-x/internal-regex"];
|
|
1798
1979
|
return internalScope && new RegExp(internalScope).test(name);
|
|
1799
1980
|
}
|
|
1800
1981
|
function isAbsolute(name) {
|
|
1801
1982
|
return typeof name === "string" && node_path_1.default.isAbsolute(name);
|
|
1802
1983
|
}
|
|
1803
|
-
exports2.isAbsolute = isAbsolute;
|
|
1804
1984
|
function isBuiltIn(name, settings, modulePath) {
|
|
1805
1985
|
if (modulePath || !name) {
|
|
1806
1986
|
return false;
|
|
@@ -1809,18 +1989,15 @@ var require_import_type = __commonJS({
|
|
|
1809
1989
|
const extras = settings && settings["import-x/core-modules"] || [];
|
|
1810
1990
|
return (0, node_module_1.isBuiltin)(base) || extras.includes(base);
|
|
1811
1991
|
}
|
|
1812
|
-
exports2.isBuiltIn = isBuiltIn;
|
|
1813
1992
|
function isExternalModule(name, modulePath, context) {
|
|
1814
1993
|
return (isModule(name) || isScoped(name)) && typeTest(name, context, modulePath) === "external";
|
|
1815
1994
|
}
|
|
1816
|
-
exports2.isExternalModule = isExternalModule;
|
|
1817
1995
|
function isExternalModuleMain(name, modulePath, context) {
|
|
1818
1996
|
if (arguments.length < 3) {
|
|
1819
1997
|
throw new TypeError("isExternalModule: name, path, and context are all required");
|
|
1820
1998
|
}
|
|
1821
1999
|
return isModuleMain(name) && typeTest(name, context, modulePath) === "external";
|
|
1822
2000
|
}
|
|
1823
|
-
exports2.isExternalModuleMain = isExternalModuleMain;
|
|
1824
2001
|
var moduleRegExp = /^\w/;
|
|
1825
2002
|
function isModule(name) {
|
|
1826
2003
|
return !!name && moduleRegExp.test(name);
|
|
@@ -1833,12 +2010,10 @@ var require_import_type = __commonJS({
|
|
|
1833
2010
|
function isScoped(name) {
|
|
1834
2011
|
return !!name && scopedRegExp.test(name);
|
|
1835
2012
|
}
|
|
1836
|
-
exports2.isScoped = isScoped;
|
|
1837
2013
|
var scopedMainRegExp = /^@[^/]+\/?[^/]+$/;
|
|
1838
2014
|
function isScopedMain(name) {
|
|
1839
2015
|
return !!name && scopedMainRegExp.test(name);
|
|
1840
2016
|
}
|
|
1841
|
-
exports2.isScopedMain = isScopedMain;
|
|
1842
2017
|
function isRelativeToParent(name) {
|
|
1843
2018
|
return /^\.\.$|^\.\.[/\\]/.test(name);
|
|
1844
2019
|
}
|
|
@@ -1858,7 +2033,7 @@ var require_import_type = __commonJS({
|
|
|
1858
2033
|
if (node_path_1.default.relative(packagePath, filepath).startsWith("..")) {
|
|
1859
2034
|
return true;
|
|
1860
2035
|
}
|
|
1861
|
-
const folders =
|
|
2036
|
+
const folders = settings?.["import-x/external-module-folders"] || [
|
|
1862
2037
|
"node_modules"
|
|
1863
2038
|
];
|
|
1864
2039
|
return folders.some((folder) => {
|
|
@@ -1911,7 +2086,6 @@ var require_import_type = __commonJS({
|
|
|
1911
2086
|
function importType(name, context) {
|
|
1912
2087
|
return typeTest(name, context, (0, resolve_1.resolve)(name, context));
|
|
1913
2088
|
}
|
|
1914
|
-
exports2.importType = importType;
|
|
1915
2089
|
}
|
|
1916
2090
|
});
|
|
1917
2091
|
|
|
@@ -1920,12 +2094,14 @@ var require_module_visitor = __commonJS({
|
|
|
1920
2094
|
"node_modules/eslint-plugin-import-x/lib/utils/module-visitor.js"(exports2) {
|
|
1921
2095
|
"use strict";
|
|
1922
2096
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1923
|
-
exports2.optionsSchema =
|
|
2097
|
+
exports2.optionsSchema = void 0;
|
|
2098
|
+
exports2.moduleVisitor = moduleVisitor;
|
|
2099
|
+
exports2.makeOptionsSchema = makeOptionsSchema;
|
|
1924
2100
|
function moduleVisitor(visitor, options) {
|
|
1925
|
-
const ignore = options
|
|
1926
|
-
const amd = !!
|
|
1927
|
-
const commonjs = !!
|
|
1928
|
-
const esmodule = !!
|
|
2101
|
+
const ignore = options?.ignore;
|
|
2102
|
+
const amd = !!options?.amd;
|
|
2103
|
+
const commonjs = !!options?.commonjs;
|
|
2104
|
+
const esmodule = !!{ esmodule: true, ...options }.esmodule;
|
|
1929
2105
|
const ignoreRegExps = ignore == null ? [] : ignore.map((p) => new RegExp(p));
|
|
1930
2106
|
function checkSourceValue(source, importer) {
|
|
1931
2107
|
if (source == null) {
|
|
@@ -2037,7 +2213,6 @@ var require_module_visitor = __commonJS({
|
|
|
2037
2213
|
}
|
|
2038
2214
|
return visitors;
|
|
2039
2215
|
}
|
|
2040
|
-
exports2.moduleVisitor = moduleVisitor;
|
|
2041
2216
|
function makeOptionsSchema(additionalProperties) {
|
|
2042
2217
|
const base = {
|
|
2043
2218
|
type: "object",
|
|
@@ -2061,7 +2236,6 @@ var require_module_visitor = __commonJS({
|
|
|
2061
2236
|
}
|
|
2062
2237
|
return base;
|
|
2063
2238
|
}
|
|
2064
|
-
exports2.makeOptionsSchema = makeOptionsSchema;
|
|
2065
2239
|
exports2.optionsSchema = makeOptionsSchema();
|
|
2066
2240
|
}
|
|
2067
2241
|
});
|
|
@@ -2071,11 +2245,10 @@ var require_static_require = __commonJS({
|
|
|
2071
2245
|
"node_modules/eslint-plugin-import-x/lib/utils/static-require.js"(exports2) {
|
|
2072
2246
|
"use strict";
|
|
2073
2247
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
2074
|
-
exports2.isStaticRequire =
|
|
2248
|
+
exports2.isStaticRequire = isStaticRequire;
|
|
2075
2249
|
function isStaticRequire(node) {
|
|
2076
2250
|
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";
|
|
2077
2251
|
}
|
|
2078
|
-
exports2.isStaticRequire = isStaticRequire;
|
|
2079
2252
|
}
|
|
2080
2253
|
});
|
|
2081
2254
|
|
|
@@ -2410,7 +2583,7 @@ var require_dynamic_import_chunkname = __commonJS({
|
|
|
2410
2583
|
}
|
|
2411
2584
|
try {
|
|
2412
2585
|
node_vm_1.default.runInNewContext(`(function() {return {${comment.value}}})()`);
|
|
2413
|
-
} catch
|
|
2586
|
+
} catch {
|
|
2414
2587
|
context.report({
|
|
2415
2588
|
node,
|
|
2416
2589
|
messageId: "webpackComment"
|
|
@@ -2512,10 +2685,7 @@ var require_export = __commonJS({
|
|
|
2512
2685
|
var tsTypePrefix = "type:";
|
|
2513
2686
|
function isTypescriptFunctionOverloads(nodes) {
|
|
2514
2687
|
const nodesArr = [...nodes];
|
|
2515
|
-
const idents = nodesArr.flatMap((node) =>
|
|
2516
|
-
var _a;
|
|
2517
|
-
return "declaration" in node && ((_a = node.declaration) === null || _a === void 0 ? void 0 : _a.type) === "TSDeclareFunction" ? node.declaration.id.name : [];
|
|
2518
|
-
});
|
|
2688
|
+
const idents = nodesArr.flatMap((node) => "declaration" in node && node.declaration?.type === "TSDeclareFunction" ? node.declaration.id.name : []);
|
|
2519
2689
|
if (new Set(idents).size !== idents.length) {
|
|
2520
2690
|
return true;
|
|
2521
2691
|
}
|
|
@@ -2572,8 +2742,7 @@ var require_export = __commonJS({
|
|
|
2572
2742
|
nodes.add(node);
|
|
2573
2743
|
}
|
|
2574
2744
|
function getParent(node) {
|
|
2575
|
-
|
|
2576
|
-
if (((_a = node.parent) === null || _a === void 0 ? void 0 : _a.type) === "TSModuleBlock") {
|
|
2745
|
+
if (node.parent?.type === "TSModuleBlock") {
|
|
2577
2746
|
return node.parent.parent;
|
|
2578
2747
|
}
|
|
2579
2748
|
return rootProgram;
|
|
@@ -2932,7 +3101,7 @@ var require_first = __commonJS({
|
|
|
2932
3101
|
return {
|
|
2933
3102
|
Program(n) {
|
|
2934
3103
|
const body = n.body;
|
|
2935
|
-
if (!
|
|
3104
|
+
if (!body?.length) {
|
|
2936
3105
|
return;
|
|
2937
3106
|
}
|
|
2938
3107
|
const absoluteFirst = context.options[0] === "absolute-first";
|
|
@@ -3161,14 +3330,20 @@ var require_imports_first = __commonJS({
|
|
|
3161
3330
|
"node_modules/eslint-plugin-import-x/lib/rules/imports-first.js"(exports2, module2) {
|
|
3162
3331
|
"use strict";
|
|
3163
3332
|
var tslib_12 = require("tslib");
|
|
3164
|
-
var utils_1 =
|
|
3165
|
-
var docs_url_1 = require_docs_url();
|
|
3333
|
+
var utils_1 = require_utils();
|
|
3166
3334
|
var first_12 = tslib_12.__importDefault(require_first());
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3335
|
+
module2.exports = (0, utils_1.createRule)({
|
|
3336
|
+
...first_12.default,
|
|
3337
|
+
name: "imports-first",
|
|
3338
|
+
meta: {
|
|
3339
|
+
...first_12.default.meta,
|
|
3340
|
+
deprecated: true,
|
|
3341
|
+
docs: {
|
|
3342
|
+
category: "Style guide",
|
|
3343
|
+
description: "Replaced by `import-x/first`."
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
});
|
|
3172
3347
|
}
|
|
3173
3348
|
});
|
|
3174
3349
|
|
|
@@ -3204,24 +3379,27 @@ var require_max_dependencies = __commonJS({
|
|
|
3204
3379
|
const { ignoreTypeImports } = context.options[0] || {};
|
|
3205
3380
|
const dependencies = /* @__PURE__ */ new Set();
|
|
3206
3381
|
let lastNode;
|
|
3207
|
-
return
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
context.report({
|
|
3213
|
-
node: lastNode,
|
|
3214
|
-
messageId: "max",
|
|
3215
|
-
data: {
|
|
3216
|
-
max
|
|
3382
|
+
return {
|
|
3383
|
+
"Program:exit"() {
|
|
3384
|
+
const { max = 10 } = context.options[0] || {};
|
|
3385
|
+
if (dependencies.size <= max) {
|
|
3386
|
+
return;
|
|
3217
3387
|
}
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3388
|
+
context.report({
|
|
3389
|
+
node: lastNode,
|
|
3390
|
+
messageId: "max",
|
|
3391
|
+
data: {
|
|
3392
|
+
max
|
|
3393
|
+
}
|
|
3394
|
+
});
|
|
3395
|
+
},
|
|
3396
|
+
...(0, utils_1.moduleVisitor)((source, node) => {
|
|
3397
|
+
if ("importKind" in node && node.importKind !== "type" || !ignoreTypeImports) {
|
|
3398
|
+
dependencies.add(source.value);
|
|
3399
|
+
}
|
|
3400
|
+
lastNode = source;
|
|
3401
|
+
}, { commonjs: true })
|
|
3402
|
+
};
|
|
3225
3403
|
}
|
|
3226
3404
|
});
|
|
3227
3405
|
}
|
|
@@ -3493,7 +3671,7 @@ var require_namespace = __commonJS({
|
|
|
3493
3671
|
return;
|
|
3494
3672
|
}
|
|
3495
3673
|
const parent = dereference.parent;
|
|
3496
|
-
if (
|
|
3674
|
+
if (parent?.type === "AssignmentExpression" && parent.left === dereference) {
|
|
3497
3675
|
context.report({
|
|
3498
3676
|
node: parent,
|
|
3499
3677
|
messageId: "namespaceMember",
|
|
@@ -3505,7 +3683,7 @@ var require_namespace = __commonJS({
|
|
|
3505
3683
|
let namespace = namespaces.get(dereference.object.name);
|
|
3506
3684
|
const namepath = [dereference.object.name];
|
|
3507
3685
|
let deref = dereference;
|
|
3508
|
-
while (namespace instanceof utils_1.ExportMap &&
|
|
3686
|
+
while (namespace instanceof utils_1.ExportMap && deref?.type === "MemberExpression") {
|
|
3509
3687
|
if (deref.computed) {
|
|
3510
3688
|
if (!allowComputed) {
|
|
3511
3689
|
context.report({
|
|
@@ -3622,15 +3800,13 @@ var require_newline_after_import = __commonJS({
|
|
|
3622
3800
|
return nextNode.loc.start.line - node.loc.end.line;
|
|
3623
3801
|
}
|
|
3624
3802
|
function isClassWithDecorator(node) {
|
|
3625
|
-
|
|
3626
|
-
return node.type === "ClassDeclaration" && !!((_a = node.decorators) === null || _a === void 0 ? void 0 : _a.length);
|
|
3803
|
+
return node.type === "ClassDeclaration" && !!node.decorators?.length;
|
|
3627
3804
|
}
|
|
3628
3805
|
function isExportDefaultClass(node) {
|
|
3629
3806
|
return node.type === "ExportDefaultDeclaration" && node.declaration.type === "ClassDeclaration";
|
|
3630
3807
|
}
|
|
3631
3808
|
function isExportNameClass(node) {
|
|
3632
|
-
|
|
3633
|
-
return node.type === "ExportNamedDeclaration" && ((_a = node.declaration) === null || _a === void 0 ? void 0 : _a.type) === "ClassDeclaration";
|
|
3809
|
+
return node.type === "ExportNamedDeclaration" && node.declaration?.type === "ClassDeclaration";
|
|
3634
3810
|
}
|
|
3635
3811
|
module2.exports = (0, utils_1.createRule)({
|
|
3636
3812
|
name: "newline-after-import",
|
|
@@ -3663,7 +3839,12 @@ var require_newline_after_import = __commonJS({
|
|
|
3663
3839
|
create(context) {
|
|
3664
3840
|
let level = 0;
|
|
3665
3841
|
const requireCalls = [];
|
|
3666
|
-
const options =
|
|
3842
|
+
const options = {
|
|
3843
|
+
count: 1,
|
|
3844
|
+
exactCount: false,
|
|
3845
|
+
considerComments: false,
|
|
3846
|
+
...context.options[0]
|
|
3847
|
+
};
|
|
3667
3848
|
function checkForNewLine(node, nextNode, type) {
|
|
3668
3849
|
if (isExportDefaultClass(nextNode) || isExportNameClass(nextNode)) {
|
|
3669
3850
|
const classNode = nextNode.declaration;
|
|
@@ -3813,7 +3994,7 @@ var require_no_absolute_path = __commonJS({
|
|
|
3813
3994
|
},
|
|
3814
3995
|
defaultOptions: [],
|
|
3815
3996
|
create(context) {
|
|
3816
|
-
const options =
|
|
3997
|
+
const options = { esmodule: true, commonjs: true, ...context.options[0] };
|
|
3817
3998
|
return (0, utils_1.moduleVisitor)((source) => {
|
|
3818
3999
|
if (!(0, utils_1.isAbsolute)(source.value)) {
|
|
3819
4000
|
return;
|
|
@@ -4004,7 +4185,7 @@ var require_no_anonymous_default_export = __commonJS({
|
|
|
4004
4185
|
},
|
|
4005
4186
|
defaultOptions: [],
|
|
4006
4187
|
create(context) {
|
|
4007
|
-
const options =
|
|
4188
|
+
const options = { ...defaults, ...context.options[0] };
|
|
4008
4189
|
return {
|
|
4009
4190
|
ExportDefaultDeclaration(node) {
|
|
4010
4191
|
const type = node.declaration.type;
|
|
@@ -4211,67 +4392,70 @@ var require_no_cycle = __commonJS({
|
|
|
4211
4392
|
const options = context.options[0] || {};
|
|
4212
4393
|
const maxDepth = typeof options.maxDepth === "number" ? options.maxDepth : Number.POSITIVE_INFINITY;
|
|
4213
4394
|
const ignoreModule = options.ignoreExternal ? (name) => (0, utils_1.isExternalModule)(name, (0, utils_1.resolve)(name, context), context) : () => false;
|
|
4214
|
-
return
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
}
|
|
4218
|
-
if (options.allowUnsafeDynamicCyclicDependency && (importer.type === "ImportExpression" || importer.type === "CallExpression" && "name" in importer.callee && importer.callee.name !== "require")) {
|
|
4219
|
-
return;
|
|
4220
|
-
}
|
|
4221
|
-
if (importer.type === "ImportDeclaration" && (importer.importKind === "type" || importer.specifiers.every((s) => "importKind" in s && s.importKind === "type"))) {
|
|
4222
|
-
return;
|
|
4223
|
-
}
|
|
4224
|
-
const imported = utils_1.ExportMap.get(sourceNode.value, context);
|
|
4225
|
-
if (imported == null) {
|
|
4226
|
-
return;
|
|
4227
|
-
}
|
|
4228
|
-
if (imported.path === filename) {
|
|
4229
|
-
return;
|
|
4230
|
-
}
|
|
4231
|
-
const untraversed = [{ mget: () => imported, route: [] }];
|
|
4232
|
-
function detectCycle({ mget, route }) {
|
|
4233
|
-
const m = mget();
|
|
4234
|
-
if (m == null) {
|
|
4395
|
+
return {
|
|
4396
|
+
...(0, utils_1.moduleVisitor)(function checkSourceValue(sourceNode, importer) {
|
|
4397
|
+
if (ignoreModule(sourceNode.value)) {
|
|
4235
4398
|
return;
|
|
4236
4399
|
}
|
|
4237
|
-
if (
|
|
4400
|
+
if (options.allowUnsafeDynamicCyclicDependency && (importer.type === "ImportExpression" || importer.type === "CallExpression" && "name" in importer.callee && importer.callee.name !== "require")) {
|
|
4238
4401
|
return;
|
|
4239
4402
|
}
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4403
|
+
if (importer.type === "ImportDeclaration" && (importer.importKind === "type" || importer.specifiers.every((s) => "importKind" in s && s.importKind === "type"))) {
|
|
4404
|
+
return;
|
|
4405
|
+
}
|
|
4406
|
+
const imported = utils_1.ExportMap.get(sourceNode.value, context);
|
|
4407
|
+
if (imported == null) {
|
|
4408
|
+
return;
|
|
4409
|
+
}
|
|
4410
|
+
if (imported.path === filename) {
|
|
4411
|
+
return;
|
|
4412
|
+
}
|
|
4413
|
+
const untraversed = [{ mget: () => imported, route: [] }];
|
|
4414
|
+
function detectCycle({ mget, route }) {
|
|
4415
|
+
const m = mget();
|
|
4416
|
+
if (m == null) {
|
|
4247
4417
|
return;
|
|
4248
4418
|
}
|
|
4249
|
-
if (path
|
|
4250
|
-
return
|
|
4419
|
+
if (traversed.has(m.path)) {
|
|
4420
|
+
return;
|
|
4251
4421
|
}
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4422
|
+
traversed.add(m.path);
|
|
4423
|
+
for (const [path, { getter, declarations }] of m.imports) {
|
|
4424
|
+
if (traversed.has(path)) {
|
|
4425
|
+
continue;
|
|
4426
|
+
}
|
|
4427
|
+
const toTraverse = [...declarations].filter(({ source, isOnlyImportingTypes }) => !ignoreModule(source.value) && !isOnlyImportingTypes);
|
|
4428
|
+
if (options.allowUnsafeDynamicCyclicDependency && toTraverse.some((d) => d.dynamic)) {
|
|
4429
|
+
return;
|
|
4430
|
+
}
|
|
4431
|
+
if (path === filename && toTraverse.length > 0) {
|
|
4432
|
+
return true;
|
|
4433
|
+
}
|
|
4434
|
+
if (route.length + 1 < maxDepth) {
|
|
4435
|
+
for (const { source } of toTraverse) {
|
|
4436
|
+
untraversed.push({ mget: getter, route: [...route, source] });
|
|
4437
|
+
}
|
|
4255
4438
|
}
|
|
4256
4439
|
}
|
|
4257
4440
|
}
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
}
|
|
4268
|
-
|
|
4269
|
-
|
|
4441
|
+
while (untraversed.length > 0) {
|
|
4442
|
+
const next = untraversed.shift();
|
|
4443
|
+
if (detectCycle(next)) {
|
|
4444
|
+
context.report({
|
|
4445
|
+
node: importer,
|
|
4446
|
+
messageId: "cycle",
|
|
4447
|
+
data: {
|
|
4448
|
+
source: next.route.length > 0 ? `via ${routeString(next.route)}` : "detected."
|
|
4449
|
+
}
|
|
4450
|
+
});
|
|
4451
|
+
return;
|
|
4452
|
+
}
|
|
4270
4453
|
}
|
|
4454
|
+
}, context.options[0]),
|
|
4455
|
+
"Program:exit"() {
|
|
4456
|
+
traversed.clear();
|
|
4271
4457
|
}
|
|
4272
|
-
}
|
|
4273
|
-
traversed.clear();
|
|
4274
|
-
} });
|
|
4458
|
+
};
|
|
4275
4459
|
}
|
|
4276
4460
|
});
|
|
4277
4461
|
}
|
|
@@ -4376,7 +4560,6 @@ var require_no_deprecated = __commonJS({
|
|
|
4376
4560
|
const namespaces = /* @__PURE__ */ new Map();
|
|
4377
4561
|
return {
|
|
4378
4562
|
Program({ body }) {
|
|
4379
|
-
var _a;
|
|
4380
4563
|
for (const node of body) {
|
|
4381
4564
|
if (node.type !== "ImportDeclaration") {
|
|
4382
4565
|
continue;
|
|
@@ -4388,9 +4571,12 @@ var require_no_deprecated = __commonJS({
|
|
|
4388
4571
|
if (imports == null) {
|
|
4389
4572
|
continue;
|
|
4390
4573
|
}
|
|
4391
|
-
const moduleDeprecation =
|
|
4574
|
+
const moduleDeprecation = imports.doc?.tags.find((t) => t.title === "deprecated");
|
|
4392
4575
|
if (moduleDeprecation) {
|
|
4393
|
-
context.report(
|
|
4576
|
+
context.report({
|
|
4577
|
+
node,
|
|
4578
|
+
...message(moduleDeprecation)
|
|
4579
|
+
});
|
|
4394
4580
|
}
|
|
4395
4581
|
if (imports.errors.length > 0) {
|
|
4396
4582
|
imports.reportErrors(context, node);
|
|
@@ -4432,7 +4618,10 @@ var require_no_deprecated = __commonJS({
|
|
|
4432
4618
|
if (!deprecation) {
|
|
4433
4619
|
continue;
|
|
4434
4620
|
}
|
|
4435
|
-
context.report(
|
|
4621
|
+
context.report({
|
|
4622
|
+
node: im,
|
|
4623
|
+
...message(deprecation)
|
|
4624
|
+
});
|
|
4436
4625
|
deprecated.set(local, deprecation);
|
|
4437
4626
|
}
|
|
4438
4627
|
}
|
|
@@ -4450,7 +4639,10 @@ var require_no_deprecated = __commonJS({
|
|
|
4450
4639
|
if ((0, utils_1.declaredScope)(context, node, node.name) !== "module") {
|
|
4451
4640
|
return;
|
|
4452
4641
|
}
|
|
4453
|
-
context.report(
|
|
4642
|
+
context.report({
|
|
4643
|
+
node,
|
|
4644
|
+
...message(deprecated.get(node.name))
|
|
4645
|
+
});
|
|
4454
4646
|
},
|
|
4455
4647
|
MemberExpression(dereference) {
|
|
4456
4648
|
if (dereference.object.type !== "Identifier") {
|
|
@@ -4465,7 +4657,7 @@ var require_no_deprecated = __commonJS({
|
|
|
4465
4657
|
let namespace = namespaces.get(dereference.object.name);
|
|
4466
4658
|
const namepath = [dereference.object.name];
|
|
4467
4659
|
let node = dereference;
|
|
4468
|
-
while (namespace instanceof utils_1.ExportMap &&
|
|
4660
|
+
while (namespace instanceof utils_1.ExportMap && node?.type === "MemberExpression") {
|
|
4469
4661
|
if (node.computed) {
|
|
4470
4662
|
return;
|
|
4471
4663
|
}
|
|
@@ -4475,7 +4667,10 @@ var require_no_deprecated = __commonJS({
|
|
|
4475
4667
|
}
|
|
4476
4668
|
const deprecation = getDeprecation(metadata);
|
|
4477
4669
|
if (deprecation) {
|
|
4478
|
-
context.report(
|
|
4670
|
+
context.report({
|
|
4671
|
+
node: node.property,
|
|
4672
|
+
...message(deprecation)
|
|
4673
|
+
});
|
|
4479
4674
|
}
|
|
4480
4675
|
namepath.push(node.property.name);
|
|
4481
4676
|
namespace = metadata.namespace;
|
|
@@ -4500,7 +4695,7 @@ var require_no_duplicates = __commonJS({
|
|
|
4500
4695
|
let typescriptPkg;
|
|
4501
4696
|
try {
|
|
4502
4697
|
typescriptPkg = require("typescript/package.json");
|
|
4503
|
-
} catch
|
|
4698
|
+
} catch {
|
|
4504
4699
|
}
|
|
4505
4700
|
return !typescriptPkg || !semver_1.default.satisfies(typescriptPkg.version, ">= 4.5");
|
|
4506
4701
|
});
|
|
@@ -4634,7 +4829,7 @@ var require_no_duplicates = __commonJS({
|
|
|
4634
4829
|
}
|
|
4635
4830
|
function getDefaultImportName(node) {
|
|
4636
4831
|
const defaultSpecifier = node.specifiers.find((specifier) => specifier.type === "ImportDefaultSpecifier");
|
|
4637
|
-
return defaultSpecifier
|
|
4832
|
+
return defaultSpecifier?.local.name;
|
|
4638
4833
|
}
|
|
4639
4834
|
function hasNamespace(node) {
|
|
4640
4835
|
return node.specifiers.some((specifier) => specifier.type === "ImportNamespaceSpecifier");
|
|
@@ -4690,9 +4885,8 @@ var require_no_duplicates = __commonJS({
|
|
|
4690
4885
|
},
|
|
4691
4886
|
defaultOptions: [],
|
|
4692
4887
|
create(context) {
|
|
4693
|
-
|
|
4694
|
-
const
|
|
4695
|
-
const considerQueryStringOption = (_b = context.options[0]) === null || _b === void 0 ? void 0 : _b.considerQueryString;
|
|
4888
|
+
const preferInline = context.options[0]?.["prefer-inline"];
|
|
4889
|
+
const considerQueryStringOption = context.options[0]?.considerQueryString;
|
|
4696
4890
|
const defaultResolver = (sourcePath) => (0, utils_1.resolve)(sourcePath, context) || sourcePath;
|
|
4697
4891
|
const resolver = considerQueryStringOption ? (sourcePath) => {
|
|
4698
4892
|
const parts = sourcePath.match(/^([^?]*)\?(.*)$/);
|
|
@@ -5160,11 +5354,14 @@ var require_no_extraneous_dependencies = __commonJS({
|
|
|
5160
5354
|
verifyInternalDeps: !!options.includeInternal,
|
|
5161
5355
|
verifyTypeImports: !!options.includeTypes
|
|
5162
5356
|
};
|
|
5163
|
-
return
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5357
|
+
return {
|
|
5358
|
+
...(0, utils_1.moduleVisitor)((source, node) => {
|
|
5359
|
+
reportIfMissing(context, deps, depsOptions, node, source.value);
|
|
5360
|
+
}, { commonjs: true }),
|
|
5361
|
+
"Program:exit"() {
|
|
5362
|
+
depFieldCache.clear();
|
|
5363
|
+
}
|
|
5364
|
+
};
|
|
5168
5365
|
}
|
|
5169
5366
|
});
|
|
5170
5367
|
}
|
|
@@ -5184,13 +5381,13 @@ var require_no_import_module_exports = __commonJS({
|
|
|
5184
5381
|
});
|
|
5185
5382
|
try {
|
|
5186
5383
|
return require.resolve(node_path_1.default.dirname(pkgPath));
|
|
5187
|
-
} catch
|
|
5384
|
+
} catch {
|
|
5188
5385
|
return null;
|
|
5189
5386
|
}
|
|
5190
5387
|
}
|
|
5191
5388
|
function findScope(context, identifier) {
|
|
5192
5389
|
const { scopeManager } = context.sourceCode;
|
|
5193
|
-
return scopeManager
|
|
5390
|
+
return scopeManager?.scopes.slice().reverse().find((scope) => scope.variables.some((variable) => variable.identifiers.some((node) => node.name === identifier)));
|
|
5194
5391
|
}
|
|
5195
5392
|
function findDefinition(objectScope, identifier) {
|
|
5196
5393
|
const variable = objectScope.variables.find((variable2) => variable2.name === identifier);
|
|
@@ -5230,7 +5427,6 @@ var require_no_import_module_exports = __commonJS({
|
|
|
5230
5427
|
importDeclarations.push(node);
|
|
5231
5428
|
},
|
|
5232
5429
|
MemberExpression(node) {
|
|
5233
|
-
var _a;
|
|
5234
5430
|
if (alreadyReported) {
|
|
5235
5431
|
return;
|
|
5236
5432
|
}
|
|
@@ -5243,9 +5439,9 @@ var require_no_import_module_exports = __commonJS({
|
|
|
5243
5439
|
const hasKeywords = /^(module|exports)$/.test(node.object.name);
|
|
5244
5440
|
const objectScope = hasKeywords ? findScope(context, node.object.name) : void 0;
|
|
5245
5441
|
const variableDefinition = objectScope && findDefinition(objectScope, node.object.name);
|
|
5246
|
-
const isImportBinding =
|
|
5442
|
+
const isImportBinding = variableDefinition?.type === "ImportBinding";
|
|
5247
5443
|
const hasCJSExportReference = hasKeywords && (!objectScope || objectScope.type === "module");
|
|
5248
|
-
const isException = !!
|
|
5444
|
+
const isException = !!options.exceptions?.some((glob) => (0, minimatch_1.minimatch)(filename, glob));
|
|
5249
5445
|
if (isIdentifier && hasCJSExportReference && !isEntryPoint && !isException && !isImportBinding) {
|
|
5250
5446
|
for (const importDeclaration of importDeclarations) {
|
|
5251
5447
|
context.report({
|
|
@@ -5470,33 +5666,35 @@ var require_no_named_as_default = __commonJS({
|
|
|
5470
5666
|
},
|
|
5471
5667
|
defaultOptions: [],
|
|
5472
5668
|
create(context) {
|
|
5473
|
-
function
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5669
|
+
function createCheckDefault(nameKey) {
|
|
5670
|
+
return function checkDefault(defaultSpecifier) {
|
|
5671
|
+
const nameValue = defaultSpecifier[nameKey].name;
|
|
5672
|
+
if (nameValue === "default") {
|
|
5673
|
+
return;
|
|
5674
|
+
}
|
|
5675
|
+
const declaration = (0, utils_1.importDeclaration)(context, defaultSpecifier);
|
|
5676
|
+
const exportMapOfImported = utils_1.ExportMap.get(declaration.source.value, context);
|
|
5677
|
+
if (exportMapOfImported == null) {
|
|
5678
|
+
return;
|
|
5679
|
+
}
|
|
5680
|
+
if (exportMapOfImported.errors.length > 0) {
|
|
5681
|
+
exportMapOfImported.reportErrors(context, declaration);
|
|
5682
|
+
return;
|
|
5683
|
+
}
|
|
5684
|
+
if (exportMapOfImported.exports.has("default") && exportMapOfImported.exports.has(nameValue)) {
|
|
5685
|
+
context.report({
|
|
5686
|
+
node: defaultSpecifier,
|
|
5687
|
+
messageId: "default",
|
|
5688
|
+
data: {
|
|
5689
|
+
name: nameValue
|
|
5690
|
+
}
|
|
5691
|
+
});
|
|
5692
|
+
}
|
|
5693
|
+
};
|
|
5496
5694
|
}
|
|
5497
5695
|
return {
|
|
5498
|
-
ImportDefaultSpecifier:
|
|
5499
|
-
ExportDefaultSpecifier:
|
|
5696
|
+
ImportDefaultSpecifier: createCheckDefault("local"),
|
|
5697
|
+
ExportDefaultSpecifier: createCheckDefault("exported")
|
|
5500
5698
|
};
|
|
5501
5699
|
}
|
|
5502
5700
|
});
|
|
@@ -5552,8 +5750,7 @@ var require_no_named_as_default_member = __commonJS({
|
|
|
5552
5750
|
}
|
|
5553
5751
|
},
|
|
5554
5752
|
VariableDeclarator(node) {
|
|
5555
|
-
|
|
5556
|
-
const isDestructure = node.id.type === "ObjectPattern" && ((_a = node.init) === null || _a === void 0 ? void 0 : _a.type) === "Identifier";
|
|
5753
|
+
const isDestructure = node.id.type === "ObjectPattern" && node.init?.type === "Identifier";
|
|
5557
5754
|
if (!isDestructure || !node.init || !("name" in node.init) || !("properties" in node.id)) {
|
|
5558
5755
|
return;
|
|
5559
5756
|
}
|
|
@@ -5758,7 +5955,7 @@ var require_no_namespace = __commonJS({
|
|
|
5758
5955
|
const ignoreGlobs = firstOption.ignore;
|
|
5759
5956
|
return {
|
|
5760
5957
|
ImportNamespaceSpecifier(node) {
|
|
5761
|
-
if (ignoreGlobs
|
|
5958
|
+
if (ignoreGlobs?.find((glob) => (0, minimatch_1.minimatch)(node.parent.source.value, glob, { matchBase: true }))) {
|
|
5762
5959
|
return;
|
|
5763
5960
|
}
|
|
5764
5961
|
const scopeVariables = context.sourceCode.getScope(node).variables;
|
|
@@ -5979,6 +6176,254 @@ var require_no_relative_parent_imports = __commonJS({
|
|
|
5979
6176
|
}
|
|
5980
6177
|
});
|
|
5981
6178
|
|
|
6179
|
+
// node_modules/eslint-plugin-import-x/lib/rules/no-rename-default.js
|
|
6180
|
+
var require_no_rename_default = __commonJS({
|
|
6181
|
+
"node_modules/eslint-plugin-import-x/lib/rules/no-rename-default.js"(exports2, module2) {
|
|
6182
|
+
"use strict";
|
|
6183
|
+
var tslib_12 = require("tslib");
|
|
6184
|
+
var node_path_1 = tslib_12.__importDefault(require("node:path"));
|
|
6185
|
+
var utils_1 = require_utils();
|
|
6186
|
+
function findDefaultDestructure(properties) {
|
|
6187
|
+
const found = properties.find((property) => {
|
|
6188
|
+
if ("key" in property && "name" in property.key && property.key.name === "default") {
|
|
6189
|
+
return property;
|
|
6190
|
+
}
|
|
6191
|
+
});
|
|
6192
|
+
return found;
|
|
6193
|
+
}
|
|
6194
|
+
function getDefaultExportNode(exportMap) {
|
|
6195
|
+
const defaultExportNode = exportMap.exports.get("default");
|
|
6196
|
+
if (defaultExportNode == null) {
|
|
6197
|
+
return;
|
|
6198
|
+
}
|
|
6199
|
+
switch (defaultExportNode.type) {
|
|
6200
|
+
case "ExportDefaultDeclaration": {
|
|
6201
|
+
return defaultExportNode.declaration;
|
|
6202
|
+
}
|
|
6203
|
+
case "ExportNamedDeclaration": {
|
|
6204
|
+
return defaultExportNode.specifiers.find((specifier) => specifier.exported.name === "default");
|
|
6205
|
+
}
|
|
6206
|
+
default: {
|
|
6207
|
+
return;
|
|
6208
|
+
}
|
|
6209
|
+
}
|
|
6210
|
+
}
|
|
6211
|
+
module2.exports = (0, utils_1.createRule)({
|
|
6212
|
+
name: "no-rename-default",
|
|
6213
|
+
meta: {
|
|
6214
|
+
type: "suggestion",
|
|
6215
|
+
docs: {
|
|
6216
|
+
category: "Helpful warnings",
|
|
6217
|
+
description: "Forbid importing a default export by a different name."
|
|
6218
|
+
},
|
|
6219
|
+
schema: [
|
|
6220
|
+
{
|
|
6221
|
+
type: "object",
|
|
6222
|
+
properties: {
|
|
6223
|
+
commonjs: {
|
|
6224
|
+
default: false,
|
|
6225
|
+
type: "boolean"
|
|
6226
|
+
},
|
|
6227
|
+
preventRenamingBindings: {
|
|
6228
|
+
default: true,
|
|
6229
|
+
type: "boolean"
|
|
6230
|
+
}
|
|
6231
|
+
},
|
|
6232
|
+
additionalProperties: false
|
|
6233
|
+
}
|
|
6234
|
+
],
|
|
6235
|
+
messages: {
|
|
6236
|
+
renameDefault: "Caution: `{{importBasename}}` has a default export `{{defaultExportName}}`. This {{requiresOrImports}} `{{defaultExportName}}` as `{{importName}}`. Check if you meant to write `{{suggestion}}` instead."
|
|
6237
|
+
}
|
|
6238
|
+
},
|
|
6239
|
+
defaultOptions: [],
|
|
6240
|
+
create(context) {
|
|
6241
|
+
const { commonjs = false, preventRenamingBindings = true } = context.options[0] || {};
|
|
6242
|
+
function getDefaultExportName(targetNode) {
|
|
6243
|
+
if (targetNode == null) {
|
|
6244
|
+
return;
|
|
6245
|
+
}
|
|
6246
|
+
switch (targetNode.type) {
|
|
6247
|
+
case "AssignmentExpression": {
|
|
6248
|
+
if (!preventRenamingBindings) {
|
|
6249
|
+
return;
|
|
6250
|
+
}
|
|
6251
|
+
if (targetNode.left.type !== "Identifier") {
|
|
6252
|
+
return;
|
|
6253
|
+
}
|
|
6254
|
+
return targetNode.left.name;
|
|
6255
|
+
}
|
|
6256
|
+
case "CallExpression": {
|
|
6257
|
+
const [argumentNode] = targetNode.arguments;
|
|
6258
|
+
return getDefaultExportName(argumentNode);
|
|
6259
|
+
}
|
|
6260
|
+
case "ClassDeclaration": {
|
|
6261
|
+
if (targetNode.id && typeof targetNode.id.name === "string") {
|
|
6262
|
+
return targetNode.id.name;
|
|
6263
|
+
}
|
|
6264
|
+
return;
|
|
6265
|
+
}
|
|
6266
|
+
case "ExportSpecifier": {
|
|
6267
|
+
return targetNode.local.name;
|
|
6268
|
+
}
|
|
6269
|
+
case "FunctionDeclaration": {
|
|
6270
|
+
return targetNode.id?.name;
|
|
6271
|
+
}
|
|
6272
|
+
case "Identifier": {
|
|
6273
|
+
if (!preventRenamingBindings) {
|
|
6274
|
+
return;
|
|
6275
|
+
}
|
|
6276
|
+
return targetNode.name;
|
|
6277
|
+
}
|
|
6278
|
+
default:
|
|
6279
|
+
}
|
|
6280
|
+
}
|
|
6281
|
+
function getExportMap(source) {
|
|
6282
|
+
if (!source) {
|
|
6283
|
+
return;
|
|
6284
|
+
}
|
|
6285
|
+
const exportMap = utils_1.ExportMap.get(source.value, context);
|
|
6286
|
+
if (exportMap == null) {
|
|
6287
|
+
return;
|
|
6288
|
+
}
|
|
6289
|
+
if (exportMap.errors.length > 0) {
|
|
6290
|
+
exportMap.reportErrors(context, { source });
|
|
6291
|
+
return;
|
|
6292
|
+
}
|
|
6293
|
+
return exportMap;
|
|
6294
|
+
}
|
|
6295
|
+
function handleImport(node) {
|
|
6296
|
+
const exportMap = getExportMap(node.parent.source);
|
|
6297
|
+
if (exportMap == null) {
|
|
6298
|
+
return;
|
|
6299
|
+
}
|
|
6300
|
+
const defaultExportNode = getDefaultExportNode(exportMap);
|
|
6301
|
+
if (defaultExportNode == null) {
|
|
6302
|
+
return;
|
|
6303
|
+
}
|
|
6304
|
+
const defaultExportName = getDefaultExportName(defaultExportNode);
|
|
6305
|
+
if (defaultExportName === void 0) {
|
|
6306
|
+
return;
|
|
6307
|
+
}
|
|
6308
|
+
const importTarget = node.parent.source?.value;
|
|
6309
|
+
const importBasename = node_path_1.default.basename(exportMap.path);
|
|
6310
|
+
if (node.type === "ImportDefaultSpecifier") {
|
|
6311
|
+
const importName = node.local.name;
|
|
6312
|
+
if (importName === defaultExportName) {
|
|
6313
|
+
return;
|
|
6314
|
+
}
|
|
6315
|
+
context.report({
|
|
6316
|
+
node,
|
|
6317
|
+
messageId: "renameDefault",
|
|
6318
|
+
data: {
|
|
6319
|
+
importBasename,
|
|
6320
|
+
defaultExportName,
|
|
6321
|
+
importName,
|
|
6322
|
+
requiresOrImports: "imports",
|
|
6323
|
+
suggestion: `import ${defaultExportName} from '${importTarget}'`
|
|
6324
|
+
}
|
|
6325
|
+
});
|
|
6326
|
+
return;
|
|
6327
|
+
}
|
|
6328
|
+
if (node.type !== "ImportSpecifier") {
|
|
6329
|
+
return;
|
|
6330
|
+
}
|
|
6331
|
+
if (node.imported.name !== "default") {
|
|
6332
|
+
return;
|
|
6333
|
+
}
|
|
6334
|
+
const actualImportedName = node.local.name;
|
|
6335
|
+
if (actualImportedName === defaultExportName) {
|
|
6336
|
+
return;
|
|
6337
|
+
}
|
|
6338
|
+
context.report({
|
|
6339
|
+
node,
|
|
6340
|
+
messageId: "renameDefault",
|
|
6341
|
+
data: {
|
|
6342
|
+
importBasename,
|
|
6343
|
+
defaultExportName,
|
|
6344
|
+
importName: actualImportedName,
|
|
6345
|
+
requiresOrImports: "imports",
|
|
6346
|
+
suggestion: `import { default as ${defaultExportName} } from '${importTarget}'`
|
|
6347
|
+
}
|
|
6348
|
+
});
|
|
6349
|
+
}
|
|
6350
|
+
function handleRequire(node) {
|
|
6351
|
+
if (!commonjs || node.type !== "VariableDeclarator" || !node.id || !(node.id.type === "Identifier" || node.id.type === "ObjectPattern") || !node.init || node.init.type !== "CallExpression") {
|
|
6352
|
+
return;
|
|
6353
|
+
}
|
|
6354
|
+
let defaultDestructure;
|
|
6355
|
+
if (node.id.type === "ObjectPattern") {
|
|
6356
|
+
defaultDestructure = findDefaultDestructure(node.id.properties);
|
|
6357
|
+
if (defaultDestructure === void 0) {
|
|
6358
|
+
return;
|
|
6359
|
+
}
|
|
6360
|
+
}
|
|
6361
|
+
const call = node.init;
|
|
6362
|
+
const [source] = call.arguments;
|
|
6363
|
+
if (call.callee.type !== "Identifier" || call.callee.name !== "require" || call.arguments.length !== 1 || source.type !== "Literal" || typeof source.value !== "string") {
|
|
6364
|
+
return;
|
|
6365
|
+
}
|
|
6366
|
+
const exportMap = getExportMap(source);
|
|
6367
|
+
if (exportMap == null) {
|
|
6368
|
+
return;
|
|
6369
|
+
}
|
|
6370
|
+
const defaultExportNode = getDefaultExportNode(exportMap);
|
|
6371
|
+
if (defaultExportNode == null) {
|
|
6372
|
+
return;
|
|
6373
|
+
}
|
|
6374
|
+
const defaultExportName = getDefaultExportName(defaultExportNode);
|
|
6375
|
+
const requireTarget = source.value;
|
|
6376
|
+
const requireBasename = node_path_1.default.basename(exportMap.path);
|
|
6377
|
+
let requireName;
|
|
6378
|
+
if (node.id.type === "Identifier") {
|
|
6379
|
+
requireName = node.id.name;
|
|
6380
|
+
} else if (defaultDestructure?.value?.type === "Identifier") {
|
|
6381
|
+
requireName = defaultDestructure.value.name;
|
|
6382
|
+
} else {
|
|
6383
|
+
requireName = "";
|
|
6384
|
+
}
|
|
6385
|
+
if (defaultExportName === void 0) {
|
|
6386
|
+
return;
|
|
6387
|
+
}
|
|
6388
|
+
if (requireName === defaultExportName) {
|
|
6389
|
+
return;
|
|
6390
|
+
}
|
|
6391
|
+
if (node.id.type === "Identifier") {
|
|
6392
|
+
context.report({
|
|
6393
|
+
node,
|
|
6394
|
+
messageId: "renameDefault",
|
|
6395
|
+
data: {
|
|
6396
|
+
importBasename: requireBasename,
|
|
6397
|
+
defaultExportName,
|
|
6398
|
+
importName: requireName,
|
|
6399
|
+
requiresOrImports: "requires",
|
|
6400
|
+
suggestion: `const ${defaultExportName} = require('${requireTarget}')`
|
|
6401
|
+
}
|
|
6402
|
+
});
|
|
6403
|
+
return;
|
|
6404
|
+
}
|
|
6405
|
+
context.report({
|
|
6406
|
+
node,
|
|
6407
|
+
messageId: "renameDefault",
|
|
6408
|
+
data: {
|
|
6409
|
+
importBasename: requireBasename,
|
|
6410
|
+
defaultExportName,
|
|
6411
|
+
importName: requireName,
|
|
6412
|
+
requiresOrImports: "requires",
|
|
6413
|
+
suggestion: `const { default: ${defaultExportName} } = require('${requireTarget}')`
|
|
6414
|
+
}
|
|
6415
|
+
});
|
|
6416
|
+
}
|
|
6417
|
+
return {
|
|
6418
|
+
ImportDefaultSpecifier: handleImport,
|
|
6419
|
+
ImportSpecifier: handleImport,
|
|
6420
|
+
VariableDeclarator: handleRequire
|
|
6421
|
+
};
|
|
6422
|
+
}
|
|
6423
|
+
});
|
|
6424
|
+
}
|
|
6425
|
+
});
|
|
6426
|
+
|
|
5982
6427
|
// node_modules/eslint-plugin-import-x/lib/rules/no-restricted-paths.js
|
|
5983
6428
|
var require_no_restricted_paths = __commonJS({
|
|
5984
6429
|
"node_modules/eslint-plugin-import-x/lib/rules/no-restricted-paths.js"(exports2, module2) {
|
|
@@ -6394,7 +6839,7 @@ var require_no_unused_modules = __commonJS({
|
|
|
6394
6839
|
});
|
|
6395
6840
|
} else if (id.type === AST_NODE_TYPES.ArrayPattern) {
|
|
6396
6841
|
for (const el of id.elements) {
|
|
6397
|
-
if (
|
|
6842
|
+
if (el?.type === AST_NODE_TYPES.Identifier) {
|
|
6398
6843
|
cb(el.name, false);
|
|
6399
6844
|
}
|
|
6400
6845
|
}
|
|
@@ -6676,7 +7121,6 @@ var require_no_unused_modules = __commonJS({
|
|
|
6676
7121
|
}
|
|
6677
7122
|
const filename = context.physicalFilename;
|
|
6678
7123
|
const checkExportPresence = (node) => {
|
|
6679
|
-
var _a;
|
|
6680
7124
|
if (!missingExports) {
|
|
6681
7125
|
return;
|
|
6682
7126
|
}
|
|
@@ -6693,7 +7137,7 @@ var require_no_unused_modules = __commonJS({
|
|
|
6693
7137
|
exportCount.delete(AST_NODE_TYPES.ImportNamespaceSpecifier);
|
|
6694
7138
|
if (exportCount.size === 0) {
|
|
6695
7139
|
context.report({
|
|
6696
|
-
node:
|
|
7140
|
+
node: node.body[0] ?? node,
|
|
6697
7141
|
messageId: "notFound"
|
|
6698
7142
|
});
|
|
6699
7143
|
}
|
|
@@ -6760,11 +7204,10 @@ var require_no_unused_modules = __commonJS({
|
|
|
6760
7204
|
}
|
|
6761
7205
|
};
|
|
6762
7206
|
const updateExportUsage = (node) => {
|
|
6763
|
-
var _a, _b;
|
|
6764
7207
|
if (ignoredFiles.has(filename)) {
|
|
6765
7208
|
return;
|
|
6766
7209
|
}
|
|
6767
|
-
const exports3 =
|
|
7210
|
+
const exports3 = exportList.get(filename) ?? /* @__PURE__ */ new Map();
|
|
6768
7211
|
const newExports = /* @__PURE__ */ new Map();
|
|
6769
7212
|
const newExportIdentifiers = /* @__PURE__ */ new Set();
|
|
6770
7213
|
for (const s of node.body) {
|
|
@@ -6795,17 +7238,16 @@ var require_no_unused_modules = __commonJS({
|
|
|
6795
7238
|
}
|
|
6796
7239
|
}
|
|
6797
7240
|
const exportAll = exports3.get(AST_NODE_TYPES.ExportAllDeclaration);
|
|
6798
|
-
const namespaceImports =
|
|
7241
|
+
const namespaceImports = exports3.get(AST_NODE_TYPES.ImportNamespaceSpecifier) ?? { whereUsed: /* @__PURE__ */ new Set() };
|
|
6799
7242
|
newExports.set(AST_NODE_TYPES.ExportAllDeclaration, exportAll);
|
|
6800
7243
|
newExports.set(AST_NODE_TYPES.ImportNamespaceSpecifier, namespaceImports);
|
|
6801
7244
|
exportList.set(filename, newExports);
|
|
6802
7245
|
};
|
|
6803
7246
|
const updateImportUsage = (node) => {
|
|
6804
|
-
var _a, _b;
|
|
6805
7247
|
if (!unusedExports) {
|
|
6806
7248
|
return;
|
|
6807
7249
|
}
|
|
6808
|
-
const oldImportPaths =
|
|
7250
|
+
const oldImportPaths = importList.get(filename) ?? /* @__PURE__ */ new Map();
|
|
6809
7251
|
const oldNamespaceImports = /* @__PURE__ */ new Set();
|
|
6810
7252
|
const newNamespaceImports = /* @__PURE__ */ new Set();
|
|
6811
7253
|
const oldExportAll = /* @__PURE__ */ new Set();
|
|
@@ -6891,7 +7333,7 @@ var require_no_unused_modules = __commonJS({
|
|
|
6891
7333
|
}
|
|
6892
7334
|
for (const value of newExportAll) {
|
|
6893
7335
|
if (!oldExportAll.has(value)) {
|
|
6894
|
-
const imports =
|
|
7336
|
+
const imports = oldImportPaths.get(value) ?? /* @__PURE__ */ new Set();
|
|
6895
7337
|
imports.add(AST_NODE_TYPES.ExportAllDeclaration);
|
|
6896
7338
|
oldImportPaths.set(value, imports);
|
|
6897
7339
|
let exports3 = exportList.get(value);
|
|
@@ -7193,8 +7635,7 @@ var require_no_webpack_loader_syntax = __commonJS({
|
|
|
7193
7635
|
defaultOptions: [],
|
|
7194
7636
|
create(context) {
|
|
7195
7637
|
return (0, utils_1.moduleVisitor)((source, node) => {
|
|
7196
|
-
|
|
7197
|
-
if ((_a = source.value) === null || _a === void 0 ? void 0 : _a.includes("!")) {
|
|
7638
|
+
if (source.value?.includes("!")) {
|
|
7198
7639
|
context.report({
|
|
7199
7640
|
node,
|
|
7200
7641
|
messageId: "unexpected",
|
|
@@ -7217,7 +7658,7 @@ var require_order = __commonJS({
|
|
|
7217
7658
|
var utils_1 = require_utils();
|
|
7218
7659
|
var groupBy = (array, grouper) => array.reduce((acc, curr, index) => {
|
|
7219
7660
|
const key = grouper(curr, index);
|
|
7220
|
-
(acc[key]
|
|
7661
|
+
(acc[key] ||= []).push(curr);
|
|
7221
7662
|
return acc;
|
|
7222
7663
|
}, {});
|
|
7223
7664
|
var defaultGroups = [
|
|
@@ -7229,7 +7670,7 @@ var require_order = __commonJS({
|
|
|
7229
7670
|
];
|
|
7230
7671
|
function reverse(array) {
|
|
7231
7672
|
return array.map(function(v) {
|
|
7232
|
-
return
|
|
7673
|
+
return { ...v, rank: -v.rank };
|
|
7233
7674
|
}).reverse();
|
|
7234
7675
|
}
|
|
7235
7676
|
function getTokensOrCommentsAfter(sourceCode, node, count) {
|
|
@@ -7526,16 +7967,15 @@ var require_order = __commonJS({
|
|
|
7526
7967
|
function registerNode(context, importEntry, ranks, imported, excludedImportTypes) {
|
|
7527
7968
|
const rank = computeRank(context, ranks, importEntry, excludedImportTypes);
|
|
7528
7969
|
if (rank !== -1) {
|
|
7529
|
-
imported.push(
|
|
7970
|
+
imported.push({ ...importEntry, rank });
|
|
7530
7971
|
}
|
|
7531
7972
|
}
|
|
7532
7973
|
function getRequireBlock(node) {
|
|
7533
|
-
var _a, _b, _c;
|
|
7534
7974
|
let n = node;
|
|
7535
7975
|
while (n.parent && (n.parent.type === "MemberExpression" && n.parent.object === n || n.parent.type === "CallExpression" && n.parent.callee === n)) {
|
|
7536
7976
|
n = n.parent;
|
|
7537
7977
|
}
|
|
7538
|
-
if (
|
|
7978
|
+
if (n.parent?.type === "VariableDeclarator" && n.parent.parent?.type === "VariableDeclaration" && n.parent.parent.parent?.type === "Program") {
|
|
7539
7979
|
return n.parent.parent.parent;
|
|
7540
7980
|
}
|
|
7541
7981
|
}
|
|
@@ -7589,7 +8029,7 @@ var require_order = __commonJS({
|
|
|
7589
8029
|
}
|
|
7590
8030
|
before[group].push(index);
|
|
7591
8031
|
}
|
|
7592
|
-
return
|
|
8032
|
+
return { ...pathGroup, position };
|
|
7593
8033
|
});
|
|
7594
8034
|
let maxPosition = 1;
|
|
7595
8035
|
for (const group of Object.keys(before)) {
|
|
@@ -7910,11 +8350,11 @@ var require_prefer_default_export = __commonJS({
|
|
|
7910
8350
|
let namedExportNode;
|
|
7911
8351
|
const { target = "single" } = context.options[0] || {};
|
|
7912
8352
|
function captureDeclaration(identifierOrPattern) {
|
|
7913
|
-
if (
|
|
8353
|
+
if (identifierOrPattern?.type === "ObjectPattern") {
|
|
7914
8354
|
for (const property of identifierOrPattern.properties) {
|
|
7915
8355
|
captureDeclaration(property.value);
|
|
7916
8356
|
}
|
|
7917
|
-
} else if (
|
|
8357
|
+
} else if (identifierOrPattern?.type === "ArrayPattern") {
|
|
7918
8358
|
for (const el of identifierOrPattern.elements) {
|
|
7919
8359
|
captureDeclaration(el);
|
|
7920
8360
|
}
|
|
@@ -8021,14 +8461,23 @@ var require_unambiguous2 = __commonJS({
|
|
|
8021
8461
|
|
|
8022
8462
|
// node_modules/eslint-plugin-import-x/lib/index.js
|
|
8023
8463
|
var tslib_1 = require("tslib");
|
|
8464
|
+
var package_json_1 = require_package();
|
|
8024
8465
|
var electron_1 = tslib_1.__importDefault(require_electron());
|
|
8025
8466
|
var errors_1 = tslib_1.__importDefault(require_errors());
|
|
8467
|
+
var electron_2 = tslib_1.__importDefault(require_electron2());
|
|
8468
|
+
var errors_2 = tslib_1.__importDefault(require_errors2());
|
|
8026
8469
|
var react_1 = tslib_1.__importDefault(require_react());
|
|
8027
8470
|
var react_native_1 = tslib_1.__importDefault(require_react_native());
|
|
8028
8471
|
var recommended_1 = tslib_1.__importDefault(require_recommended());
|
|
8029
8472
|
var stage_0_1 = tslib_1.__importDefault(require_stage_0());
|
|
8030
8473
|
var typescript_1 = tslib_1.__importDefault(require_typescript());
|
|
8031
8474
|
var warnings_1 = tslib_1.__importDefault(require_warnings());
|
|
8475
|
+
var react_2 = tslib_1.__importDefault(require_react2());
|
|
8476
|
+
var react_native_2 = tslib_1.__importDefault(require_react_native2());
|
|
8477
|
+
var recommended_2 = tslib_1.__importDefault(require_recommended2());
|
|
8478
|
+
var stage_0_2 = tslib_1.__importDefault(require_stage_02());
|
|
8479
|
+
var typescript_2 = tslib_1.__importDefault(require_typescript2());
|
|
8480
|
+
var warnings_2 = tslib_1.__importDefault(require_warnings2());
|
|
8032
8481
|
var consistent_type_specifier_style_1 = tslib_1.__importDefault(require_consistent_type_specifier_style());
|
|
8033
8482
|
var default_1 = tslib_1.__importDefault(require_default());
|
|
8034
8483
|
var dynamic_import_chunkname_1 = tslib_1.__importDefault(require_dynamic_import_chunkname());
|
|
@@ -8064,6 +8513,7 @@ var no_namespace_1 = tslib_1.__importDefault(require_no_namespace());
|
|
|
8064
8513
|
var no_nodejs_modules_1 = tslib_1.__importDefault(require_no_nodejs_modules());
|
|
8065
8514
|
var no_relative_packages_1 = tslib_1.__importDefault(require_no_relative_packages());
|
|
8066
8515
|
var no_relative_parent_imports_1 = tslib_1.__importDefault(require_no_relative_parent_imports());
|
|
8516
|
+
var no_rename_default_1 = tslib_1.__importDefault(require_no_rename_default());
|
|
8067
8517
|
var no_restricted_paths_1 = tslib_1.__importDefault(require_no_restricted_paths());
|
|
8068
8518
|
var no_self_import_1 = tslib_1.__importDefault(require_no_self_import());
|
|
8069
8519
|
var no_unassigned_import_1 = tslib_1.__importDefault(require_no_unassigned_import());
|
|
@@ -8074,16 +8524,6 @@ var no_webpack_loader_syntax_1 = tslib_1.__importDefault(require_no_webpack_load
|
|
|
8074
8524
|
var order_1 = tslib_1.__importDefault(require_order());
|
|
8075
8525
|
var prefer_default_export_1 = tslib_1.__importDefault(require_prefer_default_export());
|
|
8076
8526
|
var unambiguous_1 = tslib_1.__importDefault(require_unambiguous2());
|
|
8077
|
-
var configs = {
|
|
8078
|
-
recommended: recommended_1.default,
|
|
8079
|
-
errors: errors_1.default,
|
|
8080
|
-
warnings: warnings_1.default,
|
|
8081
|
-
"stage-0": stage_0_1.default,
|
|
8082
|
-
react: react_1.default,
|
|
8083
|
-
"react-native": react_native_1.default,
|
|
8084
|
-
electron: electron_1.default,
|
|
8085
|
-
typescript: typescript_1.default
|
|
8086
|
-
};
|
|
8087
8527
|
var rules = {
|
|
8088
8528
|
"no-unresolved": no_unresolved_1.default,
|
|
8089
8529
|
named: named_1.default,
|
|
@@ -8105,6 +8545,7 @@ var rules = {
|
|
|
8105
8545
|
"no-named-as-default": no_named_as_default_1.default,
|
|
8106
8546
|
"no-named-as-default-member": no_named_as_default_member_1.default,
|
|
8107
8547
|
"no-anonymous-default-export": no_anonymous_default_export_1.default,
|
|
8548
|
+
"no-rename-default": no_rename_default_1.default,
|
|
8108
8549
|
"no-unused-modules": no_unused_modules_1.default,
|
|
8109
8550
|
"no-commonjs": no_commonjs_1.default,
|
|
8110
8551
|
"no-amd": no_amd_1.default,
|
|
@@ -8131,7 +8572,37 @@ var rules = {
|
|
|
8131
8572
|
"no-deprecated": no_deprecated_1.default,
|
|
8132
8573
|
"imports-first": imports_first_1.default
|
|
8133
8574
|
};
|
|
8575
|
+
var configs = {
|
|
8576
|
+
recommended: recommended_2.default,
|
|
8577
|
+
errors: errors_1.default,
|
|
8578
|
+
warnings: warnings_2.default,
|
|
8579
|
+
"stage-0": stage_0_2.default,
|
|
8580
|
+
react: react_2.default,
|
|
8581
|
+
"react-native": react_native_2.default,
|
|
8582
|
+
electron: electron_1.default,
|
|
8583
|
+
typescript: typescript_2.default
|
|
8584
|
+
};
|
|
8585
|
+
var plugin = {
|
|
8586
|
+
meta: { name: package_json_1.name, version: package_json_1.version },
|
|
8587
|
+
rules
|
|
8588
|
+
};
|
|
8589
|
+
var createFlatConfig = (baseConfig, configName) => ({
|
|
8590
|
+
...baseConfig,
|
|
8591
|
+
name: `import-x/${configName}`,
|
|
8592
|
+
plugins: { "import-x": plugin }
|
|
8593
|
+
});
|
|
8594
|
+
var flatConfigs = {
|
|
8595
|
+
recommended: createFlatConfig(recommended_1.default, "recommended"),
|
|
8596
|
+
errors: createFlatConfig(errors_2.default, "errors"),
|
|
8597
|
+
warnings: createFlatConfig(warnings_1.default, "warnings"),
|
|
8598
|
+
"stage-0": createFlatConfig(stage_0_1.default, "stage-0"),
|
|
8599
|
+
react: react_1.default,
|
|
8600
|
+
"react-native": react_native_1.default,
|
|
8601
|
+
electron: electron_2.default,
|
|
8602
|
+
typescript: typescript_1.default
|
|
8603
|
+
};
|
|
8134
8604
|
module.exports = {
|
|
8135
8605
|
configs,
|
|
8606
|
+
flatConfigs,
|
|
8136
8607
|
rules
|
|
8137
8608
|
};
|