@truenine/eslint9-config 1.0.13 → 1.0.15
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 +0 -4
- package/dist/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/defaults/index.cjs +181 -181
- package/dist/defaults/index.cjs.map +1 -0
- package/dist/defaults/index.js +181 -190
- package/dist/defaults/index.js.map +1 -0
- package/dist/index.cjs +35 -48
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +19 -15
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -49
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.cts +46 -0
- package/dist/types/index.d.cts.map +1 -0
- package/dist/types/index.d.ts +45 -39
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +7 -15
- package/dist/defaults/index.d.ts +0 -35
package/dist/index.js
CHANGED
|
@@ -1,52 +1,37 @@
|
|
|
1
|
+
import { defaultFormatterConfig, defaultJsConfig, defaultStrictTsConfig, defaultStylisticConfig, defaultTestConfig, defaultTsConfig, defaultUnocssConfig, defaultVueConfig, mergeWithDefaults } from "./defaults/index.js";
|
|
1
2
|
import { antfu } from "@antfu/eslint-config";
|
|
2
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/index.ts
|
|
3
5
|
async function eslint9(options = {}) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
_typescript.parserOptions = {
|
|
32
|
-
projectService: true
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return antfu({
|
|
37
|
-
type,
|
|
38
|
-
ignores,
|
|
39
|
-
pnpm: _pnpm,
|
|
40
|
-
test: _test,
|
|
41
|
-
unocss: _unocss,
|
|
42
|
-
vue: _vue,
|
|
43
|
-
jsx,
|
|
44
|
-
typescript: _typescript,
|
|
45
|
-
javascript: _javascript,
|
|
46
|
-
stylistic: _stylistic,
|
|
47
|
-
formatters: _formatters
|
|
48
|
-
});
|
|
6
|
+
const { type = "lib", ignores = [], test = true, unocss = false, vue = false, jsx = false, pnpm = false, stylistic = true, javascript = defaultJsConfig, typescript = defaultTsConfig, formatters = false } = options;
|
|
7
|
+
const _test = mergeWithDefaults(test, defaultTestConfig);
|
|
8
|
+
const _unocss = mergeWithDefaults(unocss, defaultUnocssConfig);
|
|
9
|
+
const _vue = mergeWithDefaults(vue, defaultVueConfig);
|
|
10
|
+
const _javascript = mergeWithDefaults(javascript, defaultJsConfig);
|
|
11
|
+
const _stylistic = mergeWithDefaults(stylistic, defaultStylisticConfig);
|
|
12
|
+
const _formatters = mergeWithDefaults(formatters, defaultFormatterConfig);
|
|
13
|
+
let _typescript = typescript;
|
|
14
|
+
let _pnpm = pnpm;
|
|
15
|
+
if (type === "app") _pnpm = false;
|
|
16
|
+
if (_typescript !== null && typeof _typescript === "object" && "strictTypescriptEslint" in _typescript && _typescript.strictTypescriptEslint === true) {
|
|
17
|
+
_typescript = mergeWithDefaults(typescript, defaultStrictTsConfig);
|
|
18
|
+
if (typeof _typescript === "object" && "tsconfigPath" in _typescript) _typescript.parserOptions = { projectService: true };
|
|
19
|
+
}
|
|
20
|
+
return antfu({
|
|
21
|
+
type,
|
|
22
|
+
ignores,
|
|
23
|
+
pnpm: _pnpm,
|
|
24
|
+
test: _test,
|
|
25
|
+
unocss: _unocss,
|
|
26
|
+
vue: _vue,
|
|
27
|
+
jsx,
|
|
28
|
+
typescript: _typescript,
|
|
29
|
+
javascript: _javascript,
|
|
30
|
+
stylistic: _stylistic,
|
|
31
|
+
formatters: _formatters
|
|
32
|
+
});
|
|
49
33
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { eslint9 as default };
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["options: ConfigOptions"],"sources":["../src/index.ts"],"sourcesContent":["import type { OptionsTypeScriptParserOptions } from '@antfu/eslint-config'\nimport type { AntFuFormatterConfig, AntFuJsConfig, AntFuStrictTsConfig, AntFuStylisticConfig, AntFuTestConfig, AntFuTsConfig, AntFuUnocssConfig, AntFuVueConfig } from './types'\nimport { antfu } from '@antfu/eslint-config'\nimport { defaultFormatterConfig, defaultJsConfig, defaultStrictTsConfig, defaultStylisticConfig, defaultTestConfig, defaultTsConfig, defaultUnocssConfig, defaultVueConfig, mergeWithDefaults } from './defaults'\n\ninterface ConfigOptions {\n type?: 'app' | 'lib'\n pnpm?: boolean\n test?: boolean | AntFuTestConfig\n ignores?: string[]\n jsx?: boolean\n vue?: boolean | AntFuVueConfig\n formatters?: boolean | AntFuFormatterConfig\n javascript?: AntFuJsConfig\n typescript?: boolean | AntFuStrictTsConfig | AntFuTsConfig\n unocss?: boolean | AntFuUnocssConfig\n stylistic?: boolean | AntFuStylisticConfig\n}\n\nexport default async function eslint9(options: ConfigOptions = {}): Promise<ReturnType<typeof antfu>> {\n const {\n type = 'lib',\n ignores = [],\n test = true,\n unocss = false,\n vue = false,\n jsx = false,\n pnpm = false,\n stylistic = true,\n javascript = defaultJsConfig,\n typescript = defaultTsConfig,\n formatters = false,\n } = options\n\n const _test = mergeWithDefaults(test, defaultTestConfig)\n const _unocss = mergeWithDefaults(unocss, defaultUnocssConfig)\n const _vue = mergeWithDefaults(vue, defaultVueConfig)\n const _javascript = mergeWithDefaults(javascript, defaultJsConfig)\n const _stylistic = mergeWithDefaults(stylistic, defaultStylisticConfig)\n const _formatters = mergeWithDefaults(formatters, defaultFormatterConfig)\n let _typescript = typescript\n\n // 如果 type 为 'app',强制 pnpm 为 false\n let _pnpm = pnpm\n if (type === 'app') {\n _pnpm = false\n }\n\n // 严格 ts 模式\n if (\n _typescript !== null\n && typeof _typescript === 'object'\n && 'strictTypescriptEslint' in _typescript\n && _typescript.strictTypescriptEslint === true\n ) {\n _typescript = mergeWithDefaults(typescript, defaultStrictTsConfig)\n if (typeof _typescript === 'object' && 'tsconfigPath' in _typescript) {\n (_typescript as OptionsTypeScriptParserOptions).parserOptions = {\n projectService: true,\n }\n }\n }\n\n return antfu({\n type,\n ignores,\n pnpm: _pnpm,\n test: _test,\n unocss: _unocss,\n vue: _vue,\n jsx,\n typescript: _typescript,\n javascript: _javascript,\n stylistic: _stylistic,\n formatters: _formatters,\n })\n}\n"],"mappings":";;;;AAmBA,eAA8B,QAAQA,UAAyB,CAAE,GAAqC;CACpG,MAAM,EACJ,OAAO,OACP,UAAU,CAAE,GACZ,OAAO,MACP,SAAS,OACT,MAAM,OACN,MAAM,OACN,OAAO,OACP,YAAY,MACZ,aAAa,iBACb,aAAa,iBACb,aAAa,OACd,GAAG;CAEJ,MAAM,QAAQ,kBAAkB,MAAM,kBAAkB;CACxD,MAAM,UAAU,kBAAkB,QAAQ,oBAAoB;CAC9D,MAAM,OAAO,kBAAkB,KAAK,iBAAiB;CACrD,MAAM,cAAc,kBAAkB,YAAY,gBAAgB;CAClE,MAAM,aAAa,kBAAkB,WAAW,uBAAuB;CACvE,MAAM,cAAc,kBAAkB,YAAY,uBAAuB;CACzE,IAAI,cAAc;CAGlB,IAAI,QAAQ;AACZ,KAAI,SAAS,OACX,QAAQ;AAIV,KACE,gBAAgB,QACb,OAAO,gBAAgB,YACvB,4BAA4B,eAC5B,YAAY,2BAA2B,MAC1C;EACA,cAAc,kBAAkB,YAAY,sBAAsB;AAClE,MAAI,OAAO,gBAAgB,YAAY,kBAAkB,aACtD,YAA+C,gBAAgB,EAC9D,gBAAgB,KACjB;CAEJ;AAED,QAAO,MAAM;EACX;EACA;EACA,MAAM;EACN,MAAM;EACN,QAAQ;EACR,KAAK;EACL;EACA,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,YAAY;CACb,EAAC;AACH"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import antfu$1 from "@antfu/eslint-config";
|
|
2
|
+
|
|
3
|
+
//#region src/types/index.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AntFu Config
|
|
7
|
+
*/
|
|
8
|
+
type AntFuConfig = NonNullable<Parameters<typeof antfu$1>[0]>;
|
|
9
|
+
/**
|
|
10
|
+
* typescript config options
|
|
11
|
+
*/
|
|
12
|
+
type AntFuTsConfig = Exclude<AntFuConfig["typescript"], boolean | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* javascript config options
|
|
15
|
+
*/
|
|
16
|
+
type AntFuJsConfig = Exclude<AntFuConfig["javascript"], boolean | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* vue config options
|
|
19
|
+
*/
|
|
20
|
+
type AntFuVueConfig = Exclude<AntFuConfig["vue"], boolean | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* unocss config options
|
|
23
|
+
*/
|
|
24
|
+
type AntFuUnocssConfig = Exclude<AntFuConfig["unocss"], boolean | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* stylistic config options
|
|
27
|
+
*/
|
|
28
|
+
type AntFuStylisticConfig = Exclude<AntFuConfig["stylistic"], boolean | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* formatter config options
|
|
31
|
+
*/
|
|
32
|
+
type AntFuFormatterConfig = Exclude<AntFuConfig["formatters"], boolean | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* test config options
|
|
35
|
+
*/
|
|
36
|
+
type AntFuTestConfig = Exclude<AntFuConfig["test"], boolean | undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* 严格的 typescript config
|
|
39
|
+
*/
|
|
40
|
+
type AntFuStrictTsConfig = AntFuTsConfig & {
|
|
41
|
+
strictTypescriptEslint: true;
|
|
42
|
+
tsconfigPath: string;
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { AntFuFormatterConfig, AntFuJsConfig, AntFuStrictTsConfig, AntFuStylisticConfig, AntFuTestConfig, AntFuTsConfig, AntFuUnocssConfig, AntFuVueConfig };
|
|
46
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;AAAY,KAAA,WAAA,GAAc,WAAd,CAA0B,UAA1B,CAAA,OAA4C,OAA5C,CAAA,CAAA,CAAA,CAAA,CAAA;;;;AAAc,KAKd,aAAA,GAAgB,OALF,CAKU,WALV,CAAA,YAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAK1B;;;AAA4B,KAKhB,aAAA,GAAgB,OALA,CAKQ,WALR,CAAA,YAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAAA;AAK5B;;AAAoC,KAKxB,cAAA,GAAiB,OALO,CAKC,WALD,CAAA,KAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;;AAAR;AAK5B;AAAY,KAKA,iBAAA,GAAoB,OALpB,CAK4B,WAL5B,CAAA,QAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;;;AAAiB;AAKjB,KAKA,oBAAA,GAAuB,OALvB,CAK+B,WAL/B,CAAA,WAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;;;;AAAoB,KAUpB,oBAAA,GAAuB,OAVH,CAUW,WAVX,CAAA,YAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAKhC;;;AAAmC,KAUvB,eAAA,GAAkB,OAVK,CAUG,WAVH,CAAA,MAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAAA;AAKnC;;AAA2C,KAS/B,mBAAA,GAAsB,aATS,GAAA;EAAA,sBAAR,EAAA,IAAA;EAAA,YAAA,EAAA,MAAA;AAKnC,CAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import antfu$1 from "@antfu/eslint-config";
|
|
2
|
+
|
|
3
|
+
//#region src/types/index.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AntFu Config
|
|
7
|
+
*/
|
|
8
|
+
type AntFuConfig = NonNullable<Parameters<typeof antfu$1>[0]>;
|
|
9
|
+
/**
|
|
10
|
+
* typescript config options
|
|
11
|
+
*/
|
|
12
|
+
type AntFuTsConfig = Exclude<AntFuConfig["typescript"], boolean | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* javascript config options
|
|
15
|
+
*/
|
|
16
|
+
type AntFuJsConfig = Exclude<AntFuConfig["javascript"], boolean | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* vue config options
|
|
19
|
+
*/
|
|
20
|
+
type AntFuVueConfig = Exclude<AntFuConfig["vue"], boolean | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* unocss config options
|
|
23
|
+
*/
|
|
24
|
+
type AntFuUnocssConfig = Exclude<AntFuConfig["unocss"], boolean | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* stylistic config options
|
|
27
|
+
*/
|
|
28
|
+
type AntFuStylisticConfig = Exclude<AntFuConfig["stylistic"], boolean | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* formatter config options
|
|
31
|
+
*/
|
|
32
|
+
type AntFuFormatterConfig = Exclude<AntFuConfig["formatters"], boolean | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* test config options
|
|
35
|
+
*/
|
|
36
|
+
type AntFuTestConfig = Exclude<AntFuConfig["test"], boolean | undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* 严格的 typescript config
|
|
39
|
+
*/
|
|
40
|
+
type AntFuStrictTsConfig = AntFuTsConfig & {
|
|
41
|
+
strictTypescriptEslint: true;
|
|
42
|
+
tsconfigPath: string;
|
|
40
43
|
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { AntFuFormatterConfig, AntFuJsConfig, AntFuStrictTsConfig, AntFuStylisticConfig, AntFuTestConfig, AntFuTsConfig, AntFuUnocssConfig, AntFuVueConfig };
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;AAAY,KAAA,WAAA,GAAc,WAAd,CAA0B,UAA1B,CAAA,OAA4C,OAA5C,CAAA,CAAA,CAAA,CAAA,CAAA;;;;AAAc,KAKd,aAAA,GAAgB,OALF,CAKU,WALV,CAAA,YAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAK1B;;;AAA4B,KAKhB,aAAA,GAAgB,OALA,CAKQ,WALR,CAAA,YAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAAA;AAK5B;;AAAoC,KAKxB,cAAA,GAAiB,OALO,CAKC,WALD,CAAA,KAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;;AAAR;AAK5B;AAAY,KAKA,iBAAA,GAAoB,OALpB,CAK4B,WAL5B,CAAA,QAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;;;AAAiB;AAKjB,KAKA,oBAAA,GAAuB,OALvB,CAK+B,WAL/B,CAAA,WAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;;;;AAAoB,KAUpB,oBAAA,GAAuB,OAVH,CAUW,WAVX,CAAA,YAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAKhC;;;AAAmC,KAUvB,eAAA,GAAkB,OAVK,CAUG,WAVH,CAAA,MAAA,CAAA,EAAA,OAAA,GAAA,SAAA,CAAA;AAAA;AAKnC;;AAA2C,KAS/B,mBAAA,GAAsB,aATS,GAAA;EAAA,sBAAR,EAAA,IAAA;EAAA,YAAA,EAAA,MAAA;AAKnC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truenine/eslint9-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.15",
|
|
5
5
|
"description": "ESLint 9 configuration package for Compose Client projects with TypeScript, Vue, and modern JavaScript support",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "TrueNine",
|
|
@@ -35,23 +35,14 @@
|
|
|
35
35
|
"sideEffects": false,
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
|
-
"types": "./dist/index.d.ts",
|
|
39
38
|
"import": "./dist/index.js",
|
|
40
39
|
"require": "./dist/index.cjs"
|
|
41
40
|
},
|
|
42
|
-
"./types": {
|
|
43
|
-
"types": "./dist/types/index.d.ts"
|
|
44
|
-
},
|
|
45
|
-
"./defaults": {
|
|
46
|
-
"types": "./dist/defaults/index.d.ts",
|
|
47
|
-
"import": "./dist/defaults/index.js",
|
|
48
|
-
"require": "./dist/defaults/index.cjs"
|
|
49
|
-
},
|
|
50
41
|
"./*": "./*"
|
|
51
42
|
},
|
|
52
|
-
"main": "dist/index.cjs",
|
|
53
|
-
"module": "dist/index.js",
|
|
54
|
-
"types": "dist/index.d.
|
|
43
|
+
"main": "./dist/index.cjs",
|
|
44
|
+
"module": "./dist/index.js",
|
|
45
|
+
"types": "./dist/index.d.cts",
|
|
55
46
|
"files": [
|
|
56
47
|
"LICENSE",
|
|
57
48
|
"README.md",
|
|
@@ -91,10 +82,11 @@
|
|
|
91
82
|
"typescript-eslint": "^8.38.0"
|
|
92
83
|
},
|
|
93
84
|
"scripts": {
|
|
94
|
-
"build": "
|
|
85
|
+
"build": "tsdown",
|
|
95
86
|
"build-c": "vite build",
|
|
96
87
|
"lint": "eslint --fix",
|
|
97
88
|
"type-check": "vue-tsc --noEmit",
|
|
98
|
-
"test": "vitest run"
|
|
89
|
+
"test": "vitest run",
|
|
90
|
+
"copy-license": "node -e \"require('fs').copyFileSync('../../LICENSE', './LICENSE')\""
|
|
99
91
|
}
|
|
100
92
|
}
|
package/dist/defaults/index.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AntFuFormatterConfig, AntFuJsConfig, AntFuStylisticConfig, AntFuTestConfig, AntFuTsConfig, AntFuUnocssConfig, AntFuVueConfig } from '../types';
|
|
2
|
-
export declare const defaultUnocssConfig: AntFuUnocssConfig;
|
|
3
|
-
export declare const defaultVueConfig: AntFuVueConfig;
|
|
4
|
-
export declare const defaultJsConfig: AntFuJsConfig;
|
|
5
|
-
export declare const defaultTsConfig: AntFuTsConfig;
|
|
6
|
-
export declare const defaultFormatterConfig: AntFuFormatterConfig;
|
|
7
|
-
/**
|
|
8
|
-
* 严格 ts 模式 的默认配置
|
|
9
|
-
*
|
|
10
|
-
* 这些配置需要 配置 parserOptions 和 tsconfigPath 等
|
|
11
|
-
* @see https://typescript-eslint.io/getting-started/typed-linting
|
|
12
|
-
*/
|
|
13
|
-
export declare const defaultStrictTsConfig: AntFuTsConfig;
|
|
14
|
-
export declare const defaultStylisticConfig: AntFuStylisticConfig;
|
|
15
|
-
export declare const defaultTestConfig: AntFuTestConfig;
|
|
16
|
-
/**
|
|
17
|
-
* 合并配置项,支持以下场景:
|
|
18
|
-
* 1. 布尔值与对象配置的混合
|
|
19
|
-
* 2. 使用 vite 的 mergeConfig 进行对象合并
|
|
20
|
-
* 3. 处理 undefined 和 null 的默认值
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* // 场景1: 布尔值转换为默认对象
|
|
25
|
-
* mergeWithDefaults(true, { foo: 'bar' }) // => { foo: 'bar' }
|
|
26
|
-
*
|
|
27
|
-
* // 场景2: vite配置合并
|
|
28
|
-
* mergeWithDefaults({ plugins: [vue()] }, { plugins: [unocss()] })
|
|
29
|
-
*
|
|
30
|
-
* // 场景3: undefined/null/false 处理
|
|
31
|
-
* mergeWithDefaults(false, true) // => false
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare function mergeWithDefaults<T extends object>(value?: boolean | T | null, defaults?: T): T;
|
|
35
|
-
export declare function mergeWithDefaults<T extends object>(value?: boolean | T | null, defaults?: boolean): boolean | T;
|