Skip to content

feat(devoid): types flag#4

Merged
ElijahKotyluk merged 6 commits intomainfrom
feat/types-flag
Jan 4, 2026
Merged

feat(devoid): types flag#4
ElijahKotyluk merged 6 commits intomainfrom
feat/types-flag

Conversation

@ElijahKotyluk
Copy link
Owner

@ElijahKotyluk ElijahKotyluk commented Jan 4, 2026

Adds a --types CLI flag for detecting unused TypeScript types.

Reports unused exported types and unused local types using syntax-based analysis.
Type analysis is isolated behind the --types flag and does not affect default behavior.

Includes initial CLI integration tests covering:

  • opt-in behavior
  • unused exported and local types
  • barrel type re-exports

@ElijahKotyluk ElijahKotyluk self-assigned this Jan 4, 2026
@ElijahKotyluk ElijahKotyluk added the enhancement New feature or request label Jan 4, 2026
@ElijahKotyluk ElijahKotyluk requested a review from Copilot January 4, 2026 03:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a --types flag feature to detect unused TypeScript types (exported and local). The implementation adds comprehensive type analysis capabilities while standardizing Node.js built-in module imports across the codebase by prefixing them with node:.

Key changes:

  • Added type analysis infrastructure with three new core modules for scanning, resolving, and analyzing TypeScript type usage
  • Implemented CLI support for the --types flag with corresponding output formatting
  • Standardized all Node.js built-in imports (fs, path, os, child_process) to use the node: prefix convention

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/core/type/scanTypeExports.ts New module to scan and collect type exports from TypeScript files
src/core/type/resolveTypeExportGraph.ts New module to resolve type export chains including barrel re-exports
src/core/type/buildTypeUsageGraph.ts New module to build comprehensive type usage analysis across project files
src/core/type/analyzeTypeUsage.ts New module for per-file type declaration and reference analysis
src/cli/typesFormat.ts New formatting utilities for displaying unused type results
src/cli/index.ts CLI integration for --types flag with conditional type analysis execution
tests/cli/cli.types.test.ts Comprehensive test coverage for --types flag functionality
tests/cli/fixtures/types/* Test fixtures demonstrating type usage scenarios
tests/cli/utils/runCLI.ts Added debug logging and standardized import
src/core/usage/buildUsageGraph.ts Import standardization to node:path
src/core/imports/buildImportGraph.ts Import standardization to node:path
src/core/fileSystem/* Import standardization to node:fs and node:path
src/core/exports/resolveExportGraph.ts Import standardization to node:path
src/core/entrypoints/detectEntryPoints.ts Import standardization to node:fs and node:path
src/core/tsconfig/tsconfigLoader.ts Import standardization to node:path
src/cli/internalMode.ts Import standardization to node:fs
tests/**/*.test.ts Import standardization across all test files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ElijahKotyluk ElijahKotyluk marked this pull request as ready for review January 4, 2026 04:13
@ElijahKotyluk ElijahKotyluk merged commit ce94f24 into main Jan 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants