Skip to content

remove unused exports and imports - #59673

Merged
rekram1-node merged 1 commit into
v1from
v1-remove-unused-exports
Oct 27, 2026
Merged

rekram1-node merged 1 commit into
v1from
v1-remove-unused-exports

Conversation

@rekram1-node

Copy link
Copy Markdown
Contributor

Problem

A few exports in packages/opencode/src have no callers anywhere in the repo, and a bunch of files carry imports they never use.

Change

Cleanup only, no behavior change.

 installation/index.ts
-  getReleaseType, isPreview, ReleaseType
 util/repository.ts
-  isRepositoryError, RepositoryError
 util/filesystem.ts
-  readArrayBuffer
 server/shared/ui.ts
-  DEFAULT_CSP
 config/markdown.ts
-  fallbackSanitization

ReleaseType and RepositoryError were only used by the removed functions. I grepped the whole repo for each name first.

For unused imports I only removed two kinds, since verbatimModuleSyntax keeps value imports at runtime:

Kind Removed?
import type { X } with no use yes, erased at runtime anyway
unused name inside an import that keeps other names yes, module still loads
whole value import with no other names no, dropping it can change module load order

Out of scope

The whole value imports (for example MessageV2 in session/retry.ts, SessionV2 in session/session.ts) are left alone. patch/, acp/ and tool/tool.ts are untouched.

Verification

  • bun typecheck in packages/opencode passes
  • bun test test/tool/glob.test.ts test/tool/grep.test.ts test/tool/write.test.ts test/agent/agent.test.ts in packages/opencode: 66 pass

@rekram1-node rekram1-node changed the title chore(opencode): remove unused exports and imports remove unused exports and imports Oct 27, 2026
@rekram1-node
rekram1-node merged commit da6dbeb into v1 Oct 27, 2026
10 of 11 checks passed
@rekram1-node
rekram1-node deleted the v1-remove-unused-exports branch October 27, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant