Skip to content

Remove .js extensions from all import statements#284

Open
rulkens wants to merge 2 commits into
mainfrom
claude/tools-js-imports-5rndz
Open

Remove .js extensions from all import statements#284
rulkens wants to merge 2 commits into
mainfrom
claude/tools-js-imports-5rndz

Conversation

@rulkens
Copy link
Copy Markdown
Owner

@rulkens rulkens commented Jun 7, 2026

Summary

This change removes .js file extensions from all ES module import statements across the codebase. This aligns with TypeScript and Node.js best practices for ESM imports, where the file extension is optional and omitting it improves readability and maintainability.

Changes

  • Removed .js extensions from all import and export statements in:

    • Build pipeline files (tools/catalog/, tools/clusters/, tools/famous/, tools/filaments/)
    • Famous curator plugin routes and utilities
    • Parser modules (tools/parsers/)
    • Utility modules (tools/curation/, tools/fetch/)
    • Test files (tests/tools/)
  • Affected file categories:

    • Build orchestration: buildAllBins.ts, buildClusters.ts, buildFamous.ts, buildFilaments.ts
    • Famous curator: export.ts, process.ts, processAlphaOnly.ts, galaxies.ts, paths.ts, resolve.ts
    • Parsers: glade.ts, sdssCsv.ts, milliquas.ts, twoMrs.ts, common.ts, parseMcxc.ts, parseMscc.ts
    • Utilities: expandFamousFromCatalogs.ts, fetchFamousImages.ts, copyHiResToPublic.ts, subsampleByAbsMag.ts, crossMatch.ts, dedupeByProximity.ts, fetchClusterCatalogs.ts
    • Tests: dedupeByProximity.test.ts, writeMetaSidecar.test.ts, cropExtract.test.ts, process.deproject.test.ts, process.test.ts

Implementation Details

  • All relative imports (e.g., '../parsers/sdssCsv.js''../parsers/sdssCsv') and absolute imports from src/ were updated consistently
  • Type-only imports were preserved as-is (e.g., import type { ... })
  • Re-exports were updated to match (e.g., export { ... } from './module.js'export { ... } from './module')
  • No functional changes; this is purely a stylistic/convention alignment pass

This change improves code consistency with modern TypeScript/ESM conventions and reduces visual noise in import statements.

https://claude.ai/code/session_01NPgAWpowSi9a9m5jUtSJhx

claude added 2 commits June 1, 2026 18:50
The repo uses moduleResolution: "bundler" and writes extension-less
relative imports everywhere (src/ has zero .js suffixes). The tools/
tree had drifted to NodeNext-style .js specifiers on 131 imports across
24 files. Strip the suffix to match the project convention; these all
resolved to local .ts files (no real .js files exist in tools/ or src/).

Typecheck (both tsconfigs) and the full 2209-test suite stay green.
Finish the consistency pass started in tools/: strip the NodeNext-style
.js suffix from the 6 remaining relative imports under tests/ so the
whole repo matches the moduleResolution: "bundler" convention.

Typecheck and the full 2209-test suite stay green.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
skymap c442407 Commit Preview URL

Branch Preview URL
Jun 01 2026, 07:04 PM

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