@adamhl8/configs 0.23.3 → 0.23.5
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/adamhl8-knip/knip-preprocessor.js +3 -0
- package/dist/configs/knip.base.d.ts +1 -1
- package/dist/configs/knip.base.d.ts.map +1 -1
- package/dist/configs/knip.base.js +3 -2
- package/dist/configs/knip.base.js.map +1 -1
- package/dist/configs/vitest.base.d.ts +0 -1
- package/dist/configs/vitest.base.d.ts.map +1 -1
- package/dist/configs/vitest.base.js +1 -2
- package/dist/configs/vitest.base.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,10 +6,13 @@ const DEFAULT_ENTRIES = [
|
|
|
6
6
|
"**/*.test.ts",
|
|
7
7
|
"./tsdown.config.ts"
|
|
8
8
|
];
|
|
9
|
+
const IGNORE_DEPENDENCIES_UNLISTED = ["@commitlint/config-conventional"];
|
|
10
|
+
[...IGNORE_DEPENDENCIES_UNLISTED];
|
|
9
11
|
//#endregion
|
|
10
12
|
//#region src/adamhl8-knip/knip-preprocessor.ts
|
|
11
13
|
const preprocess = (options) => {
|
|
12
14
|
options.configurationHints = options.configurationHints.filter((hint) => !(DEFAULT_ENTRIES.some((entry) => typeof hint.identifier === "string" && hint.identifier.includes(entry)) && (hint.type === "entry-empty" || hint.type === "entry-redundant")));
|
|
15
|
+
options.configurationHints = options.configurationHints.filter((hint) => !(IGNORE_DEPENDENCIES_UNLISTED.some((dep) => typeof hint.identifier === "string" && hint.identifier.includes(dep)) && hint.type === "ignoreDependencies"));
|
|
13
16
|
return options;
|
|
14
17
|
};
|
|
15
18
|
//#endregion
|
|
@@ -6,7 +6,7 @@ declare const baseConfig: {
|
|
|
6
6
|
readonly project: ["**"];
|
|
7
7
|
readonly entry: ["./src/index.ts", "**/*.test.ts", "./tsdown.config.ts"];
|
|
8
8
|
readonly ignoreBinaries: ["lefthook"];
|
|
9
|
-
readonly ignoreDependencies: ["@commitlint/cli"];
|
|
9
|
+
readonly ignoreDependencies: ["@commitlint/cli", ...string[]];
|
|
10
10
|
readonly tsdown: false;
|
|
11
11
|
};
|
|
12
12
|
declare const knipConfig: OptionalMergeConfigFn<KnipConfig, typeof baseConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.base.d.ts","names":[],"sources":["../../src/configs/knip.base.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"knip.base.d.ts","names":[],"sources":["../../src/configs/knip.base.ts"],"mappings":";;;;cAaM,UAAA;EAAA;;;;;;cAQO,UAAA,EAAY,qBAAA,CAAsB,UAAA,SAAmB,UAAA"}
|
|
@@ -5,14 +5,15 @@ const DEFAULT_ENTRIES = [
|
|
|
5
5
|
"**/*.test.ts",
|
|
6
6
|
"./tsdown.config.ts"
|
|
7
7
|
];
|
|
8
|
+
const IGNORE_DEPENDENCIES_UNLISTED = ["@commitlint/config-conventional"];
|
|
8
9
|
const knipConfig = createMergeConfigFn({
|
|
9
10
|
project: ["**"],
|
|
10
11
|
entry: DEFAULT_ENTRIES,
|
|
11
12
|
ignoreBinaries: ["lefthook"],
|
|
12
|
-
ignoreDependencies: ["@commitlint/cli"],
|
|
13
|
+
ignoreDependencies: ["@commitlint/cli", ...IGNORE_DEPENDENCIES_UNLISTED],
|
|
13
14
|
tsdown: false
|
|
14
15
|
});
|
|
15
16
|
//#endregion
|
|
16
|
-
export { DEFAULT_ENTRIES, knipConfig };
|
|
17
|
+
export { DEFAULT_ENTRIES, IGNORE_DEPENDENCIES_UNLISTED, knipConfig };
|
|
17
18
|
|
|
18
19
|
//# sourceMappingURL=knip.base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.base.js","names":[],"sources":["../../src/configs/knip.base.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport type { OptionalMergeConfigFn } from \"#/utils.ts\"\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\n// Normally, specifying the `./src/index.ts` entry would cause knip to complain about a redundant entry because it gets automatically included via the tsdown plugin.\n// However, in projects that _don't_ use tsdown, the `./src/index.ts` entry would be missing entirely.\n// To handle this, we specify it and disable the tsdown plugin. This makes knip work in both cases.\n\nexport const DEFAULT_ENTRIES = [\"./src/index.ts\", \"**/*.test.ts\", \"./tsdown.config.ts\"] as const satisfies string[]\n\nconst baseConfig = {\n project: [\"**\"],\n entry: DEFAULT_ENTRIES,\n ignoreBinaries: [\"lefthook\"],\n ignoreDependencies: [\"@commitlint/cli\"],\n tsdown: false,\n} as const satisfies KnipConfig\n\nexport const knipConfig: OptionalMergeConfigFn<KnipConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";;AASA,MAAa,kBAAkB;CAAC;CAAkB;CAAgB;AAAoB;
|
|
1
|
+
{"version":3,"file":"knip.base.js","names":[],"sources":["../../src/configs/knip.base.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport type { OptionalMergeConfigFn } from \"#/utils.ts\"\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\n// Normally, specifying the `./src/index.ts` entry would cause knip to complain about a redundant entry because it gets automatically included via the tsdown plugin.\n// However, in projects that _don't_ use tsdown, the `./src/index.ts` entry would be missing entirely.\n// To handle this, we specify it and disable the tsdown plugin. This makes knip work in both cases.\n\nexport const DEFAULT_ENTRIES = [\"./src/index.ts\", \"**/*.test.ts\", \"./tsdown.config.ts\"] as const satisfies string[]\n// In consuming projects, for some reason knip complains about these dependencies being unlisted.\nexport const IGNORE_DEPENDENCIES_UNLISTED = [\"@commitlint/config-conventional\"]\n\nconst baseConfig = {\n project: [\"**\"],\n entry: DEFAULT_ENTRIES,\n ignoreBinaries: [\"lefthook\"],\n ignoreDependencies: [\"@commitlint/cli\", ...IGNORE_DEPENDENCIES_UNLISTED],\n tsdown: false,\n} as const satisfies KnipConfig\n\nexport const knipConfig: OptionalMergeConfigFn<KnipConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";;AASA,MAAa,kBAAkB;CAAC;CAAkB;CAAgB;AAAoB;AAEtF,MAAa,+BAA+B,CAAC,iCAAiC;AAU9E,MAAa,aAAmE,oBAAoB;CAPlG,SAAS,CAAC,IAAI;CACd,OAAO;CACP,gBAAgB,CAAC,UAAU;CAC3B,oBAAoB,CAAC,mBAAmB,GAAG,4BAA4B;CACvE,QAAQ;AAG0F,CAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.base.d.ts","names":[],"sources":["../../src/configs/vitest.base.ts"],"mappings":";;;;cAKM,UAAA;EAAA
|
|
1
|
+
{"version":3,"file":"vitest.base.d.ts","names":[],"sources":["../../src/configs/vitest.base.ts"],"mappings":";;;;cAKM,UAAA;EAAA;;;;;;;;;;cAYO,YAAA,EAAc,qBAAA,CAAsB,cAAA,SAAuB,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.base.js","names":[],"sources":["../../src/configs/vitest.base.ts"],"sourcesContent":["import type { ViteUserConfig } from \"vitest/config\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\nimport type { OptionalMergeConfigFn } from \"#/utils.ts\"\n\nconst baseConfig = {\n test: {\n coverage: {\n enabled: true,\n reporter: [\"text\"],\n },\n expect: {\n requireAssertions: true,\n },\n
|
|
1
|
+
{"version":3,"file":"vitest.base.js","names":[],"sources":["../../src/configs/vitest.base.ts"],"sourcesContent":["import type { ViteUserConfig } from \"vitest/config\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\nimport type { OptionalMergeConfigFn } from \"#/utils.ts\"\n\nconst baseConfig = {\n test: {\n coverage: {\n enabled: true,\n reporter: [\"text\"],\n },\n expect: {\n requireAssertions: true,\n },\n },\n} as const satisfies ViteUserConfig\n\nexport const vitestConfig: OptionalMergeConfigFn<ViteUserConfig, typeof baseConfig> = createMergeConfigFn(baseConfig)\n"],"mappings":";AAiBA,MAAa,eAAyE,oBAAoB,EAXxG,MAAM;CACJ,UAAU;EACR,SAAS;EACT,UAAU,CAAC,MAAM;CACnB;CACA,QAAQ,EACN,mBAAmB,KACrB;AACF,EAGwG,CAAU"}
|