chore(daemon): enable noUnusedLocals + noUnusedParameters - #6130
chore(daemon): enable noUnusedLocals + noUnusedParameters#6130arseniy-gl wants to merge 2 commits into
Conversation
…olations Add the two tsconfig flags to apps/daemon/tsconfig.json and fix all resulting violations across src/ (41) and tests/ (18): - Remove dead imports (unused functions, types, constants) - Remove dead variables and function declarations - Remove unused destructured properties - Remove one copy-pasted dead createSession() call in pi-rpc tests No behavioral changes — all removals are provably dead code (each identifier had zero references beyond its declaration). Relates to nexu-io#6084. First slice of the lint rollout plan.
|
Hey @arseniy-gl — thanks for spinning this into the first slice from #6084. Keeping the rollout daemon-scoped and focused on dead-code cleanup is a sensible way to land the stricter check without turning this into a repo-wide lint sweep. I’m routing this to the next reviewer now.
|
| "skipLibCheck": true, | ||
| "types": ["node", "vitest"] | ||
| "types": ["node", "vitest"], | ||
| "noUnusedLocals": true |
There was a problem hiding this comment.
The changed config only enables noUnusedLocals, but this PR title/body and the surrounding cleanup are explicitly about rolling out both noUnusedLocals and noUnusedParameters. Because noUnusedParameters is still absent here, the daemon build will continue to accept unused parameters and this slice does not actually enforce half of the intended check going forward. Please add "noUnusedParameters": true in this compilerOptions block and rerun the daemon typecheck/tests so any remaining parameter violations are fixed in the same PR.
|
Hey @arseniy-gl — @nettee's blocking review covers the current blocker on this head: Once that flag is added and the daemon typecheck/tests are rerun cleanly, this should be in good shape for another pass. |
|
@arseniy-gl friendly reminder: this PR appears to be waiting on author action (outstanding trusted reviewer or maintainer feedback, failing CI) and has had no human activity for more than 3 days. When you have a chance, please reply here or push an update. To keep the queue manageable, PRs with no human activity for more than 5 days may be closed automatically, but they can be reopened when work resumes. |
Address review feedback: the initial commit only added noUnusedLocals but missed noUnusedParameters. This adds the flag and fixes all resulting violations — prefixing unused params with _ where they are required by interface/callback signatures.
nettee
left a comment
There was a problem hiding this comment.
@arseniy-gl I rechecked the daemon tsconfig rollout on the current head and verified the missing noUnusedParameters flag is now present alongside the follow-up underscore renames needed to satisfy it. The remaining diff is cleanup-only dead-code removal across daemon source and tests, and I did not find any changed-range correctness or maintainability regressions in this pass. Local pnpm --filter @open-design/daemon typecheck verification was not runnable in the prepared worktree because the checkout does not include installed workspace dependencies (esbuild was missing under packages/contracts), so this approval is based on the live diff review plus the PR's reported validation. Nice cleanup pass and good follow-through on the earlier review feedback.
Relates to #6084
Why
The project has no lint coverage for dead code — LLM-assisted development leaves unused imports, variables, and functions behind after refactoring. This is the first slice of the lint rollout plan agreed in #6084: enable
noUnusedLocals+noUnusedParametersin the daemon tsconfig and fix all resulting violations.What users will see
No user-facing changes. This is a code hygiene change — all removals are provably dead code (each identifier had zero references beyond its declaration).
Surface area
Bug fix verification
Not a bug fix — no red spec needed.
Validation
pnpm --filter @open-design/daemon typecheck— clean (bothtsconfig.jsonandtsconfig.tests.json)pnpm --filter @open-design/daemon test— all 14 modified test files pass (421 tests). 17 pre-existing failures onmainare unrelated (tracked in Daemon test suite: 17 pre-existing failures on main, CI runs only 1 of 484 test files #6127); no new failures introduced.What changed
tsconfig: Added
noUnusedLocals: trueandnoUnusedParameters: truetoapps/daemon/tsconfig.json.src/ (24 files): Removed dead imports, unused constants, unused type declarations, and 4 dead function declarations (
uniqueSlug,validateProvenance,possibleDsmlArtifactOpenStart/possibleArtifactCloseStart,fetchVelaModelsWithRetry,readLastSummary). Cascade cleanup freed additional orphaned constants inlive-artifacts/schema.tsandmcp-routes.ts.tests/ (14 files): Removed dead imports and one copy-pasted
createSession()call inpi-rpc.test.tsthat was shadowed by the test's own setup.Next slices (from #6084 plan)
@typescript-eslint/no-floating-promises(introduces minimal ESLint config)react-hooks/exhaustive-deps@typescript-eslint/no-unsafe-assignmentnoUnusedLocals+noUnusedParametersforapps/web(141 violations) and other packages