@kcconfigs/textlint 0.1.0-beta.0 → 0.1.0
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/CHANGELOG.md +29 -0
- package/dist/comment-BYfI9NUG.cjs +71 -0
- package/dist/comment-BYfI9NUG.cjs.map +1 -0
- package/dist/comment-Dg2KjJvG.js +47 -0
- package/dist/comment-Dg2KjJvG.js.map +1 -0
- package/dist/config-BCGczZ5h.d.cts +36 -0
- package/dist/config-BCGczZ5h.d.cts.map +1 -0
- package/dist/config-DZLevSYy.d.ts +36 -0
- package/dist/config-DZLevSYy.d.ts.map +1 -0
- package/dist/configs/default.cjs +31 -0
- package/dist/configs/default.cjs.map +1 -0
- package/dist/configs/default.d.cts +8 -0
- package/dist/configs/default.d.cts.map +1 -0
- package/dist/configs/default.d.ts +9 -0
- package/dist/configs/default.d.ts.map +1 -0
- package/dist/configs/default.js +31 -0
- package/dist/configs/default.js.map +1 -0
- package/dist/definePreset-B6sruUgg.cjs +26 -0
- package/dist/definePreset-B6sruUgg.cjs.map +1 -0
- package/dist/definePreset-BufbSTvs.js +20 -0
- package/dist/definePreset-BufbSTvs.js.map +1 -0
- package/dist/index.cjs +11 -5
- package/dist/index.d.cts +18 -19
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +18 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -9
- package/dist/preset-DCOiMLaG.d.cts +37 -0
- package/dist/preset-DCOiMLaG.d.cts.map +1 -0
- package/dist/preset-DI2qdO9E.d.ts +37 -0
- package/dist/preset-DI2qdO9E.d.ts.map +1 -0
- package/dist/presets/default.cjs +4 -3
- package/dist/presets/default.cjs.map +1 -1
- package/dist/presets/default.d.cts +5 -2
- package/dist/presets/default.d.cts.map +1 -1
- package/dist/presets/default.d.ts +5 -2
- package/dist/presets/default.d.ts.map +1 -1
- package/dist/presets/default.js +4 -9
- package/dist/presets/default.js.map +1 -1
- package/dist/{defineConfig-BSVyAEFt.cjs → terminology-BJO_eqym.cjs} +11 -73
- package/dist/terminology-BJO_eqym.cjs.map +1 -0
- package/dist/terminology-BQqu0v3E.d.cts +16 -0
- package/dist/terminology-BQqu0v3E.d.cts.map +1 -0
- package/dist/terminology-CPBVBYUJ.d.ts +16 -0
- package/dist/terminology-CPBVBYUJ.d.ts.map +1 -0
- package/dist/terminology-CTuwYZjs.js +25 -0
- package/dist/terminology-CTuwYZjs.js.map +1 -0
- package/package.json +7 -8
- package/src/configs/default.test.ts +27 -0
- package/src/configs/default.ts +14 -0
- package/src/filters/allowlist.test.ts +41 -0
- package/src/filters/allowlist.ts +36 -0
- package/src/filters/comment.test.ts +20 -0
- package/src/filters/comment.ts +11 -0
- package/src/index.test.ts +17 -27
- package/src/index.ts +8 -4
- package/src/models/base.ts +29 -0
- package/src/models/config.ts +34 -30
- package/src/models/filter.ts +13 -0
- package/src/models/index.ts +6 -0
- package/src/models/plugin.ts +13 -0
- package/src/models/preset.ts +11 -0
- package/src/models/rule.ts +11 -32
- package/src/presets/default.test.ts +18 -0
- package/src/presets/default.ts +9 -9
- package/src/rules/terminology.test.ts +31 -0
- package/src/rules/terminology.ts +6 -9
- package/src/utils/defineConfig.test.ts +53 -0
- package/src/utils/defineConfig.ts +24 -37
- package/src/utils/defineFilter.test.ts +17 -0
- package/src/utils/defineFilter.ts +10 -0
- package/src/utils/definePreset.test.ts +33 -0
- package/src/utils/definePreset.ts +22 -0
- package/src/utils/defineRule.test.ts +21 -0
- package/src/utils/defineRule.ts +8 -0
- package/dist/config-CjR_suQD.d.cts +0 -34
- package/dist/config-CjR_suQD.d.cts.map +0 -1
- package/dist/config-KDNTBTCT.d.ts +0 -34
- package/dist/config-KDNTBTCT.d.ts.map +0 -1
- package/dist/defineConfig-BSVyAEFt.cjs.map +0 -1
- package/dist/defineConfig-Rcs53KN7.js +0 -100
- package/dist/defineConfig-Rcs53KN7.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/src/rules/allowlist.ts +0 -27
- package/src/rules/comment.ts +0 -11
- package/src/rules/index.ts +0 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 (2026-03-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **kcconfigs/textlint:** export . as library, /* as shared config, and /presets/* as preset rules ([e109218](https://github.com/kc-workspace/kcws/commit/e109218b1e32f045b992018a9e05f68014e3a1a8))
|
|
9
|
+
* **kcconfigs/textlint:** migrate kcconfigs/textlint-rule-preset to this package name instead ([3a0a6da](https://github.com/kc-workspace/kcws/commit/3a0a6da8682a413f2765cf7513dd17d1fdd92703))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Performance Improvements
|
|
13
|
+
|
|
14
|
+
* **deps:** update biome schema version from 2.3.10 to 2.4.6 across all packages ([909ff7e](https://github.com/kc-workspace/kcws/commit/909ff7ede64869a571dac9969169067e8d4b7fbc))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bugfixes
|
|
18
|
+
|
|
19
|
+
* trigger re-release please ([65447a7](https://github.com/kc-workspace/kcws/commit/65447a776ed2f8638f6f35a4d00277d407143114))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Dependencies
|
|
23
|
+
|
|
24
|
+
* The following workspace dependencies were updated
|
|
25
|
+
* devDependencies
|
|
26
|
+
* @kcconfigs/biome bumped to 0.2.2
|
|
27
|
+
* @kcconfigs/vitest bumped to 0.1.1-beta.2
|
|
28
|
+
* @kcconfigs/tsconfig bumped to 0.1.1
|
|
29
|
+
* @kcconfigs/tsdown bumped to 0.1.1-beta.3
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
|
|
3
|
+
//#region src/utils/defineFilter.ts
|
|
4
|
+
const defineFilter = (filter) => {
|
|
5
|
+
return {
|
|
6
|
+
type: "filter",
|
|
7
|
+
...filter
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/filters/allowlist.ts
|
|
13
|
+
const DEFAULT_ALLOWLIST = [
|
|
14
|
+
"editorconfig",
|
|
15
|
+
"url",
|
|
16
|
+
"html",
|
|
17
|
+
"api",
|
|
18
|
+
"apis",
|
|
19
|
+
"github",
|
|
20
|
+
"typescript",
|
|
21
|
+
"json"
|
|
22
|
+
];
|
|
23
|
+
const allowlist = (config) => {
|
|
24
|
+
const name = "allowlist";
|
|
25
|
+
if (!config) return defineFilter({
|
|
26
|
+
name,
|
|
27
|
+
config: false
|
|
28
|
+
});
|
|
29
|
+
if (!config.allow) config.allow = DEFAULT_ALLOWLIST;
|
|
30
|
+
return defineFilter({
|
|
31
|
+
name,
|
|
32
|
+
config
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/filters/comment.ts
|
|
38
|
+
const comments = (enabled = true) => {
|
|
39
|
+
return defineFilter({
|
|
40
|
+
name: "comments",
|
|
41
|
+
config: enabled
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
Object.defineProperty(exports, 'DEFAULT_ALLOWLIST', {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () {
|
|
49
|
+
return DEFAULT_ALLOWLIST;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, 'allowlist', {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () {
|
|
55
|
+
return allowlist;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports, 'comments', {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () {
|
|
61
|
+
return comments;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, 'defineFilter', {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return defineFilter;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
// Generated by @kcconfigs/tsdown
|
|
71
|
+
//# sourceMappingURL=comment-BYfI9NUG.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-BYfI9NUG.cjs","names":[],"sources":["../src/utils/defineFilter.ts","../src/filters/allowlist.ts","../src/filters/comment.ts"],"sourcesContent":["import type { AnyFilter } from \"../models\";\n\nexport const defineFilter = <R extends AnyFilter>(\n\tfilter: Omit<R, \"type\">,\n): R => {\n\treturn {\n\t\ttype: \"filter\",\n\t\t...filter,\n\t} as R;\n};\n","import type { Filter } from \"../models\";\nimport { defineFilter } from \"../utils/defineFilter\";\n\nexport interface AllowListConfig {\n\tallow?: string[];\n\tallowlistConfigPaths?: string[];\n}\n\nexport const DEFAULT_ALLOWLIST: string[] = [\n\t\"editorconfig\",\n\t\"url\",\n\t\"html\",\n\t\"api\",\n\t\"apis\",\n\t\"github\",\n\t\"typescript\",\n\t\"json\",\n];\n\nexport type AllowListRule = Filter<\"allowlist\", AllowListConfig>;\n\nexport const allowlist = (config?: AllowListConfig): AllowListRule => {\n\tconst name = \"allowlist\";\n\tif (!config) {\n\t\treturn defineFilter({\n\t\t\tname,\n\t\t\tconfig: false,\n\t\t});\n\t}\n\n\tif (!config.allow) config.allow = DEFAULT_ALLOWLIST;\n\treturn defineFilter({\n\t\tname,\n\t\tconfig,\n\t});\n};\n","import type { EmptyObject, Filter } from \"../models\";\nimport { defineFilter } from \"../utils/defineFilter\";\n\nexport type CommentRule = Filter<\"comments\", EmptyObject>;\n\nexport const comments = (enabled = true): CommentRule => {\n\treturn defineFilter({\n\t\tname: \"comments\",\n\t\tconfig: enabled,\n\t});\n};\n"],"mappings":";;;AAEA,MAAa,gBACZ,WACO;AACP,QAAO;EACN,MAAM;EACN,GAAG;EACH;;;;;ACAF,MAAa,oBAA8B;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAID,MAAa,aAAa,WAA4C;CACrE,MAAM,OAAO;AACb,KAAI,CAAC,OACJ,QAAO,aAAa;EACnB;EACA,QAAQ;EACR,CAAC;AAGH,KAAI,CAAC,OAAO,MAAO,QAAO,QAAQ;AAClC,QAAO,aAAa;EACnB;EACA;EACA,CAAC;;;;;AC7BH,MAAa,YAAY,UAAU,SAAsB;AACxD,QAAO,aAAa;EACnB,MAAM;EACN,QAAQ;EACR,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
//#region src/utils/defineFilter.ts
|
|
3
|
+
const defineFilter = (filter) => {
|
|
4
|
+
return {
|
|
5
|
+
type: "filter",
|
|
6
|
+
...filter
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/filters/allowlist.ts
|
|
12
|
+
const DEFAULT_ALLOWLIST = [
|
|
13
|
+
"editorconfig",
|
|
14
|
+
"url",
|
|
15
|
+
"html",
|
|
16
|
+
"api",
|
|
17
|
+
"apis",
|
|
18
|
+
"github",
|
|
19
|
+
"typescript",
|
|
20
|
+
"json"
|
|
21
|
+
];
|
|
22
|
+
const allowlist = (config) => {
|
|
23
|
+
const name = "allowlist";
|
|
24
|
+
if (!config) return defineFilter({
|
|
25
|
+
name,
|
|
26
|
+
config: false
|
|
27
|
+
});
|
|
28
|
+
if (!config.allow) config.allow = DEFAULT_ALLOWLIST;
|
|
29
|
+
return defineFilter({
|
|
30
|
+
name,
|
|
31
|
+
config
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/filters/comment.ts
|
|
37
|
+
const comments = (enabled = true) => {
|
|
38
|
+
return defineFilter({
|
|
39
|
+
name: "comments",
|
|
40
|
+
config: enabled
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { defineFilter as i, DEFAULT_ALLOWLIST as n, allowlist as r, comments as t };
|
|
46
|
+
// Generated by @kcconfigs/tsdown
|
|
47
|
+
//# sourceMappingURL=comment-Dg2KjJvG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-Dg2KjJvG.js","names":[],"sources":["../src/utils/defineFilter.ts","../src/filters/allowlist.ts","../src/filters/comment.ts"],"sourcesContent":["import type { AnyFilter } from \"../models\";\n\nexport const defineFilter = <R extends AnyFilter>(\n\tfilter: Omit<R, \"type\">,\n): R => {\n\treturn {\n\t\ttype: \"filter\",\n\t\t...filter,\n\t} as R;\n};\n","import type { Filter } from \"../models\";\nimport { defineFilter } from \"../utils/defineFilter\";\n\nexport interface AllowListConfig {\n\tallow?: string[];\n\tallowlistConfigPaths?: string[];\n}\n\nexport const DEFAULT_ALLOWLIST: string[] = [\n\t\"editorconfig\",\n\t\"url\",\n\t\"html\",\n\t\"api\",\n\t\"apis\",\n\t\"github\",\n\t\"typescript\",\n\t\"json\",\n];\n\nexport type AllowListRule = Filter<\"allowlist\", AllowListConfig>;\n\nexport const allowlist = (config?: AllowListConfig): AllowListRule => {\n\tconst name = \"allowlist\";\n\tif (!config) {\n\t\treturn defineFilter({\n\t\t\tname,\n\t\t\tconfig: false,\n\t\t});\n\t}\n\n\tif (!config.allow) config.allow = DEFAULT_ALLOWLIST;\n\treturn defineFilter({\n\t\tname,\n\t\tconfig,\n\t});\n};\n","import type { EmptyObject, Filter } from \"../models\";\nimport { defineFilter } from \"../utils/defineFilter\";\n\nexport type CommentRule = Filter<\"comments\", EmptyObject>;\n\nexport const comments = (enabled = true): CommentRule => {\n\treturn defineFilter({\n\t\tname: \"comments\",\n\t\tconfig: enabled,\n\t});\n};\n"],"mappings":";;AAEA,MAAa,gBACZ,WACO;AACP,QAAO;EACN,MAAM;EACN,GAAG;EACH;;;;;ACAF,MAAa,oBAA8B;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAID,MAAa,aAAa,WAA4C;CACrE,MAAM,OAAO;AACb,KAAI,CAAC,OACJ,QAAO,aAAa;EACnB;EACA,QAAQ;EACR,CAAC;AAGH,KAAI,CAAC,OAAO,MAAO,QAAO,QAAQ;AAClC,QAAO,aAAa;EACnB;EACA;EACA,CAAC;;;;;AC7BH,MAAa,YAAY,UAAU,SAAsB;AACxD,QAAO,aAAa;EACnB,MAAM;EACN,QAAQ;EACR,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
import { g as WithEnabled, h as UserBase, i as AnyRule, l as AnyObject, r as UserPreset, s as UserRule, t as AnyPreset, u as BaseObject } from "./preset-DCOiMLaG.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/models/filter.d.ts
|
|
5
|
+
interface Filter<N extends string, C extends AnyObject> extends BaseObject<"filter", N> {
|
|
6
|
+
config: WithEnabled<C>;
|
|
7
|
+
}
|
|
8
|
+
type AnyFilter = Filter<string, AnyObject>;
|
|
9
|
+
type UserFilter<RS extends AnyFilter[], K extends keyof AnyFilter> = UserBase<RS, "filter", K>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/models/plugin.d.ts
|
|
12
|
+
interface Plugin<N extends string, C extends AnyObject> extends BaseObject<"plugin", N> {
|
|
13
|
+
config: C;
|
|
14
|
+
}
|
|
15
|
+
type AnyPlugin = Plugin<string, AnyObject>;
|
|
16
|
+
type UserPlugin<RS extends AnyPlugin[], K extends keyof AnyPlugin> = UserBase<RS, "plugin", K>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/models/config.d.ts
|
|
19
|
+
interface Config<PL extends AnyPlugin[], PR extends AnyPreset[], RU extends AnyRule[], FL extends AnyFilter[]> {
|
|
20
|
+
plugins: PL;
|
|
21
|
+
presets: PR;
|
|
22
|
+
rules: RU;
|
|
23
|
+
filters: FL;
|
|
24
|
+
}
|
|
25
|
+
type AnyConfig = Config<AnyPlugin[], AnyPreset[], AnyRule[], AnyFilter[]>;
|
|
26
|
+
type UserConfigRule<C extends AnyConfig> = C["presets"] extends never[] ? C["rules"] extends never[] ? Record<string, never> : UserRule<C["rules"], "config"> : C["rules"] extends never[] ? UserPreset<C["presets"]> : UserPreset<C["presets"]> & UserRule<C["rules"], "config">;
|
|
27
|
+
interface UserConfig<C extends AnyConfig> {
|
|
28
|
+
plugins?: C["plugins"];
|
|
29
|
+
filters?: C["filters"];
|
|
30
|
+
rules?: UserConfigRule<C>;
|
|
31
|
+
}
|
|
32
|
+
type AnyUserConfig = UserConfig<AnyConfig>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { AnyPlugin as a, AnyFilter as c, UserConfig as i, Filter as l, AnyUserConfig as n, Plugin as o, Config as r, UserPlugin as s, AnyConfig as t, UserFilter as u };
|
|
35
|
+
// Generated by @kcconfigs/tsdown
|
|
36
|
+
//# sourceMappingURL=config-BCGczZ5h.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-BCGczZ5h.d.cts","names":[],"sources":["../src/models/filter.ts","../src/models/plugin.ts","../src/models/config.ts"],"mappings":";;;;UAEiB,MAAA,6BAAmC,SAAA,UAC3C,UAAA,WAAqB,CAAA;EAC7B,MAAA,EAAQ,WAAA,CAAY,CAAA;AAAA;AAAA,KAGT,SAAA,GAAY,MAAA,SAAe,SAAA;AAAA,KAE3B,UAAA,YACA,SAAA,oBACK,SAAA,IACb,QAAA,CAAS,EAAA,YAAc,CAAA;;;UCVV,MAAA,6BAAmC,SAAA,UAC3C,UAAA,WAAqB,CAAA;EAC7B,MAAA,EAAQ,CAAA;AAAA;AAAA,KAGG,SAAA,GAAY,MAAA,SAAe,SAAA;AAAA,KAE3B,UAAA,YACA,SAAA,oBACK,SAAA,IACb,QAAA,CAAS,EAAA,YAAc,CAAA;;;UCPV,MAAA,YACL,SAAA,eACA,SAAA,eACA,OAAA,eACA,SAAA;EAEX,OAAA,EAAS,EAAA;EACT,OAAA,EAAS,EAAA;EACT,KAAA,EAAO,EAAA;EACP,OAAA,EAAS,EAAA;AAAA;AAAA,KAGE,SAAA,GAAY,MAAA,CACvB,SAAA,IACA,SAAA,IACA,OAAA,IACA,SAAA;AAAA,KAGI,cAAA,WAAyB,SAAA,IAAa,CAAA,8BACxC,CAAA,4BACC,MAAA,kBACA,QAAA,CAAS,CAAA,uBACV,CAAA,4BACC,UAAA,CAAW,CAAA,eACX,UAAA,CAAW,CAAA,eAAgB,QAAA,CAAS,CAAA;AAAA,UAEvB,UAAA,WAAqB,SAAA;EACrC,OAAA,GAAU,CAAA;EACV,OAAA,GAAU,CAAA;EACV,KAAA,GAAQ,cAAA,CAAe,CAAA;AAAA;AAAA,KAGZ,aAAA,GAAgB,UAAA,CAAW,SAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
import { g as WithEnabled, h as UserBase, i as AnyRule, l as AnyObject, r as UserPreset, s as UserRule, t as AnyPreset, u as BaseObject } from "./preset-DI2qdO9E.js";
|
|
3
|
+
|
|
4
|
+
//#region src/models/filter.d.ts
|
|
5
|
+
interface Filter<N extends string, C extends AnyObject> extends BaseObject<"filter", N> {
|
|
6
|
+
config: WithEnabled<C>;
|
|
7
|
+
}
|
|
8
|
+
type AnyFilter = Filter<string, AnyObject>;
|
|
9
|
+
type UserFilter<RS extends AnyFilter[], K extends keyof AnyFilter> = UserBase<RS, "filter", K>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/models/plugin.d.ts
|
|
12
|
+
interface Plugin<N extends string, C extends AnyObject> extends BaseObject<"plugin", N> {
|
|
13
|
+
config: C;
|
|
14
|
+
}
|
|
15
|
+
type AnyPlugin = Plugin<string, AnyObject>;
|
|
16
|
+
type UserPlugin<RS extends AnyPlugin[], K extends keyof AnyPlugin> = UserBase<RS, "plugin", K>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/models/config.d.ts
|
|
19
|
+
interface Config<PL extends AnyPlugin[], PR extends AnyPreset[], RU extends AnyRule[], FL extends AnyFilter[]> {
|
|
20
|
+
plugins: PL;
|
|
21
|
+
presets: PR;
|
|
22
|
+
rules: RU;
|
|
23
|
+
filters: FL;
|
|
24
|
+
}
|
|
25
|
+
type AnyConfig = Config<AnyPlugin[], AnyPreset[], AnyRule[], AnyFilter[]>;
|
|
26
|
+
type UserConfigRule<C extends AnyConfig> = C["presets"] extends never[] ? C["rules"] extends never[] ? Record<string, never> : UserRule<C["rules"], "config"> : C["rules"] extends never[] ? UserPreset<C["presets"]> : UserPreset<C["presets"]> & UserRule<C["rules"], "config">;
|
|
27
|
+
interface UserConfig<C extends AnyConfig> {
|
|
28
|
+
plugins?: C["plugins"];
|
|
29
|
+
filters?: C["filters"];
|
|
30
|
+
rules?: UserConfigRule<C>;
|
|
31
|
+
}
|
|
32
|
+
type AnyUserConfig = UserConfig<AnyConfig>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { AnyPlugin as a, AnyFilter as c, UserConfig as i, Filter as l, AnyUserConfig as n, Plugin as o, Config as r, UserPlugin as s, AnyConfig as t, UserFilter as u };
|
|
35
|
+
// Generated by @kcconfigs/tsdown
|
|
36
|
+
//# sourceMappingURL=config-DZLevSYy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-DZLevSYy.d.ts","names":[],"sources":["../src/models/filter.ts","../src/models/plugin.ts","../src/models/config.ts"],"mappings":";;;;UAEiB,MAAA,6BAAmC,SAAA,UAC3C,UAAA,WAAqB,CAAA;EAC7B,MAAA,EAAQ,WAAA,CAAY,CAAA;AAAA;AAAA,KAGT,SAAA,GAAY,MAAA,SAAe,SAAA;AAAA,KAE3B,UAAA,YACA,SAAA,oBACK,SAAA,IACb,QAAA,CAAS,EAAA,YAAc,CAAA;;;UCVV,MAAA,6BAAmC,SAAA,UAC3C,UAAA,WAAqB,CAAA;EAC7B,MAAA,EAAQ,CAAA;AAAA;AAAA,KAGG,SAAA,GAAY,MAAA,SAAe,SAAA;AAAA,KAE3B,UAAA,YACA,SAAA,oBACK,SAAA,IACb,QAAA,CAAS,EAAA,YAAc,CAAA;;;UCPV,MAAA,YACL,SAAA,eACA,SAAA,eACA,OAAA,eACA,SAAA;EAEX,OAAA,EAAS,EAAA;EACT,OAAA,EAAS,EAAA;EACT,KAAA,EAAO,EAAA;EACP,OAAA,EAAS,EAAA;AAAA;AAAA,KAGE,SAAA,GAAY,MAAA,CACvB,SAAA,IACA,SAAA,IACA,OAAA,IACA,SAAA;AAAA,KAGI,cAAA,WAAyB,SAAA,IAAa,CAAA,8BACxC,CAAA,4BACC,MAAA,kBACA,QAAA,CAAS,CAAA,uBACV,CAAA,4BACC,UAAA,CAAW,CAAA,eACX,UAAA,CAAW,CAAA,eAAgB,QAAA,CAAS,CAAA;AAAA,UAEvB,UAAA,WAAqB,SAAA;EACrC,OAAA,GAAU,CAAA;EACV,OAAA,GAAU,CAAA;EACV,KAAA,GAAQ,cAAA,CAAe,CAAA;AAAA;AAAA,KAGZ,aAAA,GAAgB,UAAA,CAAW,SAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
const require_terminology = require('../terminology-BJO_eqym.cjs');
|
|
3
|
+
const require_comment = require('../comment-BYfI9NUG.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/utils/defineConfig.ts
|
|
6
|
+
const defineConfig = (c) => {
|
|
7
|
+
const config = {};
|
|
8
|
+
if (c.plugins) config.plugins = c.plugins;
|
|
9
|
+
if (c.filters) config.filters = c.filters;
|
|
10
|
+
if (c.presets) config.rules = c.presets.reduce((acc, preset) => {
|
|
11
|
+
return Object.assign(acc, preset.rulesConfig);
|
|
12
|
+
}, config.rules ?? {});
|
|
13
|
+
if (c.rules) config.rules = c.rules.reduce((acc, rule) => {
|
|
14
|
+
return Object.assign(acc, { [rule.name]: rule.config });
|
|
15
|
+
}, config.rules ?? {});
|
|
16
|
+
return config;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/configs/default.ts
|
|
21
|
+
const config = defineConfig({
|
|
22
|
+
presets: [],
|
|
23
|
+
rules: [require_terminology.terminology()],
|
|
24
|
+
filters: [require_comment.comments(), require_comment.allowlist({ allow: [""] })],
|
|
25
|
+
plugins: []
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
module.exports = config;
|
|
30
|
+
// Generated by @kcconfigs/tsdown
|
|
31
|
+
//# sourceMappingURL=default.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.cjs","names":["terminology","comments","allowlist"],"sources":["../../src/utils/defineConfig.ts","../../src/configs/default.ts"],"sourcesContent":["import type { AnyConfig, UserConfig } from \"../models\";\n\nexport const defineConfig = <C extends AnyConfig>(c: C): UserConfig<C> => {\n\ttype Rules = NonNullable<UserConfig<C>[\"rules\"]>;\n\tconst config = {} as UserConfig<C>;\n\tif (c.plugins) config.plugins = c.plugins;\n\tif (c.filters) config.filters = c.filters;\n\tif (c.presets) {\n\t\tconfig.rules = c.presets.reduce(\n\t\t\t(acc, preset) => {\n\t\t\t\treturn Object.assign(acc, preset.rulesConfig);\n\t\t\t},\n\t\t\tconfig.rules ?? ({} as Rules),\n\t\t);\n\t}\n\tif (c.rules) {\n\t\tconfig.rules = c.rules.reduce(\n\t\t\t(acc, rule) => {\n\t\t\t\treturn Object.assign(acc, {\n\t\t\t\t\t[rule.name]: rule.config,\n\t\t\t\t});\n\t\t\t},\n\t\t\tconfig.rules ?? ({} as Rules),\n\t\t);\n\t}\n\n\treturn config;\n};\n","import { allowlist } from \"../filters/allowlist\";\nimport { comments } from \"../filters/comment\";\nimport type { AnyUserConfig } from \"../models\";\nimport { terminology } from \"../rules/terminology\";\nimport { defineConfig } from \"../utils/defineConfig\";\n\nconst config: AnyUserConfig = defineConfig({\n\tpresets: [],\n\trules: [terminology()],\n\tfilters: [comments(), allowlist({ allow: [\"\"] })],\n\tplugins: [],\n});\n\nexport default config;\n"],"mappings":";;;;;AAEA,MAAa,gBAAqC,MAAwB;CAEzE,MAAM,SAAS,EAAE;AACjB,KAAI,EAAE,QAAS,QAAO,UAAU,EAAE;AAClC,KAAI,EAAE,QAAS,QAAO,UAAU,EAAE;AAClC,KAAI,EAAE,QACL,QAAO,QAAQ,EAAE,QAAQ,QACvB,KAAK,WAAW;AAChB,SAAO,OAAO,OAAO,KAAK,OAAO,YAAY;IAE9C,OAAO,SAAU,EAAE,CACnB;AAEF,KAAI,EAAE,MACL,QAAO,QAAQ,EAAE,MAAM,QACrB,KAAK,SAAS;AACd,SAAO,OAAO,OAAO,KAAK,GACxB,KAAK,OAAO,KAAK,QAClB,CAAC;IAEH,OAAO,SAAU,EAAE,CACnB;AAGF,QAAO;;;;;ACpBR,MAAM,SAAwB,aAAa;CAC1C,SAAS,EAAE;CACX,OAAO,CAACA,iCAAa,CAAC;CACtB,SAAS,CAACC,0BAAU,EAAEC,0BAAU,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;CACjD,SAAS,EAAE;CACX,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
import { n as AnyUserConfig } from "../config-BCGczZ5h.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/configs/default.d.ts
|
|
5
|
+
declare const config: AnyUserConfig;
|
|
6
|
+
export = config;
|
|
7
|
+
// Generated by @kcconfigs/tsdown
|
|
8
|
+
//# sourceMappingURL=default.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.d.cts","names":[],"sources":["../../src/configs/default.ts"],"mappings":";;;;cAMM,MAAA,EAAQ,aAAA;AAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
import { n as AnyUserConfig } from "../config-DZLevSYy.js";
|
|
3
|
+
|
|
4
|
+
//#region src/configs/default.d.ts
|
|
5
|
+
declare const config: AnyUserConfig;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { config as default };
|
|
8
|
+
// Generated by @kcconfigs/tsdown
|
|
9
|
+
//# sourceMappingURL=default.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.d.ts","names":[],"sources":["../../src/configs/default.ts"],"mappings":";;;;cAMM,MAAA,EAAQ,aAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
import { r as allowlist, t as comments } from "../comment-Dg2KjJvG.js";
|
|
3
|
+
import { t as terminology } from "../terminology-CTuwYZjs.js";
|
|
4
|
+
|
|
5
|
+
//#region src/utils/defineConfig.ts
|
|
6
|
+
const defineConfig = (c) => {
|
|
7
|
+
const config = {};
|
|
8
|
+
if (c.plugins) config.plugins = c.plugins;
|
|
9
|
+
if (c.filters) config.filters = c.filters;
|
|
10
|
+
if (c.presets) config.rules = c.presets.reduce((acc, preset) => {
|
|
11
|
+
return Object.assign(acc, preset.rulesConfig);
|
|
12
|
+
}, config.rules ?? {});
|
|
13
|
+
if (c.rules) config.rules = c.rules.reduce((acc, rule) => {
|
|
14
|
+
return Object.assign(acc, { [rule.name]: rule.config });
|
|
15
|
+
}, config.rules ?? {});
|
|
16
|
+
return config;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/configs/default.ts
|
|
21
|
+
const config = defineConfig({
|
|
22
|
+
presets: [],
|
|
23
|
+
rules: [terminology()],
|
|
24
|
+
filters: [comments(), allowlist({ allow: [""] })],
|
|
25
|
+
plugins: []
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { config as default };
|
|
30
|
+
// Generated by @kcconfigs/tsdown
|
|
31
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.js","names":[],"sources":["../../src/utils/defineConfig.ts","../../src/configs/default.ts"],"sourcesContent":["import type { AnyConfig, UserConfig } from \"../models\";\n\nexport const defineConfig = <C extends AnyConfig>(c: C): UserConfig<C> => {\n\ttype Rules = NonNullable<UserConfig<C>[\"rules\"]>;\n\tconst config = {} as UserConfig<C>;\n\tif (c.plugins) config.plugins = c.plugins;\n\tif (c.filters) config.filters = c.filters;\n\tif (c.presets) {\n\t\tconfig.rules = c.presets.reduce(\n\t\t\t(acc, preset) => {\n\t\t\t\treturn Object.assign(acc, preset.rulesConfig);\n\t\t\t},\n\t\t\tconfig.rules ?? ({} as Rules),\n\t\t);\n\t}\n\tif (c.rules) {\n\t\tconfig.rules = c.rules.reduce(\n\t\t\t(acc, rule) => {\n\t\t\t\treturn Object.assign(acc, {\n\t\t\t\t\t[rule.name]: rule.config,\n\t\t\t\t});\n\t\t\t},\n\t\t\tconfig.rules ?? ({} as Rules),\n\t\t);\n\t}\n\n\treturn config;\n};\n","import { allowlist } from \"../filters/allowlist\";\nimport { comments } from \"../filters/comment\";\nimport type { AnyUserConfig } from \"../models\";\nimport { terminology } from \"../rules/terminology\";\nimport { defineConfig } from \"../utils/defineConfig\";\n\nconst config: AnyUserConfig = defineConfig({\n\tpresets: [],\n\trules: [terminology()],\n\tfilters: [comments(), allowlist({ allow: [\"\"] })],\n\tplugins: [],\n});\n\nexport default config;\n"],"mappings":";;;;;AAEA,MAAa,gBAAqC,MAAwB;CAEzE,MAAM,SAAS,EAAE;AACjB,KAAI,EAAE,QAAS,QAAO,UAAU,EAAE;AAClC,KAAI,EAAE,QAAS,QAAO,UAAU,EAAE;AAClC,KAAI,EAAE,QACL,QAAO,QAAQ,EAAE,QAAQ,QACvB,KAAK,WAAW;AAChB,SAAO,OAAO,OAAO,KAAK,OAAO,YAAY;IAE9C,OAAO,SAAU,EAAE,CACnB;AAEF,KAAI,EAAE,MACL,QAAO,QAAQ,EAAE,MAAM,QACrB,KAAK,SAAS;AACd,SAAO,OAAO,OAAO,KAAK,GACxB,KAAK,OAAO,KAAK,QAClB,CAAC;IAEH,OAAO,SAAU,EAAE,CACnB;AAGF,QAAO;;;;;ACpBR,MAAM,SAAwB,aAAa;CAC1C,SAAS,EAAE;CACX,OAAO,CAAC,aAAa,CAAC;CACtB,SAAS,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;CACjD,SAAS,EAAE;CACX,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
|
|
3
|
+
//#region src/utils/definePreset.ts
|
|
4
|
+
const definePreset = (name, ...inputs) => {
|
|
5
|
+
const preset = {
|
|
6
|
+
type: "preset",
|
|
7
|
+
name,
|
|
8
|
+
rules: {},
|
|
9
|
+
rulesConfig: {}
|
|
10
|
+
};
|
|
11
|
+
for (const input of inputs) {
|
|
12
|
+
preset.rules[input.name] = input.module;
|
|
13
|
+
preset.rulesConfig[input.name] = input.config;
|
|
14
|
+
}
|
|
15
|
+
return preset;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
Object.defineProperty(exports, 'definePreset', {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return definePreset;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
// Generated by @kcconfigs/tsdown
|
|
26
|
+
//# sourceMappingURL=definePreset-B6sruUgg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definePreset-B6sruUgg.cjs","names":[],"sources":["../src/utils/definePreset.ts"],"sourcesContent":["import type { AnyRule, Preset, UserRule } from \"../models\";\n\nexport const definePreset = <N extends string, RS extends AnyRule[]>(\n\tname: N,\n\t...inputs: RS\n): Preset<N, RS> => {\n\tconst preset = {\n\t\ttype: \"preset\",\n\t\tname,\n\t\trules: {},\n\t\trulesConfig: {},\n\t} as Preset<N, RS>;\n\n\tfor (const input of inputs) {\n\t\ttype Key = keyof Preset<N, RS>[\"rules\"];\n\t\ttype Config = UserRule<RS, \"config\">[Key];\n\t\tpreset.rules[input.name as Key] = input.module;\n\t\tpreset.rulesConfig[input.name as Key] = input.config as Config;\n\t}\n\n\treturn preset;\n};\n"],"mappings":";;;AAEA,MAAa,gBACZ,MACA,GAAG,WACgB;CACnB,MAAM,SAAS;EACd,MAAM;EACN;EACA,OAAO,EAAE;EACT,aAAa,EAAE;EACf;AAED,MAAK,MAAM,SAAS,QAAQ;AAG3B,SAAO,MAAM,MAAM,QAAe,MAAM;AACxC,SAAO,YAAY,MAAM,QAAe,MAAM;;AAG/C,QAAO"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
//#region src/utils/definePreset.ts
|
|
3
|
+
const definePreset = (name, ...inputs) => {
|
|
4
|
+
const preset = {
|
|
5
|
+
type: "preset",
|
|
6
|
+
name,
|
|
7
|
+
rules: {},
|
|
8
|
+
rulesConfig: {}
|
|
9
|
+
};
|
|
10
|
+
for (const input of inputs) {
|
|
11
|
+
preset.rules[input.name] = input.module;
|
|
12
|
+
preset.rulesConfig[input.name] = input.config;
|
|
13
|
+
}
|
|
14
|
+
return preset;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { definePreset as t };
|
|
19
|
+
// Generated by @kcconfigs/tsdown
|
|
20
|
+
//# sourceMappingURL=definePreset-BufbSTvs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definePreset-BufbSTvs.js","names":[],"sources":["../src/utils/definePreset.ts"],"sourcesContent":["import type { AnyRule, Preset, UserRule } from \"../models\";\n\nexport const definePreset = <N extends string, RS extends AnyRule[]>(\n\tname: N,\n\t...inputs: RS\n): Preset<N, RS> => {\n\tconst preset = {\n\t\ttype: \"preset\",\n\t\tname,\n\t\trules: {},\n\t\trulesConfig: {},\n\t} as Preset<N, RS>;\n\n\tfor (const input of inputs) {\n\t\ttype Key = keyof Preset<N, RS>[\"rules\"];\n\t\ttype Config = UserRule<RS, \"config\">[Key];\n\t\tpreset.rules[input.name as Key] = input.module;\n\t\tpreset.rulesConfig[input.name as Key] = input.config as Config;\n\t}\n\n\treturn preset;\n};\n"],"mappings":";;AAEA,MAAa,gBACZ,MACA,GAAG,WACgB;CACnB,MAAM,SAAS;EACd,MAAM;EACN;EACA,OAAO,EAAE;EACT,aAAa,EAAE;EACf;AAED,MAAK,MAAM,SAAS,QAAQ;AAG3B,SAAO,MAAM,MAAM,QAAe,MAAM;AACxC,SAAO,YAAY,MAAM,QAAe,MAAM;;AAG/C,QAAO"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
const require_terminology = require('./terminology-BJO_eqym.cjs');
|
|
4
|
+
const require_comment = require('./comment-BYfI9NUG.cjs');
|
|
5
|
+
const require_definePreset = require('./definePreset-B6sruUgg.cjs');
|
|
3
6
|
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
7
|
+
exports.DEFAULT_ALLOWLIST = require_comment.DEFAULT_ALLOWLIST;
|
|
8
|
+
exports.allowlist = require_comment.allowlist;
|
|
9
|
+
exports.comments = require_comment.comments;
|
|
10
|
+
exports.defineFilter = require_comment.defineFilter;
|
|
11
|
+
exports.definePreset = require_definePreset.definePreset;
|
|
12
|
+
exports.defineRule = require_terminology.defineRule;
|
|
13
|
+
exports.terminology = require_terminology.terminology;
|
|
8
14
|
// Generated by @kcconfigs/tsdown
|
package/dist/index.d.cts
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as Rule, c as AnyBaseObject, d as EmptyObject, f as ExtendSeverity, g as WithEnabled, h as UserBase, i as AnyRule, l as AnyObject, m as Severity, n as Preset, o as RuleModule, p as ObjectType, r as UserPreset, s as UserRule, t as AnyPreset, u as BaseObject } from "./preset-DCOiMLaG.cjs";
|
|
3
|
+
import { a as AnyPlugin, c as AnyFilter, i as UserConfig, l as Filter, n as AnyUserConfig, o as Plugin, r as Config, s as UserPlugin, t as AnyConfig, u as UserFilter } from "./config-BCGczZ5h.cjs";
|
|
4
|
+
import { n as TerminologyRule, r as terminology, t as TerminologyConfig } from "./terminology-BQqu0v3E.cjs";
|
|
3
5
|
|
|
4
|
-
//#region src/
|
|
6
|
+
//#region src/filters/allowlist.d.ts
|
|
5
7
|
interface AllowListConfig {
|
|
6
|
-
allow
|
|
7
|
-
allowlistConfigPaths
|
|
8
|
+
allow?: string[];
|
|
9
|
+
allowlistConfigPaths?: string[];
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
declare const DEFAULT_ALLOWLIST: string[];
|
|
12
|
+
type AllowListRule = Filter<"allowlist", AllowListConfig>;
|
|
10
13
|
declare const allowlist: (config?: AllowListConfig) => AllowListRule;
|
|
11
14
|
//#endregion
|
|
12
|
-
//#region src/
|
|
13
|
-
type CommentRule =
|
|
15
|
+
//#region src/filters/comment.d.ts
|
|
16
|
+
type CommentRule = Filter<"comments", EmptyObject>;
|
|
14
17
|
declare const comments: (enabled?: boolean) => CommentRule;
|
|
15
18
|
//#endregion
|
|
16
|
-
//#region src/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
exclude?: string[];
|
|
22
|
-
}
|
|
23
|
-
type TerminologyRule = RuleRule<"terminology", TerminologyConfig>;
|
|
24
|
-
declare const terminology: (config?: TerminologyConfig) => TerminologyRule;
|
|
19
|
+
//#region src/utils/defineFilter.d.ts
|
|
20
|
+
declare const defineFilter: <R extends AnyFilter>(filter: Omit<R, "type">) => R;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/utils/definePreset.d.ts
|
|
23
|
+
declare const definePreset: <N extends string, RS extends AnyRule[]>(name: N, ...inputs: RS) => Preset<N, RS>;
|
|
25
24
|
//#endregion
|
|
26
|
-
//#region src/utils/
|
|
27
|
-
declare const
|
|
25
|
+
//#region src/utils/defineRule.d.ts
|
|
26
|
+
declare const defineRule: <R extends AnyRule>(rule: Omit<R, "type">) => R;
|
|
28
27
|
//#endregion
|
|
29
|
-
export { AllowListConfig, AllowListRule,
|
|
28
|
+
export { AllowListConfig, AllowListRule, AnyBaseObject, AnyConfig, AnyFilter, AnyObject, AnyPlugin, AnyPreset, AnyRule, AnyUserConfig, BaseObject, CommentRule, Config, DEFAULT_ALLOWLIST, EmptyObject, ExtendSeverity, Filter, ObjectType, Plugin, Preset, Rule, RuleModule, Severity, TerminologyConfig, TerminologyRule, UserBase, UserConfig, UserFilter, UserPlugin, UserPreset, UserRule, WithEnabled, allowlist, comments, defineFilter, definePreset, defineRule, terminology };
|
|
30
29
|
// Generated by @kcconfigs/tsdown
|
|
31
30
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/filters/allowlist.ts","../src/filters/comment.ts","../src/utils/defineFilter.ts","../src/utils/definePreset.ts","../src/utils/defineRule.ts"],"mappings":";;;;;;UAGiB,eAAA;EAChB,KAAA;EACA,oBAAA;AAAA;AAAA,cAGY,iBAAA;AAAA,KAWD,aAAA,GAAgB,MAAA,cAAoB,eAAA;AAAA,cAEnC,SAAA,GAAa,MAAA,GAAS,eAAA,KAAkB,aAAA;;;KClBzC,WAAA,GAAc,MAAA,aAAmB,WAAA;AAAA,cAEhC,QAAA,GAAY,OAAA,eAAiB,WAAA;;;cCH7B,YAAA,aAA0B,SAAA,EACtC,MAAA,EAAQ,IAAA,CAAK,CAAA,cACX,CAAA;;;cCFU,YAAA,gCAA6C,OAAA,IACzD,IAAA,EAAM,CAAA,KACH,MAAA,EAAQ,EAAA,KACT,MAAA,CAAO,CAAA,EAAG,EAAA;;;cCHA,UAAA,aAAwB,OAAA,EAAS,IAAA,EAAM,IAAA,CAAK,CAAA,cAAa,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as Rule, c as AnyBaseObject, d as EmptyObject, f as ExtendSeverity, g as WithEnabled, h as UserBase, i as AnyRule, l as AnyObject, m as Severity, n as Preset, o as RuleModule, p as ObjectType, r as UserPreset, s as UserRule, t as AnyPreset, u as BaseObject } from "./preset-DI2qdO9E.js";
|
|
3
|
+
import { a as AnyPlugin, c as AnyFilter, i as UserConfig, l as Filter, n as AnyUserConfig, o as Plugin, r as Config, s as UserPlugin, t as AnyConfig, u as UserFilter } from "./config-DZLevSYy.js";
|
|
4
|
+
import { n as TerminologyRule, r as terminology, t as TerminologyConfig } from "./terminology-CPBVBYUJ.js";
|
|
3
5
|
|
|
4
|
-
//#region src/
|
|
6
|
+
//#region src/filters/allowlist.d.ts
|
|
5
7
|
interface AllowListConfig {
|
|
6
|
-
allow
|
|
7
|
-
allowlistConfigPaths
|
|
8
|
+
allow?: string[];
|
|
9
|
+
allowlistConfigPaths?: string[];
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
declare const DEFAULT_ALLOWLIST: string[];
|
|
12
|
+
type AllowListRule = Filter<"allowlist", AllowListConfig>;
|
|
10
13
|
declare const allowlist: (config?: AllowListConfig) => AllowListRule;
|
|
11
14
|
//#endregion
|
|
12
|
-
//#region src/
|
|
13
|
-
type CommentRule =
|
|
15
|
+
//#region src/filters/comment.d.ts
|
|
16
|
+
type CommentRule = Filter<"comments", EmptyObject>;
|
|
14
17
|
declare const comments: (enabled?: boolean) => CommentRule;
|
|
15
18
|
//#endregion
|
|
16
|
-
//#region src/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
exclude?: string[];
|
|
22
|
-
}
|
|
23
|
-
type TerminologyRule = RuleRule<"terminology", TerminologyConfig>;
|
|
24
|
-
declare const terminology: (config?: TerminologyConfig) => TerminologyRule;
|
|
19
|
+
//#region src/utils/defineFilter.d.ts
|
|
20
|
+
declare const defineFilter: <R extends AnyFilter>(filter: Omit<R, "type">) => R;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/utils/definePreset.d.ts
|
|
23
|
+
declare const definePreset: <N extends string, RS extends AnyRule[]>(name: N, ...inputs: RS) => Preset<N, RS>;
|
|
25
24
|
//#endregion
|
|
26
|
-
//#region src/utils/
|
|
27
|
-
declare const
|
|
25
|
+
//#region src/utils/defineRule.d.ts
|
|
26
|
+
declare const defineRule: <R extends AnyRule>(rule: Omit<R, "type">) => R;
|
|
28
27
|
//#endregion
|
|
29
|
-
export { AllowListConfig, AllowListRule,
|
|
28
|
+
export { AllowListConfig, AllowListRule, AnyBaseObject, AnyConfig, AnyFilter, AnyObject, AnyPlugin, AnyPreset, AnyRule, AnyUserConfig, BaseObject, CommentRule, Config, DEFAULT_ALLOWLIST, EmptyObject, ExtendSeverity, Filter, ObjectType, Plugin, Preset, Rule, RuleModule, Severity, TerminologyConfig, TerminologyRule, UserBase, UserConfig, UserFilter, UserPlugin, UserPreset, UserRule, WithEnabled, allowlist, comments, defineFilter, definePreset, defineRule, terminology };
|
|
30
29
|
// Generated by @kcconfigs/tsdown
|
|
31
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/filters/allowlist.ts","../src/filters/comment.ts","../src/utils/defineFilter.ts","../src/utils/definePreset.ts","../src/utils/defineRule.ts"],"mappings":";;;;;;UAGiB,eAAA;EAChB,KAAA;EACA,oBAAA;AAAA;AAAA,cAGY,iBAAA;AAAA,KAWD,aAAA,GAAgB,MAAA,cAAoB,eAAA;AAAA,cAEnC,SAAA,GAAa,MAAA,GAAS,eAAA,KAAkB,aAAA;;;KClBzC,WAAA,GAAc,MAAA,aAAmB,WAAA;AAAA,cAEhC,QAAA,GAAY,OAAA,eAAiB,WAAA;;;cCH7B,YAAA,aAA0B,SAAA,EACtC,MAAA,EAAQ,IAAA,CAAK,CAAA,cACX,CAAA;;;cCFU,YAAA,gCAA6C,OAAA,IACzD,IAAA,EAAM,CAAA,KACH,MAAA,EAAQ,EAAA,KACT,MAAA,CAAO,CAAA,EAAG,EAAA;;;cCHA,UAAA,aAAwB,OAAA,EAAS,IAAA,EAAM,IAAA,CAAK,CAAA,cAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
-
import {
|
|
2
|
+
import { i as defineFilter, n as DEFAULT_ALLOWLIST, r as allowlist, t as comments } from "./comment-Dg2KjJvG.js";
|
|
3
|
+
import { n as defineRule, t as terminology } from "./terminology-CTuwYZjs.js";
|
|
4
|
+
import { t as definePreset } from "./definePreset-BufbSTvs.js";
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
init_defineConfig();
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
export { allowlist, comments, defineConfig, terminology };
|
|
10
|
-
// Generated by @kcconfigs/tsdown
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
6
|
+
export { DEFAULT_ALLOWLIST, allowlist, comments, defineFilter, definePreset, defineRule, terminology };
|
|
7
|
+
// Generated by @kcconfigs/tsdown
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// @generated by tsdown, DO NOT edit it manually
|
|
2
|
+
//#region src/models/base.d.ts
|
|
3
|
+
type Severity = "error" | "warning" | "info";
|
|
4
|
+
type WithEnabled<T> = T | boolean;
|
|
5
|
+
type ObjectType = "preset" | "rule" | "filter" | "plugin";
|
|
6
|
+
type AnyObject = Record<string, any>;
|
|
7
|
+
type EmptyObject = Record<never, never>;
|
|
8
|
+
interface BaseObject<T extends ObjectType, N extends string> {
|
|
9
|
+
type: T;
|
|
10
|
+
name: N;
|
|
11
|
+
}
|
|
12
|
+
type AnyBaseObject = BaseObject<ObjectType, string>;
|
|
13
|
+
interface ExtendSeverity {
|
|
14
|
+
severity?: Severity;
|
|
15
|
+
}
|
|
16
|
+
type UserBase<RS extends AnyBaseObject[], T extends ObjectType, K extends keyof RS[number]> = { [R in RS[number] as R extends BaseObject<T, infer N> ? N : never]: K extends keyof R ? R[K] : R };
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/models/rule.d.ts
|
|
19
|
+
type RuleModule = any;
|
|
20
|
+
interface Rule<N extends string, C extends AnyObject> extends BaseObject<"rule", N> {
|
|
21
|
+
module: RuleModule;
|
|
22
|
+
config: WithEnabled<C>;
|
|
23
|
+
}
|
|
24
|
+
type AnyRule = Rule<string, AnyObject>;
|
|
25
|
+
type UserRule<RS extends AnyRule[], K extends keyof AnyRule> = UserBase<RS, "rule", K>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/models/preset.d.ts
|
|
28
|
+
interface Preset<N extends string, RS extends AnyRule[]> extends BaseObject<"preset", N> {
|
|
29
|
+
rules: UserRule<RS, "module">;
|
|
30
|
+
rulesConfig: UserRule<RS, "config">;
|
|
31
|
+
}
|
|
32
|
+
type AnyPreset = Preset<string, AnyRule[]>;
|
|
33
|
+
type UserPreset<RS extends AnyPreset[]> = RS[number]["rulesConfig"];
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Rule as a, AnyBaseObject as c, EmptyObject as d, ExtendSeverity as f, WithEnabled as g, UserBase as h, AnyRule as i, AnyObject as l, Severity as m, Preset as n, RuleModule as o, ObjectType as p, UserPreset as r, UserRule as s, AnyPreset as t, BaseObject as u };
|
|
36
|
+
// Generated by @kcconfigs/tsdown
|
|
37
|
+
//# sourceMappingURL=preset-DCOiMLaG.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-DCOiMLaG.d.cts","names":[],"sources":["../src/models/base.ts","../src/models/rule.ts","../src/models/preset.ts"],"mappings":";;KAAY,QAAA;AAAA,KAEA,WAAA,MAAiB,CAAA;AAAA,KAEjB,UAAA;AAAA,KAGA,SAAA,GAAY,MAAA;AAAA,KACZ,WAAA,GAAc,MAAA;AAAA,UAET,UAAA,WAAqB,UAAA;EACrC,IAAA,EAAM,CAAA;EACN,IAAA,EAAM,CAAA;AAAA;AAAA,KAEK,aAAA,GAAgB,UAAA,CAAW,UAAA;AAAA,UAEtB,cAAA;EAChB,QAAA,GAAW,QAAA;AAAA;AAAA,KAGA,QAAA,YACA,aAAA,cACD,UAAA,kBACM,EAAA,oBAEV,EAAA,YAAc,CAAA,SAAU,UAAA,CAAW,CAAA,aACtC,CAAA,WACQ,CAAA,eAAgB,CAAA,GAAI,CAAA,CAAE,CAAA,IAAK,CAAA;;;KCxB3B,UAAA;AAAA,UAEK,IAAA,6BAAiC,SAAA,UACzC,UAAA,SAAmB,CAAA;EAC3B,MAAA,EAAQ,UAAA;EACR,MAAA,EAAQ,WAAA,CAAY,CAAA;AAAA;AAAA,KAGT,OAAA,GAAU,IAAA,SAAa,SAAA;AAAA,KAEvB,QAAA,YAAoB,OAAA,oBAA2B,OAAA,IAAW,QAAA,CACrE,EAAA,UAEA,CAAA;;;UCbgB,MAAA,8BAAoC,OAAA,YAC5C,UAAA,WAAqB,CAAA;EAC7B,KAAA,EAAO,QAAA,CAAS,EAAA;EAChB,WAAA,EAAa,QAAA,CAAS,EAAA;AAAA;AAAA,KAEX,SAAA,GAAY,MAAA,SAAe,OAAA;AAAA,KAE3B,UAAA,YAAsB,SAAA,MAAe,EAAA"}
|