@magicdawn/eslint-config 1.6.1 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -3
- package/dist/index.js +7 -12
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import * as _sxzz_eslint_config0 from "@sxzz/eslint-config";
|
|
2
1
|
import { sxzz } from "@sxzz/eslint-config";
|
|
3
|
-
import * as eslint_flat_config_utils0 from "eslint-flat-config-utils";
|
|
4
2
|
import { Linter } from "eslint";
|
|
5
3
|
export * from "@sxzz/eslint-config";
|
|
6
4
|
|
|
@@ -16,7 +14,7 @@ type SortImportOptions = {
|
|
|
16
14
|
interface MixedOptions extends Exclude<SxzzOptions, undefined> {
|
|
17
15
|
sortImport?: SortImportOptions;
|
|
18
16
|
}
|
|
19
|
-
declare function fromSxzz(options?: MixedOptions, ...moreConfigs: UserConfig[]):
|
|
17
|
+
declare function fromSxzz(options?: MixedOptions, ...moreConfigs: UserConfig[]): ReturnType<typeof sxzz>;
|
|
20
18
|
type GetRuleOptions<T extends Linter.RuleEntry> = T extends Linter.RuleSeverityAndOptions<infer Options> ? Options : never;
|
|
21
19
|
//#endregion
|
|
22
20
|
//#region src/mg-custom.d.ts
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,7 @@ import assert from "node:assert/strict";
|
|
|
2
2
|
import { GLOB_SRC, GLOB_TS, GLOB_TSX, sxzz } from "@sxzz/eslint-config";
|
|
3
3
|
import { uniq } from "es-toolkit";
|
|
4
4
|
import eslintConfigPrettier from "eslint-config-prettier";
|
|
5
|
-
|
|
6
|
-
export * from "@sxzz/eslint-config"
|
|
7
|
-
|
|
5
|
+
export * from "@sxzz/eslint-config";
|
|
8
6
|
//#region src/mg-custom.ts
|
|
9
7
|
const mgCustomIgnoreConfig = {
|
|
10
8
|
name: "mg/custom-ignore",
|
|
@@ -110,7 +108,6 @@ const mgCustomJsonOrder = { tsconfig: [{
|
|
|
110
108
|
"jsxImportSource"
|
|
111
109
|
]
|
|
112
110
|
}] };
|
|
113
|
-
|
|
114
111
|
//#endregion
|
|
115
112
|
//#region src/perfection-list/sort-imports.ts
|
|
116
113
|
/**
|
|
@@ -166,7 +163,6 @@ const customSortImportGroups = [
|
|
|
166
163
|
...generalOrder,
|
|
167
164
|
...addModifier("type")
|
|
168
165
|
];
|
|
169
|
-
|
|
170
166
|
//#endregion
|
|
171
167
|
//#region src/from-sxzz.ts
|
|
172
168
|
function fromSxzz(options, ...moreConfigs) {
|
|
@@ -221,19 +217,18 @@ function fromSxzz(options, ...moreConfigs) {
|
|
|
221
217
|
const { internalPattern, groups } = sortImport ?? {};
|
|
222
218
|
const val = config.rules?.["perfectionist/sort-imports"];
|
|
223
219
|
if (val && Array.isArray(val) && val.length > 0) {
|
|
224
|
-
const [severity, ...options
|
|
225
|
-
assert(options
|
|
226
|
-
assert(options
|
|
227
|
-
options
|
|
220
|
+
const [severity, ...options] = val;
|
|
221
|
+
assert(options.length === 1, "options.length should be 1");
|
|
222
|
+
assert(options[0], "options[0] should not be nil");
|
|
223
|
+
options[0].internalPattern = uniq([
|
|
228
224
|
"^[~@#$]/.*",
|
|
229
225
|
`^[$].+`,
|
|
230
226
|
...internalPattern ?? []
|
|
231
227
|
]);
|
|
232
|
-
options
|
|
228
|
+
options[0].groups = uniq([...groups ?? [], ...customSortImportGroups]);
|
|
233
229
|
}
|
|
234
230
|
return config;
|
|
235
231
|
});
|
|
236
232
|
}
|
|
237
|
-
|
|
238
233
|
//#endregion
|
|
239
|
-
export { fromSxzz, mgCustomIgnoreConfig, mgCustomJsonOrder, mgCustomRules };
|
|
234
|
+
export { fromSxzz, mgCustomIgnoreConfig, mgCustomJsonOrder, mgCustomRules };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magicdawn/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.6.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
4
|
+
"version": "1.6.3",
|
|
5
|
+
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319",
|
|
6
6
|
"description": "magicdawn's eslint-config",
|
|
7
7
|
"author": "magicdawn",
|
|
8
8
|
"license": "MIT",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"inspect": "pnpx @eslint/config-inspector@latest"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@unocss/eslint-plugin": "^66.
|
|
46
|
-
"eslint": "^9
|
|
45
|
+
"@unocss/eslint-plugin": "^66.6.8",
|
|
46
|
+
"eslint": "^10 || ^9"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"@unocss/eslint-plugin": {
|
|
@@ -51,18 +51,18 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@sxzz/eslint-config": "^7.
|
|
55
|
-
"es-toolkit": "^1.
|
|
54
|
+
"@sxzz/eslint-config": "^7.8.4",
|
|
55
|
+
"es-toolkit": "^1.45.1",
|
|
56
56
|
"eslint-config-prettier": "^10.1.8",
|
|
57
|
-
"eslint-flat-config-utils": "^
|
|
57
|
+
"eslint-flat-config-utils": "^3.1.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@magicdawn/prettier-config": "^0.1.0",
|
|
61
|
-
"@types/node": "^
|
|
61
|
+
"@types/node": "^25.6.0",
|
|
62
62
|
"husky": "^9.1.7",
|
|
63
|
-
"lint-staged": "^16.
|
|
64
|
-
"prettier": "^3.
|
|
65
|
-
"tsdown": "^0.
|
|
63
|
+
"lint-staged": "^16.4.0",
|
|
64
|
+
"prettier": "^3.8.3",
|
|
65
|
+
"tsdown": "^0.21.8"
|
|
66
66
|
},
|
|
67
67
|
"lint-staged": {
|
|
68
68
|
"*.{?(c|m)(j|t)s?(x),json,y?(a)ml}": [
|