@@ -14,7 +14,12 @@ const withIgnoreMockInLibs = () =>
14
14
withLibraryMapper ( {
15
15
mapperFn : ( { rootFolder } ) => {
16
16
return {
17
- ignore : [ rootFolder + '/mocks/**' , rootFolder + '/perf/**' ] ,
17
+ ignore : [
18
+ rootFolder + '/perf/**' ,
19
+ '**/mock/**' ,
20
+ '**/mocks/**' ,
21
+ '**/__snapshots__/**' ,
22
+ ] ,
18
23
entry : [ rootFolder + '/src/bin.ts' , rootFolder + '/perf/**/index.ts' ] ,
19
24
} ;
20
25
} ,
@@ -27,6 +32,7 @@ const withExamplePlugins = (): KnipConfigPlugin => () => {
27
32
'examples/plugins/src/index.ts' ,
28
33
'packages/plugin-lighthouse/src/index.ts' ,
29
34
] ,
35
+ ignore : [ 'examples/**/constants.ts' ] ,
30
36
} ;
31
37
} ;
32
38
@@ -51,42 +57,38 @@ const withNxStandards = (): KnipConfigPlugin => () => {
51
57
config : [ 'commitlint.config.mjs' ] ,
52
58
} ,
53
59
exclude : [ 'duplicates' ] ,
60
+ ignoreExportsUsedInFile : true ,
54
61
entry : [
62
+ '**/index.ts' ,
63
+
55
64
// unknown why this is needed, it should be picked up by knip from the vitest setup files
56
- 'testing/test-utils/src/index.ts' ,
57
- 'testing/test-utils/src/lib/fixtures/configs/*.ts' ,
58
- 'testing/test-setup/src/index.ts' ,
59
- 'testing/test-setup/src/lib/**/*.{js,mjs,ts,cjs,mts,cts}' ,
60
- 'global-setup.ts' ,
61
- 'global-setup.e2e.ts' ,
62
- 'examples/react-todos-app/code-pushup.config.js' ,
63
- 'examples/plugins/code-pushup.config.ts' ,
64
- 'testing/test-utils/src/lib/fixtures/configs/code-pushup.config.js' ,
65
- 'testing/test-utils/src/lib/fixtures/configs/code-pushup.empty.config.js' ,
66
- 'examples/plugins/src/package-json/src/index.ts' ,
65
+ 'testing/test-{setup,utils}/src/lib/**/*.{js,mjs,ts,cjs,mts,cts}' ,
66
+ 'global-setup.*.ts' ,
67
+
67
68
// missing knip plugin for now, so this is in the root entry
68
69
'packages/models/zod2md.config.ts' ,
69
- 'code-pushup.config.ts' ,
70
+ '**/code-pushup.*.{js,mjs,ts,cjs,mts,cts}' ,
71
+ '**/vite.config.*.ts' ,
72
+ '**/*.d.ts' ,
70
73
'esbuild.config.js' ,
71
74
'tools/**/*.{js,mjs,ts,cjs,mts,cts}' ,
72
75
] ,
73
76
ignoreDependencies : [
74
- 'prettier' ,
75
77
'@swc/helpers' ,
76
78
'@swc/cli' ,
77
79
'@nx/plugin' ,
78
80
'@nx/workspace' ,
79
- // Same issue as the other vitest related, it should be picked up by knip from the vitest setup files
80
- // 'global-setup.ts',
81
- // 'global-setup.e2e.ts',
81
+ '@nx/jest' ,
82
+ '@nx/eslint' ,
82
83
83
- // Knip should be able to pick up this
84
+ // Knip does not pick up this as it is used for TS execution
84
85
'tsx' ,
86
+
85
87
// Not a npm library, and resolved in a different typescript path than the global import one
86
88
'@example/custom-plugin' ,
87
89
88
- // Prettier magic resolve is not picked up by knip
89
- '@trivago/prettier-plugin-sort-imports ' ,
90
+ '@code-pushup/models' ,
91
+ '@code-pushup/utils ' ,
90
92
] ,
91
93
} ;
92
94
} ;
0 commit comments