Skip to content

Conversation

@codewithkenzo
Copy link
Owner

@codewithkenzo codewithkenzo commented Feb 3, 2026

Removed .js extensions from 6 TypeScript files:

  • src/cli.ts
  • src/generator.ts
  • src/ai/enhancer.ts
  • src/commands/api.ts
  • src/commands/readme.ts
  • src/commands/watch.ts

Scout-detected fix.

Greptile Overview

Greptile Summary

Removed .js extensions from TypeScript imports across 6 files to align with moduleResolution: "bundler" configuration. This is the correct approach for Bun/bundler-based projects using TypeScript.

Changes:

  • src/cli.ts: Updated 5 internal imports
  • src/generator.ts: Updated 3 internal imports
  • src/commands/api.ts: Updated 2 internal imports
  • src/commands/readme.ts: Updated 1 import
  • src/commands/watch.ts: Updated 2 internal imports
  • src/ai/enhancer.ts: Updated 1 type-only import

All modified imports point to existing files, and the changes are consistent with TypeScript best practices for bundler-based module resolution.

Confidence Score: 5/5

  • Safe to merge - syntax-only changes with no logic impact
  • Perfect mechanical refactor removing .js extensions from TS imports. Changes align with tsconfig moduleResolution: "bundler" setting. All imports verified to exist. Zero logic changes, zero risk.
  • No files require special attention

Important Files Changed

Filename Overview
src/ai/enhancer.ts Removed .js extension from commits parser import - correct for bundler moduleResolution
src/cli.ts Removed .js extensions from 5 internal imports - aligns with TypeScript best practices
src/commands/api.ts Removed .js extensions from config and typescript parser imports - consistent with project setup
src/commands/readme.ts Removed .js extension from config import - matches bundler resolution strategy
src/commands/watch.ts Removed .js extensions from api and readme command imports - proper TS syntax
src/generator.ts Removed .js extensions from 3 internal imports - appropriate for bundler moduleResolution

Sequence Diagram

sequenceDiagram
    participant TS as TypeScript Compiler
    participant Bundler as Bun Bundler
    participant FS as File System
    
    Note over TS,FS: Before: import from './module.js'
    TS->>Bundler: Resolve './module.js'
    Bundler->>FS: Look for module.ts (strips .js)
    FS-->>Bundler: Returns module.ts
    Bundler-->>TS: Module resolved
    
    Note over TS,FS: After: import from './module'
    TS->>Bundler: Resolve './module'
    Bundler->>FS: Look for module.ts
    FS-->>Bundler: Returns module.ts
    Bundler-->>TS: Module resolved
    
    Note over TS,Bundler: moduleResolution: "bundler"<br/>eliminates need for .js extensions
Loading

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