@storm-software/eslint 0.170.157 → 0.170.159
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/README.md +1 -1
- package/dist/{plugins-CZWNS7l4.mjs → index.cjs} +4613 -205
- package/dist/{typegen.d.mts → index.d.cts} +1027 -1
- package/dist/index.d.mts +17942 -40
- package/dist/index.mjs +12628 -38
- package/package.json +14 -57
- package/dist/astro-CKzo6xci.d.mts +0 -5
- package/dist/banner-YnHf4ewf.d.mts +0 -5
- package/dist/bun-OJPLvfnX.d.mts +0 -5
- package/dist/cspell-CfGd6g7m.d.mts +0 -8
- package/dist/disables-Dx5b56Fi.d.mts +0 -5
- package/dist/find-workspace-root-D3UHWbgn.mjs +0 -211
- package/dist/formatters-VU6Zu_ju.d.mts +0 -5
- package/dist/graphql-ClFinA5J.d.mts +0 -5
- package/dist/helpers-mce_MNwt.mjs +0 -72
- package/dist/ignores-CPeru9Fz.d.mts +0 -5
- package/dist/imports-CQToT7JW.d.mts +0 -5
- package/dist/javascript-BR8uv0Wr.d.mts +0 -5
- package/dist/jsdoc-Dy8bHykP.d.mts +0 -5
- package/dist/jsonc-YqDXTIOi.d.mts +0 -5
- package/dist/jsx-DzqEJSYd.d.mts +0 -5
- package/dist/markdown-C5lFEI83.d.mts +0 -5
- package/dist/mdx-CDEhveb1.d.mts +0 -5
- package/dist/next-DGhspeMc.d.mts +0 -8
- package/dist/node-CQgsZ8nv.d.mts +0 -5
- package/dist/nx-CLRc6QRM.d.mts +0 -8
- package/dist/perfectionist-CgSgqAjV.d.mts +0 -10
- package/dist/plugins.d.mts +0 -616
- package/dist/plugins.mjs +0 -2
- package/dist/pnpm-Cp9VzsCv.d.mts +0 -5
- package/dist/preset-x6MId9-7.mjs +0 -265
- package/dist/preset.d.mts +0 -30
- package/dist/preset.mjs +0 -3
- package/dist/prettier-CboafVRp.d.mts +0 -8
- package/dist/react-C5HWHYPh.d.mts +0 -5
- package/dist/react-native-DjQo3PXB.d.mts +0 -8
- package/dist/regexp-D2Fm6vg7.d.mts +0 -5
- package/dist/rolldown-runtime-CMFfr-1z.mjs +0 -26
- package/dist/secrets-DfvPNLCF.d.mts +0 -10
- package/dist/sort-9_xeGmal.d.mts +0 -16
- package/dist/storybook-DqDJ5exI.d.mts +0 -5
- package/dist/stylistic-9jDGqsHH.d.mts +0 -9
- package/dist/test-Dw-h86ig.d.mts +0 -5
- package/dist/toml-ConAZLXy.d.mts +0 -5
- package/dist/tsdoc-DcYWMVl0.d.mts +0 -5
- package/dist/types-XIthLTox.d.mts +0 -852
- package/dist/types.d.mts +0 -3
- package/dist/types.mjs +0 -2
- package/dist/typescript-BFiiMXDt.d.mts +0 -5
- package/dist/unicorn-CQ3PTdfT.d.mts +0 -5
- package/dist/unocss-Uw-vEvNU.d.mts +0 -5
- package/dist/yaml-Ddbh49WY.d.mts +0 -5
- package/dist/zod-7F7dUsU5.d.mts +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/eslint",
|
|
3
|
-
"version": "0.170.
|
|
3
|
+
"version": "0.170.159",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing the base ESLint configuration used by Storm Software across many projects.",
|
|
6
6
|
"keywords": [
|
|
@@ -51,55 +51,12 @@
|
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"type": "module",
|
|
53
53
|
"exports": {
|
|
54
|
-
".": "./dist/index.mjs",
|
|
55
|
-
"./configs": "./dist/configs/index.mjs",
|
|
56
|
-
"./configs/astro": "./dist/configs/astro.mjs",
|
|
57
|
-
"./configs/banner": "./dist/configs/banner.mjs",
|
|
58
|
-
"./configs/bun": "./dist/configs/bun.mjs",
|
|
59
|
-
"./configs/cspell": "./dist/configs/cspell.mjs",
|
|
60
|
-
"./configs/disables": "./dist/configs/disables.mjs",
|
|
61
|
-
"./configs/formatters": "./dist/configs/formatters.mjs",
|
|
62
|
-
"./configs/graphql": "./dist/configs/graphql.mjs",
|
|
63
|
-
"./configs/ignores": "./dist/configs/ignores.mjs",
|
|
64
|
-
"./configs/imports": "./dist/configs/imports.mjs",
|
|
65
|
-
"./configs/javascript": "./dist/configs/javascript.mjs",
|
|
66
|
-
"./configs/jsdoc": "./dist/configs/jsdoc.mjs",
|
|
67
|
-
"./configs/jsonc": "./dist/configs/jsonc.mjs",
|
|
68
|
-
"./configs/jsx": "./dist/configs/jsx.mjs",
|
|
69
|
-
"./configs/markdown": "./dist/configs/markdown.mjs",
|
|
70
|
-
"./configs/mdx": "./dist/configs/mdx.mjs",
|
|
71
|
-
"./configs/next": "./dist/configs/next.mjs",
|
|
72
|
-
"./configs/node": "./dist/configs/node.mjs",
|
|
73
|
-
"./configs/nx": "./dist/configs/nx.mjs",
|
|
74
|
-
"./configs/perfectionist": "./dist/configs/perfectionist.mjs",
|
|
75
|
-
"./configs/pnpm": "./dist/configs/pnpm.mjs",
|
|
76
|
-
"./configs/prettier": "./dist/configs/prettier.mjs",
|
|
77
|
-
"./configs/react": "./dist/configs/react.mjs",
|
|
78
|
-
"./configs/react-native": "./dist/configs/react-native.mjs",
|
|
79
|
-
"./configs/regexp": "./dist/configs/regexp.mjs",
|
|
80
|
-
"./configs/secrets": "./dist/configs/secrets.mjs",
|
|
81
|
-
"./configs/sort": "./dist/configs/sort.mjs",
|
|
82
|
-
"./configs/storybook": "./dist/configs/storybook.mjs",
|
|
83
|
-
"./configs/stylistic": "./dist/configs/stylistic.mjs",
|
|
84
|
-
"./configs/test": "./dist/configs/test.mjs",
|
|
85
|
-
"./configs/toml": "./dist/configs/toml.mjs",
|
|
86
|
-
"./configs/tsdoc": "./dist/configs/tsdoc.mjs",
|
|
87
|
-
"./configs/typescript": "./dist/configs/typescript.mjs",
|
|
88
|
-
"./configs/unicorn": "./dist/configs/unicorn.mjs",
|
|
89
|
-
"./configs/unocss": "./dist/configs/unocss.mjs",
|
|
90
|
-
"./configs/yaml": "./dist/configs/yaml.mjs",
|
|
91
|
-
"./configs/zod": "./dist/configs/zod.mjs",
|
|
92
|
-
"./find-workspace-root-D3UHWbgn": "./dist/find-workspace-root-D3UHWbgn.mjs",
|
|
93
|
-
"./helpers-mce_MNwt": "./dist/helpers-mce_MNwt.mjs",
|
|
94
|
-
"./plugins": "./dist/plugins.mjs",
|
|
95
|
-
"./plugins-CZWNS7l4": "./dist/plugins-CZWNS7l4.mjs",
|
|
96
|
-
"./preset": "./dist/preset.mjs",
|
|
97
|
-
"./preset-x6MId9-7": "./dist/preset-x6MId9-7.mjs",
|
|
98
|
-
"./rolldown-runtime-CMFfr-1z": "./dist/rolldown-runtime-CMFfr-1z.mjs",
|
|
99
|
-
"./types": "./dist/types.mjs",
|
|
54
|
+
".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" },
|
|
100
55
|
"./*": "./*"
|
|
101
56
|
},
|
|
102
|
-
"
|
|
57
|
+
"main": "./dist/index.cjs",
|
|
58
|
+
"module": "./dist/index.mjs",
|
|
59
|
+
"types": "./dist/index.d.cts",
|
|
103
60
|
"files": ["dist"],
|
|
104
61
|
"dependencies": {
|
|
105
62
|
"@antfu/install-pkg": "^1.1.0",
|
|
@@ -108,11 +65,11 @@
|
|
|
108
65
|
"@eslint/eslintrc": "^3.3.6",
|
|
109
66
|
"@eslint/markdown": "^6.6.0",
|
|
110
67
|
"@nx/eslint-plugin": "23.1.1",
|
|
111
|
-
"@storm-software/config": "1.138.
|
|
112
|
-
"@storm-software/config-tools": "1.190.
|
|
113
|
-
"@storm-software/eslint-plugin-banner": "0.0.
|
|
114
|
-
"@storm-software/eslint-plugin-tsdoc": "0.0.
|
|
115
|
-
"@storm-software/package-constants": "0.1.
|
|
68
|
+
"@storm-software/config": "1.138.62",
|
|
69
|
+
"@storm-software/config-tools": "1.190.125",
|
|
70
|
+
"@storm-software/eslint-plugin-banner": "0.0.90",
|
|
71
|
+
"@storm-software/eslint-plugin-tsdoc": "0.0.88",
|
|
72
|
+
"@storm-software/package-constants": "0.1.138",
|
|
116
73
|
"@stylistic/eslint-plugin": "^4.4.1",
|
|
117
74
|
"@typescript-eslint/eslint-plugin": "^8.66.0",
|
|
118
75
|
"@typescript-eslint/parser": "^8.66.0",
|
|
@@ -168,9 +125,9 @@
|
|
|
168
125
|
"@next/eslint-plugin-next": "^15.5.23",
|
|
169
126
|
"@nx/eslint": "23.1.1",
|
|
170
127
|
"@prettier/plugin-xml": "^3.4.2",
|
|
171
|
-
"@storm-software/eslint-plugin-bun": "0.0.
|
|
172
|
-
"@storm-software/eslint-plugin-pnpm": "0.0.
|
|
173
|
-
"@storm-software/tsdoc": "0.13.
|
|
128
|
+
"@storm-software/eslint-plugin-bun": "0.0.13",
|
|
129
|
+
"@storm-software/eslint-plugin-pnpm": "0.0.88",
|
|
130
|
+
"@storm-software/tsdoc": "0.13.278",
|
|
174
131
|
"@stylistic/eslint-plugin-migrate": "^4.4.1",
|
|
175
132
|
"@types/eslint": "^9.6.1",
|
|
176
133
|
"@types/eslint__js": "^8.42.3",
|
|
@@ -268,5 +225,5 @@
|
|
|
268
225
|
"zod": { "optional": true }
|
|
269
226
|
},
|
|
270
227
|
"publishConfig": { "access": "public" },
|
|
271
|
-
"gitHead": "
|
|
228
|
+
"gitHead": "eff7293196b0e8829eccb25c5ac924c979588ef2"
|
|
272
229
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { I as TypedFlatConfigItem, T as OptionsStylistic, c as OptionsFiles, y as OptionsOverrides } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/astro.d.ts
|
|
3
|
-
declare function astro(options?: OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { astro as t };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { I as TypedFlatConfigItem, f as OptionsIsInEditor, r as OptionsBanner, y as OptionsOverrides } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/banner.d.ts
|
|
3
|
-
declare function banner(options?: Partial<OptionsBanner> & OptionsIsInEditor & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { banner as t };
|
package/dist/bun-OJPLvfnX.d.mts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { I as TypedFlatConfigItem, a as OptionsCSpell } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/cspell.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Config for CSpell spell checking
|
|
5
|
-
*/
|
|
6
|
-
declare function cspell(options?: OptionsCSpell): Promise<TypedFlatConfigItem[]>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { cspell as t };
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
//#region src/utils/correct-paths.ts
|
|
4
|
-
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
5
|
-
function normalizeWindowsPath(input = "") {
|
|
6
|
-
if (!input) return input;
|
|
7
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
8
|
-
}
|
|
9
|
-
const _UNC_REGEX = /^[/\\]{2}/;
|
|
10
|
-
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
11
|
-
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
12
|
-
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
13
|
-
const correctPaths = function(path) {
|
|
14
|
-
if (!path || path.length === 0) return ".";
|
|
15
|
-
path = normalizeWindowsPath(path);
|
|
16
|
-
const isUNCPath = path.match(_UNC_REGEX);
|
|
17
|
-
const isPathAbsolute = isAbsolute(path);
|
|
18
|
-
const trailingSeparator = path[path.length - 1] === "/";
|
|
19
|
-
path = normalizeString(path, !isPathAbsolute);
|
|
20
|
-
if (path.length === 0) {
|
|
21
|
-
if (isPathAbsolute) return "/";
|
|
22
|
-
return trailingSeparator ? "./" : ".";
|
|
23
|
-
}
|
|
24
|
-
if (trailingSeparator) path += "/";
|
|
25
|
-
if (_DRIVE_LETTER_RE.test(path)) path += "/";
|
|
26
|
-
if (isUNCPath) {
|
|
27
|
-
if (!isPathAbsolute) return `//./${path}`;
|
|
28
|
-
return `//${path}`;
|
|
29
|
-
}
|
|
30
|
-
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
31
|
-
};
|
|
32
|
-
const joinPaths = function(...segments) {
|
|
33
|
-
let path = "";
|
|
34
|
-
for (const seg of segments) {
|
|
35
|
-
if (!seg) continue;
|
|
36
|
-
if (path.length > 0) {
|
|
37
|
-
const pathTrailing = path[path.length - 1] === "/";
|
|
38
|
-
const segLeading = seg[0] === "/";
|
|
39
|
-
if (pathTrailing && segLeading) path += seg.slice(1);
|
|
40
|
-
else path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
41
|
-
} else path += seg;
|
|
42
|
-
}
|
|
43
|
-
return correctPaths(path);
|
|
44
|
-
};
|
|
45
|
-
function cwd() {
|
|
46
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
47
|
-
return "/";
|
|
48
|
-
}
|
|
49
|
-
const resolve = function(...arguments_) {
|
|
50
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
51
|
-
let resolvedPath = "";
|
|
52
|
-
let resolvedAbsolute = false;
|
|
53
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
54
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
55
|
-
if (!path || path.length === 0) continue;
|
|
56
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
57
|
-
resolvedAbsolute = isAbsolute(path);
|
|
58
|
-
}
|
|
59
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
60
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
61
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
|
|
65
|
-
*
|
|
66
|
-
* @param path - The path to normalise.
|
|
67
|
-
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
|
|
68
|
-
* @returns the normalised path string.
|
|
69
|
-
*/
|
|
70
|
-
function normalizeString(path, allowAboveRoot) {
|
|
71
|
-
let res = "";
|
|
72
|
-
let lastSegmentLength = 0;
|
|
73
|
-
let lastSlash = -1;
|
|
74
|
-
let dots = 0;
|
|
75
|
-
let char = null;
|
|
76
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
77
|
-
if (index < path.length) char = path[index];
|
|
78
|
-
else if (char === "/") break;
|
|
79
|
-
else char = "/";
|
|
80
|
-
if (char === "/") {
|
|
81
|
-
if (lastSlash === index - 1 || dots === 1) {} else if (dots === 2) {
|
|
82
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
83
|
-
if (res.length > 2) {
|
|
84
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
85
|
-
if (lastSlashIndex === -1) {
|
|
86
|
-
res = "";
|
|
87
|
-
lastSegmentLength = 0;
|
|
88
|
-
} else {
|
|
89
|
-
res = res.slice(0, lastSlashIndex);
|
|
90
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
91
|
-
}
|
|
92
|
-
lastSlash = index;
|
|
93
|
-
dots = 0;
|
|
94
|
-
continue;
|
|
95
|
-
} else if (res.length > 0) {
|
|
96
|
-
res = "";
|
|
97
|
-
lastSegmentLength = 0;
|
|
98
|
-
lastSlash = index;
|
|
99
|
-
dots = 0;
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (allowAboveRoot) {
|
|
104
|
-
res += res.length > 0 ? "/.." : "..";
|
|
105
|
-
lastSegmentLength = 2;
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
109
|
-
else res = path.slice(lastSlash + 1, index);
|
|
110
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
111
|
-
}
|
|
112
|
-
lastSlash = index;
|
|
113
|
-
dots = 0;
|
|
114
|
-
} else if (char === "." && dots !== -1) ++dots;
|
|
115
|
-
else dots = -1;
|
|
116
|
-
}
|
|
117
|
-
return res;
|
|
118
|
-
}
|
|
119
|
-
const isAbsolute = function(p) {
|
|
120
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
121
|
-
};
|
|
122
|
-
const relative = function(from, to) {
|
|
123
|
-
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
124
|
-
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
125
|
-
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) return _to.join("/");
|
|
126
|
-
const _fromCopy = [..._from];
|
|
127
|
-
for (const segment of _fromCopy) {
|
|
128
|
-
if (_to[0] !== segment) break;
|
|
129
|
-
_from.shift();
|
|
130
|
-
_to.shift();
|
|
131
|
-
}
|
|
132
|
-
return [..._from.map(() => ".."), ..._to].join("/");
|
|
133
|
-
};
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/utils/find-workspace-root.ts
|
|
136
|
-
const MAX_PATH_SEARCH_DEPTH = 30;
|
|
137
|
-
let depth = 0;
|
|
138
|
-
/**
|
|
139
|
-
* Gets the nearest "node_modules" folder by walking up from start path.
|
|
140
|
-
*/
|
|
141
|
-
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
142
|
-
const _startPath = startPath ?? process.cwd();
|
|
143
|
-
if (endDirectoryNames.some((endDirName) => existsSync(join(_startPath, endDirName)))) return _startPath;
|
|
144
|
-
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) return _startPath;
|
|
145
|
-
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) return findFolderUp(join(_startPath, ".."), endFileNames, endDirectoryNames);
|
|
146
|
-
}
|
|
147
|
-
const rootFiles = [
|
|
148
|
-
"storm-workspace.json",
|
|
149
|
-
"storm-workspace.json",
|
|
150
|
-
"storm-workspace.yaml",
|
|
151
|
-
"storm-workspace.yml",
|
|
152
|
-
"storm-workspace.js",
|
|
153
|
-
"storm-workspace.ts",
|
|
154
|
-
".storm-workspace.json",
|
|
155
|
-
".storm-workspace.yaml",
|
|
156
|
-
".storm-workspace.yml",
|
|
157
|
-
".storm-workspace.js",
|
|
158
|
-
".storm-workspace.ts",
|
|
159
|
-
"lerna.json",
|
|
160
|
-
"nx.json",
|
|
161
|
-
"turbo.json",
|
|
162
|
-
"npm-workspace.json",
|
|
163
|
-
"yarn-workspace.json",
|
|
164
|
-
"pnpm-workspace.json",
|
|
165
|
-
"npm-workspace.yaml",
|
|
166
|
-
"yarn-workspace.yaml",
|
|
167
|
-
"pnpm-workspace.yaml",
|
|
168
|
-
"npm-workspace.yml",
|
|
169
|
-
"yarn-workspace.yml",
|
|
170
|
-
"pnpm-workspace.yml",
|
|
171
|
-
"npm-lock.json",
|
|
172
|
-
"yarn-lock.json",
|
|
173
|
-
"pnpm-lock.json",
|
|
174
|
-
"npm-lock.yaml",
|
|
175
|
-
"yarn-lock.yaml",
|
|
176
|
-
"pnpm-lock.yaml",
|
|
177
|
-
"npm-lock.yml",
|
|
178
|
-
"yarn-lock.yml",
|
|
179
|
-
"pnpm-lock.yml",
|
|
180
|
-
"bun.lockb"
|
|
181
|
-
];
|
|
182
|
-
const rootDirectories = [
|
|
183
|
-
".storm-workspace",
|
|
184
|
-
".nx",
|
|
185
|
-
".github",
|
|
186
|
-
".vscode",
|
|
187
|
-
".verdaccio"
|
|
188
|
-
];
|
|
189
|
-
/**
|
|
190
|
-
* Find the monorepo root directory, searching upwards from `path`.
|
|
191
|
-
*
|
|
192
|
-
* @param pathInsideMonorepo - The path inside the monorepo to start searching from
|
|
193
|
-
* @returns The monorepo root directory
|
|
194
|
-
*/
|
|
195
|
-
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
196
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
|
|
197
|
-
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Find the monorepo root directory, searching upwards from `path`.
|
|
201
|
-
*
|
|
202
|
-
* @param pathInsideMonorepo - The path inside the monorepo to start searching from
|
|
203
|
-
* @returns The monorepo root directory
|
|
204
|
-
*/
|
|
205
|
-
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
206
|
-
const result = findWorkspaceRootSafe(pathInsideMonorepo);
|
|
207
|
-
if (!result) throw new Error(`Cannot find workspace root upwards from known path. Files search list includes: \n${rootFiles.join("\n")}\nPath: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`);
|
|
208
|
-
return result;
|
|
209
|
-
}
|
|
210
|
-
//#endregion
|
|
211
|
-
export { relative as i, findWorkspaceRootSafe as n, joinPaths as r, findWorkspaceRoot as t };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { F as StylisticConfig, I as TypedFlatConfigItem, l as OptionsFormatters } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/formatters.d.ts
|
|
3
|
-
declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { formatters as t };
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { isPackageExists } from "local-pkg";
|
|
2
|
-
import process from "node:process";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
//#region src/utils/helpers.ts
|
|
5
|
-
const scopeUrl = fileURLToPath(new URL(".", import.meta.url));
|
|
6
|
-
const isCwdInScope = isPackageExists("@storm-software/eslint");
|
|
7
|
-
const parserPlain = {
|
|
8
|
-
meta: { name: "parser-plain" },
|
|
9
|
-
parseForESLint: (code) => ({
|
|
10
|
-
ast: {
|
|
11
|
-
body: [],
|
|
12
|
-
comments: [],
|
|
13
|
-
loc: {
|
|
14
|
-
end: code.length,
|
|
15
|
-
start: 0
|
|
16
|
-
},
|
|
17
|
-
range: [0, code.length],
|
|
18
|
-
tokens: [],
|
|
19
|
-
type: "Program"
|
|
20
|
-
},
|
|
21
|
-
scopeManager: null,
|
|
22
|
-
services: { isPlain: true },
|
|
23
|
-
visitorKeys: { Program: [] }
|
|
24
|
-
})
|
|
25
|
-
};
|
|
26
|
-
function isInGitHooksOrLintStaged() {
|
|
27
|
-
return !!(process.env.GIT_PARAMS || process.env.VSCODE_GIT_COMMAND || process.env.npm_lifecycle_script?.startsWith("lint-staged") || process.env.npm_lifecycle_script?.startsWith("lefthook") || process.env.npm_lifecycle_script === "push");
|
|
28
|
-
}
|
|
29
|
-
function isInEditorEnv() {
|
|
30
|
-
if (process.env.CI) return false;
|
|
31
|
-
if (isInGitHooksOrLintStaged()) return false;
|
|
32
|
-
return !!(process.env.VSCODE_PID || process.env.VSCODE_CWD || process.env.JETBRAINS_IDE || process.env.VIM || process.env.NVIM);
|
|
33
|
-
}
|
|
34
|
-
async function interopDefault(m) {
|
|
35
|
-
const resolved = await m;
|
|
36
|
-
return resolved.default || resolved;
|
|
37
|
-
}
|
|
38
|
-
function isPackageInScope(name) {
|
|
39
|
-
return isPackageExists(name, { paths: [scopeUrl] });
|
|
40
|
-
}
|
|
41
|
-
async function ensurePackages(packages) {
|
|
42
|
-
if (process.env.CI || process.stdout.isTTY === false || isCwdInScope === false) return;
|
|
43
|
-
const nonExistingPackages = packages.filter((i) => i && !isPackageInScope(i));
|
|
44
|
-
if (nonExistingPackages.length === 0) return;
|
|
45
|
-
if (await (await import("@clack/prompts")).confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` })) await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Rename plugin prefixes in a rule object.
|
|
49
|
-
* Accepts a map of prefixes to rename.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* import { renameRules } from '@storm-software/eslint'
|
|
54
|
-
*
|
|
55
|
-
* export default [{
|
|
56
|
-
* rules: renameRules(
|
|
57
|
-
* {
|
|
58
|
-
* '@typescript-eslint/indent': 'error'
|
|
59
|
-
* },
|
|
60
|
-
* { '@typescript-eslint': 'ts' }
|
|
61
|
-
* )
|
|
62
|
-
* }]
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
function renameRules(rules, map) {
|
|
66
|
-
return Object.fromEntries(Object.entries(rules).map(([key, value]) => {
|
|
67
|
-
for (const [from, to] of Object.entries(map)) if (key.startsWith(`${from}/`)) return [to + key.slice(from.length), value];
|
|
68
|
-
return [key, value];
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
export { parserPlain as a, isPackageInScope as i, interopDefault as n, renameRules as o, isInEditorEnv as r, ensurePackages as t };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { I as TypedFlatConfigItem, f as OptionsIsInEditor, m as OptionsJavascript, y as OptionsOverrides } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/javascript.d.ts
|
|
3
|
-
declare function javascript(options?: Partial<OptionsJavascript> & OptionsIsInEditor & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { javascript as t };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { I as TypedFlatConfigItem, T as OptionsStylistic, c as OptionsFiles, y as OptionsOverrides } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/jsonc.d.ts
|
|
3
|
-
declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { jsonc as t };
|
package/dist/jsx-DzqEJSYd.d.mts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { I as TypedFlatConfigItem, c as OptionsFiles, o as OptionsComponentExts, y as OptionsOverrides } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/markdown.d.ts
|
|
3
|
-
declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { markdown as t };
|
package/dist/mdx-CDEhveb1.d.mts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { I as TypedFlatConfigItem, c as OptionsFiles, o as OptionsComponentExts, y as OptionsOverrides } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/mdx.d.ts
|
|
3
|
-
declare function mdx(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { mdx as t };
|
package/dist/next-DGhspeMc.d.mts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { I as TypedFlatConfigItem, h as OptionsNext } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/next.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Config for Next.js projects.
|
|
5
|
-
*/
|
|
6
|
-
declare function next(options?: OptionsNext): Promise<TypedFlatConfigItem[]>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { next as t };
|
package/dist/node-CQgsZ8nv.d.mts
DELETED
package/dist/nx-CLRc6QRM.d.mts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { I as TypedFlatConfigItem } from "./types-XIthLTox.mjs";
|
|
2
|
-
//#region src/configs/perfectionist.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* Perfectionist plugin for props and items sorting.
|
|
5
|
-
*
|
|
6
|
-
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
7
|
-
*/
|
|
8
|
-
declare function perfectionist(): Promise<TypedFlatConfigItem[]>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { perfectionist as t };
|