forked from TanStack/query
-
Notifications
You must be signed in to change notification settings - Fork 0
/
knip.ts
34 lines (33 loc) · 1.05 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
// These aren't actual compilers, but performant & avoids root dependencies
const svelteCompiler = (text: string) => text.matchAll(/import[^]*?'.*?'\n/gs)
const vueCompiler = /<script\b[^>]*>([\s\S]*?)<\/script>/gm
export default {
$schema: 'https://unpkg.com/knip@2/schema.json',
ignoreWorkspaces: ['examples/**'],
ignore: ['**/react-app-env.d.ts', '**/vite-env.d.ts'],
workspaces: {
'packages/codemods': {
entry: ['src/v4/*.js', 'src/v5/*/*.js'],
ignore: ['**/__testfixtures__/**'],
},
'packages/vue-query': {
ignore: ['**/__mocks__/**'],
ignoreDependencies: ['vue2', 'vue2.7'],
},
'packages/angular-query-experimental': {
ignore: ['**/*.test-d.ts'],
},
'integrations/angular-cli-standalone-17': {
entry: ['src/main.ts'],
},
},
compilers: {
svelte: (text: string) => [...svelteCompiler(text)].join('\n'),
vue: (text: string) => {
const scripts = []
let match
while ((match = vueCompiler.exec(text))) scripts.push(match[1])
return scripts.join(';')
},
},
}