Conversation
WalkthroughThe changes introduce Knip dependency auditing tool integration. A new configuration file Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@js/app/knip.ts`:
- Around line 5-10: Remove the redundant exclusion of "packages/loro-mirror"
from the ignore array and rely only on the ignoreWorkspaces setting to skip that
workspace; specifically, delete the "packages/loro-mirror/**" entry from the
ignore array (the ignore array and the ignoreWorkspaces setting are both present
in js/app/knip.ts) so the workspace is only excluded via ignoreWorkspaces,
keeping configurations DRY.
- Around line 63-107: The current Knip config uses broad wildcards
('**/*.{ts,tsx}') for entry and project for packages like
'packages/block-canvas', 'packages/block-chat', 'packages/block-image',
'packages/block-md', 'packages/block-pdf', 'packages/block-project',
'packages/block-unknown', 'packages/block-video', 'packages/block-code',
'packages/block-channel', and 'packages/channel', which makes every file an
entry so Knip cannot detect unused exports; fix this by replacing the wildcard
entry/project for each package with the package's explicit entry point(s) (e.g.,
'src/index.ts' or whatever the package's public export file(s) are) and restrict
project to the package TS source/glob or its tsconfig (so entry lists actual
public entry files and project points to the package source/tsconfig), updating
the corresponding package entries in js/app/knip.ts to those specific
files/globs to restore dead-code detection.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 603c01d2-93bf-4510-a624-91f6158fee62
⛔ Files ignored due to path filters (1)
js/app/bun.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
js/app/knip.tsjs/app/package.json
| ignore: [ | ||
| '**/generated/**', | ||
| 'scripts/**', | ||
| 'packages/loro-mirror/**', | ||
| 'packages/service-storage/**', | ||
| ], |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider consolidating packages/loro-mirror exclusion.
The packages/loro-mirror directory is excluded in both ignore (line 8) and ignoreWorkspaces (line 37). While this works, it's redundant:
ignore: Excludes files from analysisignoreWorkspaces: Excludes the workspace from workspace processing
If the intent is to completely skip this workspace, ignoreWorkspaces alone should suffice. Consider removing line 8 to reduce duplication.
♻️ Suggested simplification
ignore: [
'**/generated/**',
'scripts/**',
- 'packages/loro-mirror/**',
'packages/service-storage/**',
],Also applies to: 36-37
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@js/app/knip.ts` around lines 5 - 10, Remove the redundant exclusion of
"packages/loro-mirror" from the ignore array and rely only on the
ignoreWorkspaces setting to skip that workspace; specifically, delete the
"packages/loro-mirror/**" entry from the ignore array (the ignore array and the
ignoreWorkspaces setting are both present in js/app/knip.ts) so the workspace is
only excluded via ignoreWorkspaces, keeping configurations DRY.
| // Block packages and others consumed via tsconfig path aliases (no index.ts entry) | ||
| 'packages/block-canvas': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/block-channel': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/block-chat': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/block-code': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/block-image': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/block-md': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/block-pdf': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/block-project': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/block-unknown': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/block-video': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, | ||
| 'packages/channel': { | ||
| entry: ['**/*.{ts,tsx}'], | ||
| project: ['**/*.{ts,tsx}'], | ||
| }, |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Using broad wildcard entries for block packages.
The block packages use **/*.{ts,tsx} as both entry and project, which effectively treats all files as entry points. While this may be intentional for packages consumed via tsconfig path aliases (as noted in the comment), it means Knip won't detect unused exports within these packages.
If these packages grow, consider defining more specific entry points to enable better dead code detection within each package.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@js/app/knip.ts` around lines 63 - 107, The current Knip config uses broad
wildcards ('**/*.{ts,tsx}') for entry and project for packages like
'packages/block-canvas', 'packages/block-chat', 'packages/block-image',
'packages/block-md', 'packages/block-pdf', 'packages/block-project',
'packages/block-unknown', 'packages/block-video', 'packages/block-code',
'packages/block-channel', and 'packages/channel', which makes every file an
entry so Knip cannot detect unused exports; fix this by replacing the wildcard
entry/project for each package with the package's explicit entry point(s) (e.g.,
'src/index.ts' or whatever the package's public export file(s) are) and restrict
project to the package TS source/glob or its tsconfig (so entry lists actual
public entry files and project points to the package source/tsconfig), updating
the corresponding package entries in js/app/knip.ts to those specific
files/globs to restore dead-code detection.
No description provided.