Files
codegraph/__tests__
Colby Mchenry bf6995e911 fix(js): a JavaScript file's import of a TypeScript module links that module (#2674)
An extensionless import from a `.js` or `.jsx` file of a TypeScript module,
like mastodon's `import AudioModal from './audio_modal'` in modal_root.jsx
beside audio_modal.tsx, never resolved by path: the import resolver's
javascript and jsx extension lists held only JavaScript extensions, while
the typescript and tsx lists already try `.js`/`.jsx`. In a codebase
moving to TypeScript those imports were matched by name instead, so an
import under another name linked nothing, and a repeated name could link
the wrong file (mastodon's `<IconButton>` and `<Status>` tags rendered
other same-named components than the ones each file imports).

The javascript and jsx lists now try `.ts`/`.tsx` (and their index files)
after their own extensions, as a bundler and tsc's allowJs resolve them.
JavaScript stays first, so a `helpers.ts` beside `helpers.js` does not
take its importers, and never `.d.ts`, which is no module a JavaScript
file runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 19:12:04 +00:00
..