@magicdawn/eslint-config 1.5.2 → 1.5.4
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 +5 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +5 -3
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -50,8 +50,9 @@ export default defineConfig([
|
|
|
50
50
|
```json
|
|
51
51
|
{
|
|
52
52
|
"lint-staged": {
|
|
53
|
-
|
|
54
|
-
"
|
|
53
|
+
// eslint+prettier on js,json,yaml
|
|
54
|
+
"*.{?(c|m)(j|t)s?(x),json,y?(a)ml}": ["eslint --fix", "prettier --write"],
|
|
55
|
+
"!*.{?(c|m)(j|t)s?(x),json,y?(a)ml}": ["prettier --write --ignore-unknown"],
|
|
55
56
|
|
|
56
57
|
// or more aggressive
|
|
57
58
|
"*": ["eslint --fix --no-warn-ignored", "prettier --write --ignore-unknown"]
|
|
@@ -61,7 +62,8 @@ export default defineConfig([
|
|
|
61
62
|
|
|
62
63
|
### `.prettierignore`
|
|
63
64
|
|
|
64
|
-
```
|
|
65
|
+
```gitignore
|
|
66
|
+
# contents not in .gitignore
|
|
65
67
|
pnpm-lock.yaml
|
|
66
68
|
```
|
|
67
69
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export * from "@sxzz/eslint-config";
|
|
|
6
6
|
|
|
7
7
|
//#region src/configs/ground-to-up.d.ts
|
|
8
8
|
declare const groundToUpConfigs: Linter.Config[];
|
|
9
|
-
|
|
10
9
|
//#endregion
|
|
11
10
|
//#region src/configs/sxzz.d.ts
|
|
12
11
|
type SxzzArgs = Parameters<typeof sxzz>;
|
|
@@ -22,7 +21,6 @@ interface MixedOptions extends Exclude<SxzzOptions, undefined> {
|
|
|
22
21
|
}
|
|
23
22
|
declare function fromSxzz(options?: MixedOptions, ...moreConfigs: UserConfig[]): eslint_flat_config_utils2.FlatConfigComposer<_sxzz_eslint_config0.Config, _sxzz_eslint_config0.ConfigNames>;
|
|
24
23
|
type GetRuleOptions<T extends Linter.RuleEntry> = T extends Linter.RuleSeverityAndOptions<infer Options> ? Options : never;
|
|
25
|
-
|
|
26
24
|
//#endregion
|
|
27
25
|
//#region src/mg-custom.d.ts
|
|
28
26
|
declare const mgCustomIgnoreConfig: Linter.Config;
|
|
@@ -89,5 +87,6 @@ declare const mgCustomJsonOrder: {
|
|
|
89
87
|
pathPattern: string;
|
|
90
88
|
order: string[];
|
|
91
89
|
}[];
|
|
92
|
-
};
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
93
92
|
export { GetRuleOptions, TsConfigCompilerOptionsKey, fromSxzz, groundToUpConfigs, mgCustomIgnoreConfig, mgCustomJsonOrder, mgCustomRules };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,8 @@ import { GLOB_SRC, GLOB_TS, GLOB_TSX, sxzz } from "@sxzz/eslint-config";
|
|
|
2
2
|
import eslint from "@eslint/js";
|
|
3
3
|
import eslintConfigPrettier from "eslint-config-prettier";
|
|
4
4
|
import tseslint from "typescript-eslint";
|
|
5
|
-
import
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
import { uniq } from "es-toolkit";
|
|
6
7
|
|
|
7
8
|
export * from "@sxzz/eslint-config"
|
|
8
9
|
|
|
@@ -167,7 +168,8 @@ function fromSxzz(options, ...moreConfigs) {
|
|
|
167
168
|
const val = config.rules?.["perfectionist/sort-imports"];
|
|
168
169
|
if (val && Array.isArray(val) && val.length > 0) {
|
|
169
170
|
const [severity, ...options$1] = val;
|
|
170
|
-
|
|
171
|
+
assert(options$1.length === 1, "options.length should be 1");
|
|
172
|
+
assert(options$1[0], "options[0] should not be nil");
|
|
171
173
|
options$1[0].internalPattern = uniq([
|
|
172
174
|
"^[~@#$]/.*",
|
|
173
175
|
String.raw`^\$.+`,
|
|
@@ -177,7 +179,7 @@ function fromSxzz(options, ...moreConfigs) {
|
|
|
177
179
|
...groups ?? [],
|
|
178
180
|
"side-effect-style",
|
|
179
181
|
"side-effect",
|
|
180
|
-
...options$1[0].groups
|
|
182
|
+
...options$1[0].groups ?? []
|
|
181
183
|
]);
|
|
182
184
|
}
|
|
183
185
|
return config;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magicdawn/eslint-config",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"packageManager": "pnpm@10.
|
|
3
|
+
"version": "1.5.4",
|
|
4
|
+
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac",
|
|
5
5
|
"description": "magicdawn's eslint-config",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
|
@@ -51,20 +51,21 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@eslint/js": "^9.
|
|
55
|
-
"@sxzz/eslint-config": "^7.0.
|
|
56
|
-
"es-toolkit": "^1.
|
|
54
|
+
"@eslint/js": "^9.28.0",
|
|
55
|
+
"@sxzz/eslint-config": "^7.0.2",
|
|
56
|
+
"es-toolkit": "^1.39.3",
|
|
57
57
|
"eslint-config-prettier": "^10.1.5",
|
|
58
|
-
"eslint-flat-config-utils": "^2.0
|
|
59
|
-
"globals": "^16.
|
|
60
|
-
"typescript-eslint": "^8.
|
|
58
|
+
"eslint-flat-config-utils": "^2.1.0",
|
|
59
|
+
"globals": "^16.2.0",
|
|
60
|
+
"typescript-eslint": "^8.34.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@magicdawn/prettier-config": "^0.1.0",
|
|
64
|
+
"@types/node": "^24.0.1",
|
|
64
65
|
"husky": "^9.1.7",
|
|
65
|
-
"lint-staged": "^16.
|
|
66
|
+
"lint-staged": "^16.1.0",
|
|
66
67
|
"prettier": "^3.5.3",
|
|
67
|
-
"tsdown": "^0.
|
|
68
|
+
"tsdown": "^0.12.7"
|
|
68
69
|
},
|
|
69
70
|
"lint-staged": {
|
|
70
71
|
"*.{js,cjs,mjs,ts,cts,mts,jsx,tsx,json,md,yaml,yml}": [
|