Skip to content

javascript: resolve imports through jsconfig/tsconfig paths aliases - #1749

Merged
swapnilpaliwal-sd merged 1 commit into
0.1.8from
loop/ja-js-path-alias-unresolved
Sep 29, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
0.1.8from
loop/ja-js-path-alias-unresolved

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

An import through a jsconfig/tsconfig compilerOptions.paths alias (@/lib/x, ~/models/x) in a JavaScript project was unresolved, so calls to plain imported functions came out [by name] ("receiver not typed").

  • The JS analyzer now reads baseUrl / paths from the nearest tsconfig.json or jsconfig.json above each file (extends followed, no directory listing) and passes them to the module resolver.
  • Golden case 70-jsconfig-path-alias: @/ via jsconfig baseUrl+paths, ~/ via a nearer tsconfig paths only; control: a directory whose nearest jsconfig maps nothing stays unresolved, and a relative import is unchanged.
  • Parser test path aliases resolve through the nearest config.

Checked: fixture 1 → 3 known edges (control still unknown, oracle 0 defects); on two real apps (Next-style @/, Remix ~/) 6 [by name] callers → [resolved], already-resolved callers unchanged, index time 2.9s → 3.0s. JS golden suite 79/79, parser JS tests 49/49.

….paths aliases

An import spelled through a paths alias ('@/lib/x', '~/models/x') was
UNRESOLVED_MISSING, so a call to a plain imported function came out by
name. The analyzer now reads baseUrl/paths from the nearest tsconfig.json
or jsconfig.json above each file (extends followed) and hands them to the
module resolver. Golden case 70 adds both alias shapes and a control
directory whose nearest config maps nothing.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 12d1574 into 0.1.8 Sep 29, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the loop/ja-js-path-alias-unresolved branch September 29, 2026 03:50
@swapnilpaliwal-sd swapnilpaliwal-sd mentioned this pull request Sep 29, 2026
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.

1 participant