-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathknip.config.ts
More file actions
48 lines (46 loc) · 1.4 KB
/
knip.config.ts
File metadata and controls
48 lines (46 loc) · 1.4 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
import type { KnipConfig } from 'knip';
const config: KnipConfig = {
entry: [
'app/routes/**/*.{ts,tsx}',
'scripts/**/*.{js,mjs,cjs}',
'e2e/**/*.spec.ts',
'server.ts',
// Internal library modules — exports form public API surfaces
'app/lib/**/*.ts',
'app/types/**/*.ts',
'app/utils/**/*.ts',
],
project: ['app/**/*.{ts,tsx}', '*.{ts,mjs,cjs,js}'],
ignoreDependencies: [
// UnoCSS icon presets loaded dynamically by UnoCSS
'@iconify-json/ph',
'@iconify-json/svg-spinners',
'@iconify-json/vscode-icons',
'@iconify/types',
// Peer/implicit dependencies
'@vitejs/plugin-react',
// Used in Docker / CI
'pnpm',
],
ignoreBinaries: ['eslint'],
// Remix exports (loader, action, meta, links, headers, handle, ErrorBoundary,
// HydrateFallback, shouldRevalidate) are consumed by the framework at runtime,
// not by direct in-project imports. Tell Knip to ignore them.
ignoreExportsUsedInFile: true,
// Enforce error-level severity for dead-code detection
rules: {
files: 'error',
dependencies: 'error',
unlisted: 'error',
exports: 'error',
devDependencies: 'warn',
types: 'warn',
duplicates: 'warn',
binaries: 'warn',
},
// Plugin configuration
vitest: { config: ['vitest.config.ts'] },
playwright: { config: ['playwright.config.ts'] },
eslint: { config: ['eslint.config.mjs'] },
};
export default config;