-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathknip.ts
71 lines (67 loc) · 2.34 KB
/
knip.ts
1
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { KnipConfig } from "knip";
type RecordValues<T> = T extends Record<any, infer U> ? U : never;
type WorkspaceProjectConfig = RecordValues<Required<KnipConfig["workspaces"]>>;
const defaultWorkspaceProjectConfig: WorkspaceProjectConfig & {
entry: string[];
ignoreDependencies: string[];
project: string[];
} = {
entry: [
"{index,cli,main}.{js,cjs,mjs,jsx,ts,cts,mts,tsx}",
"src/{index,cli,main}.{js,cjs,mjs,jsx,ts,cts,mts,tsx}",
],
ignoreDependencies: ["ts-loader", "tslib"],
project: [
"**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}!",
"!jest.config.stryker.mjs",
"!**/__mocks__",
],
};
export default {
commitlint: {
config: "config/commitlint/commitlint.config.js",
},
ignoreWorkspaces: ["packages/docs/services/inversify-site"],
workspaces: {
".": {
entry: [],
ignoreDependencies: defaultWorkspaceProjectConfig.ignoreDependencies,
project: [],
},
"packages/container/libraries/*": defaultWorkspaceProjectConfig,
"packages/container/tools/*": defaultWorkspaceProjectConfig,
"packages/docs/services/*": defaultWorkspaceProjectConfig,
"packages/docs/tools/*": defaultWorkspaceProjectConfig,
"packages/docs/tools/inversify-code-examples": {
entry: ["src/examples/**/*.ts", "src/scripts/generateExamples.mts"],
ignoreDependencies: [
...defaultWorkspaceProjectConfig.ignoreDependencies,
"@docusaurus/Link",
"@docusaurus/plugin-content-docs",
"@docusaurus/useDocusaurusContext",
"@theme/*",
],
project: defaultWorkspaceProjectConfig.project,
},
"packages/foundation/libraries/*": defaultWorkspaceProjectConfig,
"packages/foundation/tools/*": defaultWorkspaceProjectConfig,
"packages/foundation/tools/prettier-config": {
entry: ["{cjs,esm}/index.{js,d.ts}"],
ignoreDependencies: defaultWorkspaceProjectConfig.ignoreDependencies,
project: defaultWorkspaceProjectConfig.project,
},
"packages/container/tools/e2e-tests": {
entry: [
"config/*.mjs",
"src/*/parameters/*.ts",
"src/*/step-definitions/*.ts",
"src/app/hooks/*.ts",
],
ignoreDependencies: [
...defaultWorkspaceProjectConfig.ignoreDependencies,
"ts-node",
],
project: [...defaultWorkspaceProjectConfig.project, "!config/*"],
},
},
} satisfies KnipConfig;