-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathknip.ts
More file actions
123 lines (120 loc) · 3.65 KB
/
knip.ts
File metadata and controls
123 lines (120 loc) · 3.65 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import type { KnipConfig } from 'knip'
const sharedIgnore = ['dist/**', 'coverage/**', 'static-build/**', 'node_modules/**']
const alphalibIgnore = 'src/alphalib/**'
const config: KnipConfig = {
rules: {
// Binary resolution is unreliable with Yarn PnP; avoid false positives.
binaries: 'off',
exports: 'warn',
types: 'warn',
nsExports: 'warn',
nsTypes: 'warn',
duplicates: 'warn',
},
ignoreWorkspaces: ['.'],
ignoreBinaries: ['biome', 'knip', 'npm-run-all', 'tsc', 'vitest'],
ignoreExportsUsedInFile: {
type: true,
interface: true,
},
workspaces: {
'packages/node': {
entry: ['src/Transloadit.ts', 'src/cli.ts', 'test/**/*.{ts,tsx,js,jsx}', 'vitest.config.ts'],
project: ['{src,test}/**/*.{ts,tsx,js,jsx}'],
ignore: [...sharedIgnore, alphalibIgnore],
ignoreDependencies: [
// Used in src/alphalib/** which is excluded from knip
'@aws-sdk/client-s3',
'@aws-sdk/s3-request-presigner',
'@transloadit/sev-logger',
'json-to-ast',
'lodash-es',
'type-fest',
'zod',
// Repo-specific ignores
'@types/minimist',
'minimatch',
// Tooling lives at the repo root in this monorepo.
'vitest',
'vitest/config',
],
},
'packages/mcp-server': {
entry: ['src/**/*.ts', 'test/**/*.{ts,tsx,js,jsx}'],
project: ['{src,test}/**/*.{ts,tsx,js,jsx}'],
ignore: [...sharedIgnore],
ignoreDependencies: ['@types/express', '@types/node', 'vitest', 'vitest/config'],
},
'packages/notify-url-relay': {
entry: ['src/**/*.ts', 'test/**/*.ts', 'vitest.config.ts'],
project: ['{src,test}/**/*.ts'],
ignore: [...sharedIgnore],
ignoreDependencies: ['@types/node', 'vitest', 'vitest/config'],
},
'packages/transloadit': {
entry: [
'src/Transloadit.ts',
'src/cli.ts',
'src/cli/commands/**/*.ts',
'src/cli/types.ts',
'src/tus.ts',
],
project: ['src/**/*.{ts,tsx,js,jsx}'],
ignore: [...sharedIgnore, alphalibIgnore],
ignoreDependencies: [
// Used in src/alphalib/** which is excluded from knip
'@aws-sdk/client-s3',
'@aws-sdk/s3-request-presigner',
'@transloadit/sev-logger',
'clipanion',
'debug',
'dotenv',
'form-data',
'got',
'into-stream',
'is-stream',
'cacheable-lookup',
'node-watch',
'p-map',
'p-queue',
'recursive-readdir',
'tus-js-client',
'typanion',
'type-fest',
'zod',
'@transloadit/utils',
'json-to-ast',
'lodash-es',
// Repo-specific ignores
'@types/debug',
'@types/minimist',
'@types/recursive-readdir',
'minimatch',
],
},
'packages/types': {
entry: ['src/index.ts', 'scripts/emit-types.ts', 'scripts/emit-types.test.ts'],
project: ['{src,scripts}/**/*.ts'],
ignore: ['dist/**', 'node_modules/**'],
ignoreDependencies: [
// Zod is required for type inspection but not imported directly.
'zod',
],
},
'packages/utils': {
entry: ['src/**/*.{ts,tsx,js,jsx}'],
project: ['src/**/*.{ts,tsx,js,jsx}'],
ignore: ['dist/**', 'node_modules/**'],
},
'packages/zod': {
entry: ['src/**/*.{ts,tsx,js,jsx}', 'scripts/**/*.ts', 'test/**/*.ts'],
project: ['{src,scripts,test}/**/*.ts'],
ignore: ['dist/**', 'node_modules/**'],
ignoreDependencies: [
// Generated code uses this after sync, but sources don't import it directly.
'type-fest',
],
},
},
}
export default config