@subf/config 0.1.2 → 0.1.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/oxlint.d.ts +3 -3
- package/dist/oxlint.js +5 -10
- package/package.json +5 -2
- package/tsconfig.base.json +0 -1
- package/tsconfig.lib.json +2 -1
package/dist/oxlint.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare const markdownOverrideConfig: OxlintOverride;
|
|
|
10
10
|
declare const overrides: OxlintOverride[];
|
|
11
11
|
declare const CONFIG: OxlintConfig;
|
|
12
12
|
declare const unocss: OxlintOverride;
|
|
13
|
-
interface
|
|
13
|
+
interface SubfOptions extends OxlintConfig {
|
|
14
14
|
/**
|
|
15
15
|
* Used for lib, force to explicit function return type
|
|
16
16
|
*/
|
|
@@ -18,6 +18,6 @@ interface SubfOpions extends OxlintConfig {
|
|
|
18
18
|
solid?: boolean;
|
|
19
19
|
unocss?: boolean;
|
|
20
20
|
}
|
|
21
|
-
declare function subfLint(options?:
|
|
21
|
+
declare function subfLint(options?: SubfOptions): OxlintConfig;
|
|
22
22
|
//#endregion
|
|
23
|
-
export { CONFIG, CONFIG as default, FILES_TS_TSX,
|
|
23
|
+
export { CONFIG, CONFIG as default, FILES_TS_TSX, SubfOptions, baseConfig, baseRules, markdownOverrideConfig, overrides, solid, subfLint, ts, unocss, vitest };
|
package/dist/oxlint.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FILES_TS_TSX, FILES_TS_TSX as FILES_TS_TSX$1, solidConfig, solidConfig as solid } from "@subf/oxlint-plugin/config";
|
|
2
|
+
import { defu } from "defu";
|
|
2
3
|
//#region src/oxlint.ts
|
|
3
4
|
const baseConfig = {
|
|
4
5
|
env: {
|
|
@@ -112,7 +113,7 @@ const baseRules = {
|
|
|
112
113
|
"no-case-declarations": "error",
|
|
113
114
|
"no-class-assign": "error",
|
|
114
115
|
"no-compare-neg-zero": "error",
|
|
115
|
-
"no-cond-assign": ["error", "
|
|
116
|
+
"no-cond-assign": ["error", "except-parens"],
|
|
116
117
|
"no-const-assign": "error",
|
|
117
118
|
"no-control-regex": "error",
|
|
118
119
|
"no-debugger": "error",
|
|
@@ -243,7 +244,7 @@ const baseRules = {
|
|
|
243
244
|
"unicorn/new-for-builtins": "error",
|
|
244
245
|
"unicorn/no-instanceof-builtins": "error",
|
|
245
246
|
"unicorn/no-instanceof-array": "error",
|
|
246
|
-
"unicorn/no-new-array": "
|
|
247
|
+
"unicorn/no-new-array": "off",
|
|
247
248
|
"unicorn/no-new-buffer": "error",
|
|
248
249
|
"unicorn/number-literal-case": "error",
|
|
249
250
|
"unicorn/prefer-array-find": "error",
|
|
@@ -386,7 +387,7 @@ const unocss = {
|
|
|
386
387
|
}
|
|
387
388
|
};
|
|
388
389
|
function subfLint(options = {}) {
|
|
389
|
-
const { lib, unocss: enableUnocss, solid: enableSolid,
|
|
390
|
+
const { lib, unocss: enableUnocss, solid: enableSolid, ...oxlint } = options;
|
|
390
391
|
const ovr = [vitest, markdownOverrideConfig];
|
|
391
392
|
if (lib) ovr.push({
|
|
392
393
|
...ts,
|
|
@@ -402,13 +403,7 @@ function subfLint(options = {}) {
|
|
|
402
403
|
else ovr.push(ts);
|
|
403
404
|
if (enableUnocss) ovr.push(unocss);
|
|
404
405
|
if (enableSolid) ovr.push(solidConfig);
|
|
405
|
-
ovr
|
|
406
|
-
return {
|
|
407
|
-
...baseConfig,
|
|
408
|
-
...baseRules,
|
|
409
|
-
...oxlint,
|
|
410
|
-
overrides: ovr
|
|
411
|
-
};
|
|
406
|
+
return defu(oxlint, baseConfig, baseRules, { overrides: ovr });
|
|
412
407
|
}
|
|
413
408
|
//#endregion
|
|
414
409
|
export { CONFIG, CONFIG as default, FILES_TS_TSX, baseConfig, baseRules, markdownOverrideConfig, overrides, solid, subfLint, ts, unocss, vitest };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subf/config",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Universal configuration for TypeScript, oxlint (+unocss, +solid), oxfmt, and tsdown.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"prepublishOnly": "bun run build"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@subf/oxlint-plugin": "^0.2.
|
|
59
|
+
"@subf/oxlint-plugin": "^0.2.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@oxlint/plugins": "^1.59.0",
|
|
@@ -66,5 +66,8 @@
|
|
|
66
66
|
"oxlint": "^1.59.0",
|
|
67
67
|
"tsdown": "^0.21.7",
|
|
68
68
|
"typescript": "^5.9.3"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"defu": "*"
|
|
69
72
|
}
|
|
70
73
|
}
|
package/tsconfig.base.json
CHANGED