Repository navigation
Closed
Labels
Description
Summary
Add optional unused export detection to /qa phase using stack-specific tooling. Catches dead code that accumulates over time.
Problem
Codebases accumulate unused exports:
- Functions that were refactored but not removed
- Types exported "just in case"
- Components that are no longer used
- API endpoints with no callers
These increase bundle size, confuse developers, and create maintenance burden.
Proposed Solution
Stack-Specific Tools
| Stack | Tool | Command |
|---|---|---|
| TypeScript/JS | knip |
npx knip --reporter compact |
| TypeScript | ts-unused-exports |
npx ts-unused-exports tsconfig.json |
| Python | vulture |
vulture src/ |
| Go | unused (staticcheck) |
staticcheck -checks U1000 ./... |
| Rust | cargo-udeps |
cargo +nightly udeps |
Opt-in Configuration
Since this requires tool installation and can be noisy, make it opt-in:
// .sequant/settings.json
{
"qa": {
"unusedExports": {
"enabled": true,
"tool": "knip", // or auto-detect
"ignorePatterns": ["**/*.d.ts", "**/index.ts"]
}
}
}Integration Points
- Init time:
sequant initasks if user wants unused export detection - First run: If enabled but tool not installed, prompt to install
- QA phase: Run tool and report findings
Output Format
## Unused Exports Check
Found 3 unused exports:
| File | Export | Type |
|------|--------|------|
| src/utils/format.ts | `formatCurrency` | function |
| src/types/legacy.ts | `OldUserType` | type |
| src/components/Button.tsx | `ButtonVariant` | type |
**Suggestions:**
- Remove if truly unused
- Add to ignore list if intentionally exported (e.g., public API)
- Check if used in tests only (may indicate missing integration)Acceptance Criteria
- Settings schema supports unused export configuration
- Detection works for TypeScript/JavaScript (primary stack)
- Tool installation prompted if missing
- Ignore patterns supported
- Clear output showing unused exports
- Documentation for enabling per-stack
Future Enhancements
- Auto-fix option (remove unused exports)
- Integration with tree-shaking analysis
- Historical tracking (new unused exports vs existing)
Notes
This is explicitly opt-in because:
- Requires external tool installation
- Can be noisy in early development
- Some exports are intentionally public API
- Different projects have different tolerance
Activity
admarble commentedon Jan 14, 2026
Deferring - adds complexity (external tool dependencies, stack-specific config) for marginal value. Can revisit if dead code becomes a significant problem.