@storm-software/eslint 0.170.156 → 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.
- package/README.md +1 -1
- package/dist/astro-CKzo6xci.d.mts +5 -0
- package/dist/banner-YnHf4ewf.d.mts +5 -0
- package/dist/bun-OJPLvfnX.d.mts +5 -0
- package/dist/cspell-CfGd6g7m.d.mts +8 -0
- package/dist/disables-Dx5b56Fi.d.mts +5 -0
- package/dist/find-workspace-root-D3UHWbgn.mjs +211 -0
- package/dist/formatters-VU6Zu_ju.d.mts +5 -0
- package/dist/graphql-ClFinA5J.d.mts +5 -0
- package/dist/helpers-mce_MNwt.mjs +72 -0
- package/dist/ignores-CPeru9Fz.d.mts +5 -0
- package/dist/imports-CQToT7JW.d.mts +5 -0
- package/dist/index.d.mts +41 -0
- package/dist/index.mjs +42 -0
- package/dist/javascript-BR8uv0Wr.d.mts +5 -0
- package/dist/jsdoc-Dy8bHykP.d.mts +5 -0
- package/dist/jsonc-YqDXTIOi.d.mts +5 -0
- package/dist/jsx-DzqEJSYd.d.mts +5 -0
- package/dist/markdown-C5lFEI83.d.mts +5 -0
- package/dist/mdx-CDEhveb1.d.mts +5 -0
- package/dist/next-DGhspeMc.d.mts +8 -0
- package/dist/node-CQgsZ8nv.d.mts +5 -0
- package/dist/nx-CLRc6QRM.d.mts +8 -0
- package/dist/perfectionist-CgSgqAjV.d.mts +10 -0
- package/dist/plugins-CZWNS7l4.mjs +8291 -0
- package/dist/plugins.d.mts +616 -0
- package/dist/plugins.mjs +2 -0
- package/dist/pnpm-Cp9VzsCv.d.mts +5 -0
- package/dist/preset-x6MId9-7.mjs +265 -0
- package/dist/preset.d.mts +30 -0
- package/dist/preset.mjs +3 -0
- package/dist/prettier-CboafVRp.d.mts +8 -0
- package/dist/react-C5HWHYPh.d.mts +5 -0
- package/dist/react-native-DjQo3PXB.d.mts +8 -0
- package/dist/regexp-D2Fm6vg7.d.mts +5 -0
- package/dist/rolldown-runtime-CMFfr-1z.mjs +26 -0
- package/dist/secrets-DfvPNLCF.d.mts +10 -0
- package/dist/sort-9_xeGmal.d.mts +16 -0
- package/dist/storybook-DqDJ5exI.d.mts +5 -0
- package/dist/stylistic-9jDGqsHH.d.mts +9 -0
- package/dist/test-Dw-h86ig.d.mts +5 -0
- package/dist/toml-ConAZLXy.d.mts +5 -0
- package/dist/tsdoc-DcYWMVl0.d.mts +5 -0
- package/dist/{types.d.cts → typegen.d.mts} +8536 -11156
- package/dist/types-XIthLTox.d.mts +852 -0
- package/dist/types.d.mts +3 -0
- package/dist/types.mjs +2 -0
- package/dist/typescript-BFiiMXDt.d.mts +5 -0
- package/dist/unicorn-CQ3PTdfT.d.mts +5 -0
- package/dist/unocss-Uw-vEvNU.d.mts +5 -0
- package/dist/yaml-Ddbh49WY.d.mts +5 -0
- package/dist/zod-7F7dUsU5.d.mts +8 -0
- package/package.json +58 -79
- package/dist/index.cjs +0 -24
- package/dist/index.d.cts +0 -127
- package/dist/index.d.ts +0 -127
- package/dist/index.js +0 -7
- package/dist/preset.cjs +0 -354
- package/dist/preset.d.cts +0 -34
- package/dist/preset.d.ts +0 -34
- package/dist/preset.js +0 -344
- package/dist/types.cjs +0 -12
- package/dist/types.d.ts +0 -19537
- package/dist/types.js +0 -1
- package/dist/utils/combine.cjs +0 -8
- package/dist/utils/combine.d.cts +0 -14
- package/dist/utils/combine.d.ts +0 -14
- package/dist/utils/combine.js +0 -6
- package/dist/utils/correct-paths.cjs +0 -231
- package/dist/utils/correct-paths.d.cts +0 -30
- package/dist/utils/correct-paths.d.ts +0 -30
- package/dist/utils/correct-paths.js +0 -216
- package/dist/utils/find-workspace-root.cjs +0 -96
- package/dist/utils/find-workspace-root.d.cts +0 -16
- package/dist/utils/find-workspace-root.d.ts +0 -16
- package/dist/utils/find-workspace-root.js +0 -93
- package/dist/utils/format-config.cjs +0 -19
- package/dist/utils/format-config.d.cts +0 -5
- package/dist/utils/format-config.d.ts +0 -5
- package/dist/utils/format-config.js +0 -17
- package/dist/utils/helpers.cjs +0 -86
- package/dist/utils/helpers.d.cts +0 -55
- package/dist/utils/helpers.d.ts +0 -55
- package/dist/utils/helpers.js +0 -72
- package/dist/utils/package-manager.cjs +0 -18
- package/dist/utils/package-manager.d.cts +0 -8
- package/dist/utils/package-manager.d.ts +0 -8
- package/dist/utils/package-manager.js +0 -16
- package/dist/utils/tsconfig.cjs +0 -43
- package/dist/utils/tsconfig.d.cts +0 -25
- package/dist/utils/tsconfig.d.ts +0 -25
- package/dist/utils/tsconfig.js +0 -40
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -0,0 +1,5 @@
|
|
|
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 };
|
|
@@ -0,0 +1,5 @@
|
|
|
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 };
|
|
@@ -0,0 +1,8 @@
|
|
|
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 };
|
|
@@ -0,0 +1,211 @@
|
|
|
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 };
|
|
@@ -0,0 +1,5 @@
|
|
|
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 };
|
|
@@ -0,0 +1,72 @@
|
|
|
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 };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ConfigNames, RuleOptions } from "./typegen.mjs";
|
|
2
|
+
import { A as OptionsUnicorn, C as OptionsRegExp, D as OptionsTypeScriptParserOptions, E as OptionsTSDoc, F as StylisticConfig, I as TypedFlatConfigItem, L as UserConfig, M as PresetConfig, N as PresetResult, O as OptionsTypeScriptWithTypes, P as Rules, S as OptionsReact, T as OptionsStylistic, _ as OptionsNxDependencyChecks, a as OptionsCSpell, b as OptionsPnpm, c as OptionsFiles, d as OptionsHasTypeScript, f as OptionsIsInEditor, g as OptionsNx, h as OptionsNext, i as OptionsBun, j as OptionsUnoCSS, k as OptionsTypescript, l as OptionsFormatters, m as OptionsJavascript, n as ESLintGlobalsPropValue, o as OptionsComponentExts, p as OptionsJSDoc, r as OptionsBanner, s as OptionsConfig, t as Awaitable, u as OptionsGraphQL, v as OptionsNxEnforceModuleBoundaries, w as OptionsStorybook, x as OptionsProjectType, y as OptionsOverrides } from "./types-XIthLTox.mjs";
|
|
3
|
+
import { t as astro } from "./astro-CKzo6xci.mjs";
|
|
4
|
+
import { t as banner } from "./banner-YnHf4ewf.mjs";
|
|
5
|
+
import { t as bun } from "./bun-OJPLvfnX.mjs";
|
|
6
|
+
import { t as cspell } from "./cspell-CfGd6g7m.mjs";
|
|
7
|
+
import { t as disables } from "./disables-Dx5b56Fi.mjs";
|
|
8
|
+
import { t as formatters } from "./formatters-VU6Zu_ju.mjs";
|
|
9
|
+
import { t as graphql } from "./graphql-ClFinA5J.mjs";
|
|
10
|
+
import { t as ignores } from "./ignores-CPeru9Fz.mjs";
|
|
11
|
+
import { t as imports } from "./imports-CQToT7JW.mjs";
|
|
12
|
+
import { t as javascript } from "./javascript-BR8uv0Wr.mjs";
|
|
13
|
+
import { t as jsdoc } from "./jsdoc-Dy8bHykP.mjs";
|
|
14
|
+
import { t as jsonc } from "./jsonc-YqDXTIOi.mjs";
|
|
15
|
+
import { t as jsx } from "./jsx-DzqEJSYd.mjs";
|
|
16
|
+
import { t as markdown } from "./markdown-C5lFEI83.mjs";
|
|
17
|
+
import { t as mdx } from "./mdx-CDEhveb1.mjs";
|
|
18
|
+
import { t as next } from "./next-DGhspeMc.mjs";
|
|
19
|
+
import { t as node } from "./node-CQgsZ8nv.mjs";
|
|
20
|
+
import { t as nx } from "./nx-CLRc6QRM.mjs";
|
|
21
|
+
import { t as perfectionist } from "./perfectionist-CgSgqAjV.mjs";
|
|
22
|
+
import { t as pnpm } from "./pnpm-Cp9VzsCv.mjs";
|
|
23
|
+
import { t as prettier } from "./prettier-CboafVRp.mjs";
|
|
24
|
+
import { t as react } from "./react-C5HWHYPh.mjs";
|
|
25
|
+
import { t as reactNative } from "./react-native-DjQo3PXB.mjs";
|
|
26
|
+
import { t as regexp } from "./regexp-D2Fm6vg7.mjs";
|
|
27
|
+
import { t as secrets } from "./secrets-DfvPNLCF.mjs";
|
|
28
|
+
import { n as sortTsconfig, t as sortPackageJson } from "./sort-9_xeGmal.mjs";
|
|
29
|
+
import { t as storybook } from "./storybook-DqDJ5exI.mjs";
|
|
30
|
+
import { n as StylisticOptions, r as stylistic, t as StylisticConfigDefaults } from "./stylistic-9jDGqsHH.mjs";
|
|
31
|
+
import { t as test } from "./test-Dw-h86ig.mjs";
|
|
32
|
+
import { t as toml } from "./toml-ConAZLXy.mjs";
|
|
33
|
+
import { t as tsdoc } from "./tsdoc-DcYWMVl0.mjs";
|
|
34
|
+
import { t as typescript } from "./typescript-BFiiMXDt.mjs";
|
|
35
|
+
import { t as unicorn } from "./unicorn-CQ3PTdfT.mjs";
|
|
36
|
+
import { t as unocss } from "./unocss-Uw-vEvNU.mjs";
|
|
37
|
+
import { t as yaml } from "./yaml-Ddbh49WY.mjs";
|
|
38
|
+
import { t as zod } from "./zod-7F7dUsU5.mjs";
|
|
39
|
+
import "./configs/index.mjs";
|
|
40
|
+
import preset, { ResolvedOptions, defaultPluginRenaming, defineConfig, getConfig, getOverrides, resolveSubOptions } from "./preset.mjs";
|
|
41
|
+
export { type Awaitable, type ConfigNames, type ESLintGlobalsPropValue, type OptionsBanner, type OptionsBun, type OptionsCSpell, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsGraphQL, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsJSDoc, type OptionsJavascript, type OptionsNext, type OptionsNx, type OptionsNxDependencyChecks, type OptionsNxEnforceModuleBoundaries, type OptionsOverrides, type OptionsPnpm, type OptionsProjectType, type OptionsReact, type OptionsRegExp, type OptionsStorybook, type OptionsStylistic, type OptionsTSDoc, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnicorn, type OptionsUnoCSS, type PresetConfig, type PresetResult, ResolvedOptions, type RuleOptions, type Rules, type StylisticConfig, StylisticConfigDefaults, StylisticOptions, type TypedFlatConfigItem, type UserConfig, astro, banner, bun, cspell, defineConfig as default, defineConfig, defaultPluginRenaming, disables, formatters, getConfig, getOverrides, graphql, ignores, imports, javascript, jsdoc, jsonc, jsx, markdown, mdx, next, node, nx, perfectionist, pnpm, preset, prettier, react, reactNative, regexp, resolveSubOptions, secrets, sortPackageJson, sortTsconfig, storybook, stylistic, test, toml, tsdoc, typescript, unicorn, unocss, yaml, zod };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { astro } from "./configs/astro.mjs";
|
|
2
|
+
import { banner } from "./configs/banner.mjs";
|
|
3
|
+
import { bun } from "./configs/bun.mjs";
|
|
4
|
+
import { cspell } from "./configs/cspell.mjs";
|
|
5
|
+
import { disables } from "./configs/disables.mjs";
|
|
6
|
+
import { StylisticConfigDefaults, stylistic } from "./configs/stylistic.mjs";
|
|
7
|
+
import { formatters } from "./configs/formatters.mjs";
|
|
8
|
+
import { graphql } from "./configs/graphql.mjs";
|
|
9
|
+
import { ignores } from "./configs/ignores.mjs";
|
|
10
|
+
import { imports } from "./configs/imports.mjs";
|
|
11
|
+
import { javascript } from "./configs/javascript.mjs";
|
|
12
|
+
import { jsdoc } from "./configs/jsdoc.mjs";
|
|
13
|
+
import { jsonc } from "./configs/jsonc.mjs";
|
|
14
|
+
import { jsx } from "./configs/jsx.mjs";
|
|
15
|
+
import { markdown } from "./configs/markdown.mjs";
|
|
16
|
+
import { mdx } from "./configs/mdx.mjs";
|
|
17
|
+
import { next } from "./configs/next.mjs";
|
|
18
|
+
import { node } from "./configs/node.mjs";
|
|
19
|
+
import { nx } from "./configs/nx.mjs";
|
|
20
|
+
import { perfectionist } from "./configs/perfectionist.mjs";
|
|
21
|
+
import { pnpm } from "./configs/pnpm.mjs";
|
|
22
|
+
import { prettier } from "./configs/prettier.mjs";
|
|
23
|
+
import { react } from "./configs/react.mjs";
|
|
24
|
+
import { reactNative } from "./configs/react-native.mjs";
|
|
25
|
+
import { regexp } from "./configs/regexp.mjs";
|
|
26
|
+
import { secrets } from "./configs/secrets.mjs";
|
|
27
|
+
import { sortPackageJson, sortTsconfig } from "./configs/sort.mjs";
|
|
28
|
+
import { storybook } from "./configs/storybook.mjs";
|
|
29
|
+
import { test } from "./configs/test.mjs";
|
|
30
|
+
import { toml } from "./configs/toml.mjs";
|
|
31
|
+
import { tsdoc } from "./configs/tsdoc.mjs";
|
|
32
|
+
import { typescript } from "./configs/typescript.mjs";
|
|
33
|
+
import { unicorn } from "./configs/unicorn.mjs";
|
|
34
|
+
import { unocss } from "./configs/unocss.mjs";
|
|
35
|
+
import { yaml } from "./configs/yaml.mjs";
|
|
36
|
+
import { zod } from "./configs/zod.mjs";
|
|
37
|
+
import "./configs/index.mjs";
|
|
38
|
+
import { a as preset, i as getOverrides, n as defineConfig, o as resolveSubOptions, r as getConfig, t as defaultPluginRenaming } from "./preset-x6MId9-7.mjs";
|
|
39
|
+
//#region src/index.ts
|
|
40
|
+
var src_default = defineConfig;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { StylisticConfigDefaults, astro, banner, bun, cspell, src_default as default, defaultPluginRenaming, defineConfig, disables, formatters, getConfig, getOverrides, graphql, ignores, imports, javascript, jsdoc, jsonc, jsx, markdown, mdx, next, node, nx, perfectionist, pnpm, preset, prettier, react, reactNative, regexp, resolveSubOptions, secrets, sortPackageJson, sortTsconfig, storybook, stylistic, test, toml, tsdoc, typescript, unicorn, unocss, yaml, zod };
|
|
@@ -0,0 +1,5 @@
|
|
|
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 };
|
|
@@ -0,0 +1,5 @@
|
|
|
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 };
|
|
@@ -0,0 +1,5 @@
|
|
|
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 };
|
|
@@ -0,0 +1,5 @@
|
|
|
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 };
|
|
@@ -0,0 +1,8 @@
|
|
|
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 };
|
|
@@ -0,0 +1,10 @@
|
|
|
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 };
|