forked from webpro-nl/knip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
knip.ts
29 lines (27 loc) · 869 Bytes
/
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
import type { KnipConfig } from 'knip';
const config: KnipConfig = {
workspaces: {
'.': {
ignoreBinaries: ['knip']
},
'packages/knip': {
entry: ['src/{index,cli}.ts!'],
project: ['src/**/*.ts!'],
ignore: ['**/fixtures/**', '**/_template/**', '**/dist/**'],
ignoreDependencies: ['@pnpm/logger'],
'node-test-runner': {
entry: ['test/**/*.test.ts'],
project: ['test/**/*.ts']
}
},
'packages/docs': {
entry: ['{remark,scripts}/*.ts', 'src/components/{Head,Footer}.astro!'],
ignoreBinaries: ['rg', 'xargs']
}
},
compilers: {
astro: (text: string) => [...text.replace(/```[\s\S]*?```/g, '').matchAll(/import\s[^;]+;/g)].join('\n'),
mdx: (text: string) => [...text.replace(/```[\s\S]*?```/g, '').matchAll(/import\s[^;]+;/g)].join('\n')
}
};
export default config;