Skip to content

types: remove an unused import and check unused locals like VS Code - #611

Merged
Connor Peet (connor4312) merged 2 commits into
mainfrom
fbrancasi/remove-unused-target-import
Nov 18, 2026
Merged

Connor Peet (connor4312) merged 2 commits into
mainfrom
fbrancasi/remove-unused-target-import

Conversation

@federicobrancasi

Copy link
Copy Markdown
Member

#604 removed the doc link from AutomationDefinitionPatch.target to AutomationNewSessionTarget, but types/channels-automation/actions.ts still imports it. AHP's typecheck allows that, but VS Code compiles the synced types with noUnusedLocals, so syncing #604 into VS Code fails with TS6196.

  • Removes the unused import.
  • Turns on the checks VS Code uses for these files in types/tsconfig.json: noUnusedLocals, noImplicitReturns, noImplicitOverride, noUncheckedSideEffectImports and allowUnreachableCode: false, so a change that would break the VS Code sync now fails here first.
  • Exports the eight _Check… assertions in types/version/message-checks.ts so they still count as used. Nothing imports that file and the package entry doesn't re-export it, so the public API is unchanged. VS Code's sync skips it.

No protocol change: npm run generate produces no changes, so there is no changelog fragment.

Validation:

  • npm run typecheck with the old import put back: fails with TS6196 on AutomationNewSessionTarget, so the new settings catch this case.
  • npm run generate: no changes.
  • npm test: 667 passing.
  • clients/typescript: npm test, 79 passing.
  • Synced into VS Code with scripts/sync-agent-host-protocol.ts, then pnpm run typecheck-client: passed.

AutomationDefinitionPatch.target no longer links AutomationNewSessionTarget, so its import is unused. Consumers that copy the types with unused-import checks, such as VS Code, fail to compile.

Co-authored-by: Copilot <[email protected]>
VS Code compiles the synced types with noUnusedLocals, noImplicitReturns, noImplicitOverride, noUncheckedSideEffectImports and allowUnreachableCode: false, so a type that passes here can still break its sync. Turn the same checks on here. The message map assertions are exported so they still count as used; nothing imports this file.

Co-authored-by: Copilot <[email protected]>
@connor4312
Connor Peet (connor4312) merged commit 1928cd4 into main Nov 18, 2026
9 checks passed
@connor4312
Connor Peet (connor4312) deleted the fbrancasi/remove-unused-target-import branch November 18, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants