Skip to content

[Export Audit] Unused exported type OptionSourceResolver in src/commands/main-action.ts #2962

@github-actions

Description

@github-actions

API Surface Issue

Category

Unused export

Summary

  • File: src/commands/main-action.ts
  • Symbol: OptionSourceResolver
  • Line: 65
  • Issue: OptionSourceResolver is exported as a public type but is never imported by any other module in the codebase. It is only referenced internally within main-action.ts as the parameter type for createMainAction.

Evidence

Declaration (line 65):

export type OptionSourceResolver = (optionName: string) => string | undefined;

Usage within the same file only (line 73):

export function createMainAction(getOptionValueSource: OptionSourceResolver) {

Cross-file import search result:

$ grep -rn "OptionSourceResolver" src/ --include="*.ts" | grep -v "main-action.ts"
(no output — zero external consumers)

ts-prune did not surface this because the type is used within its own module, but a whole-word grep across all src/**/*.ts files confirms no other file imports it.

Recommended Fix

Remove the export keyword from the type declaration since it serves no external consumers:

// Before
export type OptionSourceResolver = (optionName: string) => string | undefined;

// After
type OptionSourceResolver = (optionName: string) => string | undefined;

If the type is intended to be part of a public API for external consumers (e.g., plugins or tests that call createMainAction directly), add documentation and a test that imports it.

Impact

  • Dead code risk: Low — it's just a type alias, no runtime overhead
  • Maintenance burden: Low — but exported types are implicitly "pinned" by semver; removing export later would be a breaking change if consumers exist

Detected by Export Audit workflow. Triggered by push to main on 2026-05-12

Generated by API Surface & Export Audit · ● 1M ·

  • expires on Jun 11, 2026, 12:16 AM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions