Repository navigation
chore: enable noUnusedLocals in schema, server, sdk and smaller packages - #52850
Merged
Merged
Conversation
This was referenced Oct 2, 2026
kitlangton
enabled auto-merge (squash)
October 2, 2026 22:23
Ichinose-Kazuki
pushed a commit
to Ichinose-Kazuki/opencode
that referenced
this pull request
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Every package tsconfig extends
@tsconfig/bun(or@tsconfig/node22), and those bases leavenoUnusedLocalsoff. Nobody turned it off on purpose, so unused imports, variables, types and helpers have been piling up without anyone noticing. This PR turns the flag on for the packages listed below.What Changes
tsconfig.json(tsconfig.build.jsonextends it)test/event-manifest.test.ts:Schemaimporttsconfig.json(tsconfig.build.jsonextends it)src/handlers/event.ts:Busimporttsconfig.jsontsconfig.jsonsrc/backend/simulated-provider.ts:JsonSchemaimporttsconfig.jsontsconfig.json(test/tsconfig.jsonextends it)RequestSnapshot/CassetteMetadatatype imports. Theexport type { … } fromre-exports staytsconfig.jsonsrc/index.ts: unusedconst [first, ...rest] = expanded.test/generated-consumer.ts: the type assertion_requiresHttpClientis now exported asrequiresHttpClientinstead of deleted, so the compile-time check still runstsconfig.jsonmarkdown-worker.ts: unusedinstancebinding. ThegetWorker()call stays because it starts the worker, same as inprojectMarkdown.session-review.tsx: unusedItemtypetsconfig.jsondecodeMermaidTextimport,GanttCellStyletype import,centeredStarthelper,stateDiagramNoteConnectorvalue import (the type import stays)tsconfig.jsonterminal/serialize.ts: write-only fields_lastCursorRow,_lastCursorColand_lastContentCursorCol, plus their assignmentstsconfig.jsonstats/app:formatModelRankMoveLabeland its only helperformatRankMove, plus theComparisonModelReftype importtsconfig.jsonNotable:
serialize.ts: in the upstream xterm serialize addon,_lastCursorRow/Colare used to put the cursor back in place. This port already does that differently: it writes a CUP sequence from the buffer's livecursorX/cursorY. That made the fields write-only, so removing them doesn't change output. Serializer tests pass.model-rank-panelthat renderedformatModelRankMoveLabel. Its i18n keys (model.noUsageLastWeek,model.newThisWeek,model.sameAsPreviousWeek,model.vsPreviousWeek) are now unused but are left alone here. If the rank-move label should come back, that is a separate fix.typecheckscript, and its tsconfig already fails with unrelated errors (unresolved@/…aliases and others). The flag is added for consistency, but nothing enforces it yet.identityandeffect-drizzle-sqlitehave no tsconfig, so they are unchanged.noUnusedParametersis still off.Scope
This is one of a series of PRs that turn on
noUnusedLocalspackage by package. It only touches the packages listed above.Verification
typechecks pass. Storybook reports no unused-local errors.bun run check:Tasks: 36 successful, 36 total.