Skip to content

Commit db3e673

Browse files
Fix knip configuration to exclude react_on_rails_pro directory
- Add react_on_rails_pro/** to knip ignore patterns to exclude pro package analysis - Add ignoreDependencies entry for @babel/preset-typescript - Fix knip project patterns to exclude pro directory 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 3cb1e84 commit db3e673

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

knip.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ const config: KnipConfig = {
1919
'node_package/src/loadJsonFile.ts!',
2020
'eslint.config.ts',
2121
],
22-
project: ['node_package/src/**/*.[jt]s{x,}!', 'node_package/tests/**/*.[jt]s{x,}'],
22+
project: [
23+
'node_package/src/**/*.[jt]s{x,}!',
24+
'node_package/tests/**/*.[jt]s{x,}',
25+
'!react_on_rails_pro/**',
26+
],
2327
babel: {
2428
config: ['node_package/babel.config.js'],
2529
},
@@ -31,16 +35,18 @@ const config: KnipConfig = {
3135
'node_package/src/pro/ServerComponentFetchError.ts:isServerComponentFetchError',
3236
'node_package/src/pro/RSCRoute.tsx:RSCRouteProps',
3337
'node_package/src/pro/streamServerRenderedReactComponent.ts:StreamingTrackers',
38+
// Exclude entire pro directory - it has its own package.json with dependencies
39+
'react_on_rails_pro/**',
3440
],
3541
ignoreBinaries: [
36-
// Knip fails to detect it's declared in devDependencies
37-
'nps',
3842
// local scripts
3943
'node_package/scripts/.*',
4044
],
4145
ignoreDependencies: [
4246
// Required for TypeScript compilation, but we don't depend on Turbolinks itself.
4347
'@types/turbolinks',
48+
// Keep this even though knip doesn't detect usage
49+
'@babel/preset-typescript',
4450
// The Knip ESLint plugin fails to detect these are transitively required by a config,
4551
// though we don't actually use its rules anywhere.
4652
'@babel/eslint-parser',
@@ -84,8 +90,6 @@ const config: KnipConfig = {
8490
'bin/.*',
8591
],
8692
ignoreDependencies: [
87-
// Knip thinks it can be a devDependency, but it's supposed to be in dependencies.
88-
'@babel/runtime',
8993
// There's no ReScript plugin for Knip
9094
'@rescript/react',
9195
// The Babel plugin fails to detect it

0 commit comments

Comments
 (0)