@storm-software/eslint 0.170.155 → 0.170.157

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.
Files changed (103) hide show
  1. package/README.md +1 -1
  2. package/dist/astro-CKzo6xci.d.mts +5 -0
  3. package/dist/banner-YnHf4ewf.d.mts +5 -0
  4. package/dist/bun-OJPLvfnX.d.mts +5 -0
  5. package/dist/cspell-CfGd6g7m.d.mts +8 -0
  6. package/dist/disables-Dx5b56Fi.d.mts +5 -0
  7. package/dist/find-workspace-root-D3UHWbgn.mjs +211 -0
  8. package/dist/formatters-VU6Zu_ju.d.mts +5 -0
  9. package/dist/graphql-ClFinA5J.d.mts +5 -0
  10. package/dist/helpers-mce_MNwt.mjs +72 -0
  11. package/dist/ignores-CPeru9Fz.d.mts +5 -0
  12. package/dist/imports-CQToT7JW.d.mts +5 -0
  13. package/dist/index.d.mts +41 -0
  14. package/dist/index.mjs +42 -0
  15. package/dist/javascript-BR8uv0Wr.d.mts +5 -0
  16. package/dist/jsdoc-Dy8bHykP.d.mts +5 -0
  17. package/dist/jsonc-YqDXTIOi.d.mts +5 -0
  18. package/dist/jsx-DzqEJSYd.d.mts +5 -0
  19. package/dist/markdown-C5lFEI83.d.mts +5 -0
  20. package/dist/mdx-CDEhveb1.d.mts +5 -0
  21. package/dist/next-DGhspeMc.d.mts +8 -0
  22. package/dist/node-CQgsZ8nv.d.mts +5 -0
  23. package/dist/nx-CLRc6QRM.d.mts +8 -0
  24. package/dist/perfectionist-CgSgqAjV.d.mts +10 -0
  25. package/dist/plugins-CZWNS7l4.mjs +8291 -0
  26. package/dist/plugins.d.mts +616 -0
  27. package/dist/plugins.mjs +2 -0
  28. package/dist/pnpm-Cp9VzsCv.d.mts +5 -0
  29. package/dist/preset-x6MId9-7.mjs +265 -0
  30. package/dist/preset.d.mts +30 -0
  31. package/dist/preset.mjs +3 -0
  32. package/dist/prettier-CboafVRp.d.mts +8 -0
  33. package/dist/react-C5HWHYPh.d.mts +5 -0
  34. package/dist/react-native-DjQo3PXB.d.mts +8 -0
  35. package/dist/regexp-D2Fm6vg7.d.mts +5 -0
  36. package/dist/rolldown-runtime-CMFfr-1z.mjs +26 -0
  37. package/dist/secrets-DfvPNLCF.d.mts +10 -0
  38. package/dist/sort-9_xeGmal.d.mts +16 -0
  39. package/dist/storybook-DqDJ5exI.d.mts +5 -0
  40. package/dist/stylistic-9jDGqsHH.d.mts +9 -0
  41. package/dist/test-Dw-h86ig.d.mts +5 -0
  42. package/dist/toml-ConAZLXy.d.mts +5 -0
  43. package/dist/tsdoc-DcYWMVl0.d.mts +5 -0
  44. package/dist/{types.d.ts → typegen.d.mts} +8536 -11156
  45. package/dist/types-XIthLTox.d.mts +852 -0
  46. package/dist/types.d.mts +3 -0
  47. package/dist/types.mjs +2 -0
  48. package/dist/typescript-BFiiMXDt.d.mts +5 -0
  49. package/dist/unicorn-CQ3PTdfT.d.mts +5 -0
  50. package/dist/unocss-Uw-vEvNU.d.mts +5 -0
  51. package/dist/yaml-Ddbh49WY.d.mts +5 -0
  52. package/dist/zod-7F7dUsU5.d.mts +8 -0
  53. package/package.json +58 -79
  54. package/dist/chunk-2TYJ2VM7.js +0 -46
  55. package/dist/chunk-F7ZJ6N35.js +0 -43
  56. package/dist/chunk-I4ZWVHOG.js +0 -220
  57. package/dist/chunk-JBIA43L4.js +0 -75
  58. package/dist/chunk-T6GDWDAB.js +0 -167
  59. package/dist/chunk-XFFMMX6A.js +0 -96
  60. package/dist/chunk-XSM4AYON.js +0 -19822
  61. package/dist/chunk-Y5JY2DPL.js +0 -19
  62. package/dist/index.cjs +0 -21965
  63. package/dist/index.d.cts +0 -127
  64. package/dist/index.d.ts +0 -127
  65. package/dist/index.js +0 -15
  66. package/dist/preset.cjs +0 -21922
  67. package/dist/preset.d.cts +0 -34
  68. package/dist/preset.d.ts +0 -34
  69. package/dist/preset.js +0 -8
  70. package/dist/src-TAWYAYRW.js +0 -887
  71. package/dist/src-XRFRLUCW.js +0 -57
  72. package/dist/src-YPCQHGJY.js +0 -91
  73. package/dist/types.cjs +0 -2
  74. package/dist/types.d.cts +0 -19537
  75. package/dist/types.js +0 -4
  76. package/dist/utils/combine.cjs +0 -9
  77. package/dist/utils/combine.d.cts +0 -14
  78. package/dist/utils/combine.d.ts +0 -14
  79. package/dist/utils/combine.js +0 -10
  80. package/dist/utils/correct-paths.cjs +0 -232
  81. package/dist/utils/correct-paths.d.cts +0 -30
  82. package/dist/utils/correct-paths.d.ts +0 -30
  83. package/dist/utils/correct-paths.js +0 -2
  84. package/dist/utils/find-workspace-root.cjs +0 -201
  85. package/dist/utils/find-workspace-root.d.cts +0 -16
  86. package/dist/utils/find-workspace-root.d.ts +0 -16
  87. package/dist/utils/find-workspace-root.js +0 -3
  88. package/dist/utils/format-config.cjs +0 -20
  89. package/dist/utils/format-config.d.cts +0 -5
  90. package/dist/utils/format-config.d.ts +0 -5
  91. package/dist/utils/format-config.js +0 -21
  92. package/dist/utils/helpers.cjs +0 -87
  93. package/dist/utils/helpers.d.cts +0 -55
  94. package/dist/utils/helpers.d.ts +0 -55
  95. package/dist/utils/helpers.js +0 -2
  96. package/dist/utils/package-manager.cjs +0 -199
  97. package/dist/utils/package-manager.d.cts +0 -8
  98. package/dist/utils/package-manager.d.ts +0 -8
  99. package/dist/utils/package-manager.js +0 -4
  100. package/dist/utils/tsconfig.cjs +0 -297
  101. package/dist/utils/tsconfig.d.cts +0 -25
  102. package/dist/utils/tsconfig.d.ts +0 -25
  103. package/dist/utils/tsconfig.js +0 -4
@@ -1,297 +0,0 @@
1
- 'use strict';
2
-
3
- var fs = require('fs');
4
- var path = require('path');
5
-
6
- // src/utils/tsconfig.ts
7
-
8
- // src/utils/correct-paths.ts
9
- var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
10
- function normalizeWindowsPath(input = "") {
11
- if (!input) {
12
- return input;
13
- }
14
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
15
- }
16
- var _UNC_REGEX = /^[/\\]{2}/;
17
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
18
- var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
19
- var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
20
- var correctPaths = function(path) {
21
- if (!path || path.length === 0) {
22
- return ".";
23
- }
24
- path = normalizeWindowsPath(path);
25
- const isUNCPath = path.match(_UNC_REGEX);
26
- const isPathAbsolute = isAbsolute(path);
27
- const trailingSeparator = path[path.length - 1] === "/";
28
- path = normalizeString(path, !isPathAbsolute);
29
- if (path.length === 0) {
30
- if (isPathAbsolute) {
31
- return "/";
32
- }
33
- return trailingSeparator ? "./" : ".";
34
- }
35
- if (trailingSeparator) {
36
- path += "/";
37
- }
38
- if (_DRIVE_LETTER_RE.test(path)) {
39
- path += "/";
40
- }
41
- if (isUNCPath) {
42
- if (!isPathAbsolute) {
43
- return `//./${path}`;
44
- }
45
- return `//${path}`;
46
- }
47
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
48
- };
49
- var joinPaths = function(...segments) {
50
- let path = "";
51
- for (const seg of segments) {
52
- if (!seg) {
53
- continue;
54
- }
55
- if (path.length > 0) {
56
- const pathTrailing = path[path.length - 1] === "/";
57
- const segLeading = seg[0] === "/";
58
- const both = pathTrailing && segLeading;
59
- if (both) {
60
- path += seg.slice(1);
61
- } else {
62
- path += pathTrailing || segLeading ? seg : `/${seg}`;
63
- }
64
- } else {
65
- path += seg;
66
- }
67
- }
68
- return correctPaths(path);
69
- };
70
- function cwd() {
71
- if (typeof process !== "undefined" && typeof process.cwd === "function") {
72
- return process.cwd().replace(/\\/g, "/");
73
- }
74
- return "/";
75
- }
76
- var resolve = function(...arguments_) {
77
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
78
- let resolvedPath = "";
79
- let resolvedAbsolute = false;
80
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
81
- const path = index >= 0 ? arguments_[index] : cwd();
82
- if (!path || path.length === 0) {
83
- continue;
84
- }
85
- resolvedPath = `${path}/${resolvedPath}`;
86
- resolvedAbsolute = isAbsolute(path);
87
- }
88
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
89
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
90
- return `/${resolvedPath}`;
91
- }
92
- return resolvedPath.length > 0 ? resolvedPath : ".";
93
- };
94
- function normalizeString(path, allowAboveRoot) {
95
- let res = "";
96
- let lastSegmentLength = 0;
97
- let lastSlash = -1;
98
- let dots = 0;
99
- let char = null;
100
- for (let index = 0; index <= path.length; ++index) {
101
- if (index < path.length) {
102
- char = path[index];
103
- } else if (char === "/") {
104
- break;
105
- } else {
106
- char = "/";
107
- }
108
- if (char === "/") {
109
- if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
110
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
111
- if (res.length > 2) {
112
- const lastSlashIndex = res.lastIndexOf("/");
113
- if (lastSlashIndex === -1) {
114
- res = "";
115
- lastSegmentLength = 0;
116
- } else {
117
- res = res.slice(0, lastSlashIndex);
118
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
119
- }
120
- lastSlash = index;
121
- dots = 0;
122
- continue;
123
- } else if (res.length > 0) {
124
- res = "";
125
- lastSegmentLength = 0;
126
- lastSlash = index;
127
- dots = 0;
128
- continue;
129
- }
130
- }
131
- if (allowAboveRoot) {
132
- res += res.length > 0 ? "/.." : "..";
133
- lastSegmentLength = 2;
134
- }
135
- } else {
136
- if (res.length > 0) {
137
- res += `/${path.slice(lastSlash + 1, index)}`;
138
- } else {
139
- res = path.slice(lastSlash + 1, index);
140
- }
141
- lastSegmentLength = index - lastSlash - 1;
142
- }
143
- lastSlash = index;
144
- dots = 0;
145
- } else if (char === "." && dots !== -1) {
146
- ++dots;
147
- } else {
148
- dots = -1;
149
- }
150
- }
151
- return res;
152
- }
153
- var isAbsolute = function(p) {
154
- return _IS_ABSOLUTE_RE.test(p);
155
- };
156
- var relative = function(from, to) {
157
- const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
158
- const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
159
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
160
- return _to.join("/");
161
- }
162
- const _fromCopy = [..._from];
163
- for (const segment of _fromCopy) {
164
- if (_to[0] !== segment) {
165
- break;
166
- }
167
- _from.shift();
168
- _to.shift();
169
- }
170
- return [..._from.map(() => ".."), ..._to].join("/");
171
- };
172
- var MAX_PATH_SEARCH_DEPTH = 30;
173
- var depth = 0;
174
- function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
175
- const _startPath = startPath ?? process.cwd();
176
- if (endDirectoryNames.some(
177
- (endDirName) => fs.existsSync(path.join(_startPath, endDirName))
178
- )) {
179
- return _startPath;
180
- }
181
- if (endFileNames.some((endFileName) => fs.existsSync(path.join(_startPath, endFileName)))) {
182
- return _startPath;
183
- }
184
- if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
185
- const parent = path.join(_startPath, "..");
186
- return findFolderUp(parent, endFileNames, endDirectoryNames);
187
- }
188
- return void 0;
189
- }
190
- var rootFiles = [
191
- "storm-workspace.json",
192
- "storm-workspace.json",
193
- "storm-workspace.yaml",
194
- "storm-workspace.yml",
195
- "storm-workspace.js",
196
- "storm-workspace.ts",
197
- ".storm-workspace.json",
198
- ".storm-workspace.yaml",
199
- ".storm-workspace.yml",
200
- ".storm-workspace.js",
201
- ".storm-workspace.ts",
202
- "lerna.json",
203
- "nx.json",
204
- "turbo.json",
205
- "npm-workspace.json",
206
- "yarn-workspace.json",
207
- "pnpm-workspace.json",
208
- "npm-workspace.yaml",
209
- "yarn-workspace.yaml",
210
- "pnpm-workspace.yaml",
211
- "npm-workspace.yml",
212
- "yarn-workspace.yml",
213
- "pnpm-workspace.yml",
214
- "npm-lock.json",
215
- "yarn-lock.json",
216
- "pnpm-lock.json",
217
- "npm-lock.yaml",
218
- "yarn-lock.yaml",
219
- "pnpm-lock.yaml",
220
- "npm-lock.yml",
221
- "yarn-lock.yml",
222
- "pnpm-lock.yml",
223
- "bun.lockb"
224
- ];
225
- var rootDirectories = [
226
- ".storm-workspace",
227
- ".nx",
228
- ".github",
229
- ".vscode",
230
- ".verdaccio"
231
- ];
232
- function findWorkspaceRootSafe(pathInsideMonorepo) {
233
- if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
234
- return correctPaths(
235
- process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH
236
- );
237
- }
238
- return correctPaths(
239
- findFolderUp(
240
- process.cwd(),
241
- rootFiles,
242
- rootDirectories
243
- )
244
- );
245
- }
246
- function findWorkspaceRoot(pathInsideMonorepo) {
247
- const result = findWorkspaceRootSafe();
248
- if (!result) {
249
- throw new Error(
250
- `Cannot find workspace root upwards from known path. Files search list includes:
251
- ${rootFiles.join(
252
- "\n"
253
- )}
254
- Path: ${process.cwd()}`
255
- );
256
- }
257
- return result;
258
- }
259
-
260
- // src/utils/tsconfig.ts
261
- function getTsConfigPath(tsconfigPath, type) {
262
- const workspaceRoot = findWorkspaceRoot();
263
- if (tsconfigPath && fs.existsSync(tsconfigPath) && fs.statSync(tsconfigPath).isFile()) {
264
- return relative(workspaceRoot, tsconfigPath);
265
- }
266
- let result = checkTsConfigPath(process.cwd());
267
- if (result) {
268
- return relative(workspaceRoot, joinPaths(process.cwd(), result));
269
- }
270
- result = checkTsConfigPath(workspaceRoot);
271
- if (result) {
272
- return relative(workspaceRoot, joinPaths(workspaceRoot, result));
273
- }
274
- console.warn(
275
- `No tsconfig.json found${tsconfigPath ? ` provided: ${tsconfigPath}` : ""}. Consider adding a tsconfig.json file to your project's ESLint configuration.`
276
- );
277
- return workspaceRoot?.replace(/\\/g, "/").replaceAll(/\/$/g, "") === process.cwd().replace(/\\/g, "/").replaceAll(/\/$/g, "") ? "tsconfig.base.json" : type ? `tsconfig.${type}.json` : "tsconfig.json";
278
- }
279
- function checkTsConfigPath(root) {
280
- if (fs.existsSync(joinPaths(root, "tsconfig.json"))) {
281
- return "tsconfig.json";
282
- } else if (fs.existsSync(joinPaths(root, "tsconfig.base.json"))) {
283
- return "tsconfig.base.json";
284
- } else if (fs.existsSync(joinPaths(root, "tsconfig.app.json"))) {
285
- return "tsconfig.app.json";
286
- } else if (fs.existsSync(joinPaths(root, "tsconfig.lib.json"))) {
287
- return "tsconfig.lib.json";
288
- } else if (fs.existsSync(joinPaths(root, "tsconfig.eslint.json"))) {
289
- return "tsconfig.eslint.json";
290
- } else if (fs.existsSync(joinPaths(root, "tsconfig.lint.json"))) {
291
- return "tsconfig.lint.json";
292
- }
293
- return void 0;
294
- }
295
-
296
- exports.checkTsConfigPath = checkTsConfigPath;
297
- exports.getTsConfigPath = getTsConfigPath;
@@ -1,25 +0,0 @@
1
- /**
2
- * Gets the path to the nearest tsconfig file by walking up from start path.
3
- *
4
- * The search order is as follows:
5
- * 1. If `tsconfigPath` is provided and exists, it will be used.
6
- * 2. If a tsconfig file is found in the current working directory, it will be used.
7
- * 3. If a tsconfig file is found in the workspace root, it will be used.
8
- * 4. If no tsconfig file is found, a warning will be logged and a default path will be returned based on the project type (app or lib).
9
- *
10
- * The function checks for the following tsconfig file names in order:
11
- * - tsconfig.json
12
- * - tsconfig.base.json
13
- * - tsconfig.app.json
14
- * - tsconfig.lib.json
15
- * - tsconfig.eslint.json
16
- * - tsconfig.lint.json
17
- *
18
- * @param tsconfigPath Optional path to a tsconfig file. If provided, it will be used if it exists.
19
- * @param type The type of project (app or lib) to determine the default tsconfig file name if no tsconfig file is found. Default is "app".
20
- * @returns The path to the nearest tsconfig file relative to the workspace root.
21
- */
22
- declare function getTsConfigPath(tsconfigPath?: string, type?: "app" | "lib"): string;
23
- declare function checkTsConfigPath(root: string): string | undefined;
24
-
25
- export { checkTsConfigPath, getTsConfigPath };
@@ -1,25 +0,0 @@
1
- /**
2
- * Gets the path to the nearest tsconfig file by walking up from start path.
3
- *
4
- * The search order is as follows:
5
- * 1. If `tsconfigPath` is provided and exists, it will be used.
6
- * 2. If a tsconfig file is found in the current working directory, it will be used.
7
- * 3. If a tsconfig file is found in the workspace root, it will be used.
8
- * 4. If no tsconfig file is found, a warning will be logged and a default path will be returned based on the project type (app or lib).
9
- *
10
- * The function checks for the following tsconfig file names in order:
11
- * - tsconfig.json
12
- * - tsconfig.base.json
13
- * - tsconfig.app.json
14
- * - tsconfig.lib.json
15
- * - tsconfig.eslint.json
16
- * - tsconfig.lint.json
17
- *
18
- * @param tsconfigPath Optional path to a tsconfig file. If provided, it will be used if it exists.
19
- * @param type The type of project (app or lib) to determine the default tsconfig file name if no tsconfig file is found. Default is "app".
20
- * @returns The path to the nearest tsconfig file relative to the workspace root.
21
- */
22
- declare function getTsConfigPath(tsconfigPath?: string, type?: "app" | "lib"): string;
23
- declare function checkTsConfigPath(root: string): string | undefined;
24
-
25
- export { checkTsConfigPath, getTsConfigPath };
@@ -1,4 +0,0 @@
1
- export { checkTsConfigPath, getTsConfigPath } from '../chunk-F7ZJ6N35.js';
2
- import '../chunk-XFFMMX6A.js';
3
- import '../chunk-I4ZWVHOG.js';
4
- import '../chunk-2TYJ2VM7.js';