-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknip.ts
More file actions
106 lines (96 loc) · 3.14 KB
/
knip.ts
File metadata and controls
106 lines (96 loc) · 3.14 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
import type { KnipConfig } from 'knip';
const config: KnipConfig = {
// Monorepo workspace configuration
workspaces: {
'packages/cli': {
entry: ['src/dev-server.ts', 'src/prod-server.ts', 'prod-entry.ts', 'tests/**/*.ts'],
},
'packages/daemon': {
entry: ['src/app.ts', 'src/lib/rpc-handlers/*.ts', 'tests/**/*.ts'],
},
'packages/neo': {
// Neo package exports public API for external use
entry: ['src/index.ts'],
},
'packages/shared': {
entry: ['src/mod.ts', 'tests/**/*.ts'],
},
'packages/web': {
// Web entry is client.tsx (rendered by vite), not index.ts
entry: ['src/client.tsx', 'src/index.html'],
},
},
// Ignore patterns
ignore: [
'**/*.test.ts',
'**/*.test.tsx',
'**/__tests__/**',
'**/dist/**',
'**/node_modules/**',
'**/*.d.ts',
'packages/e2e/**', // E2E tests have different patterns
'e2e/**', // E2E test files
'docs/**',
'examples/**', // Example scripts
'scripts/**', // Utility scripts
'npm/**', // npm distribution launcher
'**/*.config.ts',
'**/*.config.js',
'packages/web/vite.config.ts',
'packages/web/tailwind.config.ts',
'packages/web/postcss.config.js',
'packages/web/src/index.ts', // Standalone dev server, not used in production
'packages/web/src/lib/router.ts', // Router functions called via navigateToRoom etc
'packages/neo/src/**/*.ts', // Neo package - public API for external use
'packages/daemon/scripts/**', // Database recovery scripts
'packages/daemon/tests/manual/**', // Manual test scripts
'packages/daemon/tests/mocks/**', // Test mocks
'packages/daemon/tests/helpers/**', // Test helpers (used by online tests outside knip scan)
'packages/shared/src/sdk/**', // SDK types from Claude Agent SDK (not all used)
],
// Workspace dependencies (don't flag as unlisted)
ignoreWorkspaces: [],
// Ignore specific binaries (build tools)
ignoreBinaries: [
'tailwindcss', // PostCSS plugin
'playwright', // E2E testing
],
// Ignore specific dependencies (external tools, runtime only)
ignoreDependencies: [
'@neokai/*', // Workspace dependencies
'@testing-library/preact', // Used in tests
'dotenv', // Used in development scripts
'happy-dom', // Used in unit tests
],
// Ignore unused exports from these files
ignoreExportsUsedInFile: {
interface: true,
type: true,
},
/**
* Remaining 84 unused exports are intentionally kept:
*
* 1. Preact signals (packages/web/src/lib/state.ts):
* - Knip can't detect .value access in JSX templates
* - systemState, healthStatus, currentSession, etc.
*
* 2. Low-level utilities (packages/shared/src/*):
* - logger.ts - May be used via dynamic imports
* - message-hub/* - Internal protocol utilities
*
* 3. Stable internal APIs:
* - Tool registry utilities
* - Error classes
* - Timeout utilities
*
* These provide stable APIs for future features and can't be
* automatically detected due to Preact signals pattern.
*/
// Include entry source files in project
includeEntryExports: true,
/**
* Exports marked with @public JSDoc tag won't be reported as unused.
* This is used for Preact signals accessed via .value in JSX.
*/
};
export default config;