Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions codeflash/languages/javascript/import_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,20 +301,11 @@ def _is_external_package(self, module_path: str) -> bool:

"""
# Relative imports are not external
if module_path.startswith("."):
return False

# Absolute imports (starting with /) are project-internal
if module_path.startswith("/"):
return False

# @/ is a common path alias in Next.js/TypeScript projects mapping to project root
# These are internal imports, not external npm packages
if module_path.startswith("@/"):
return False

# ~/ is another common path alias pattern
if module_path.startswith("~/"):
if module_path.startswith((".", "/", "@/", "~/")):
return False

# Bare imports without ./ or ../ are external packages
Expand Down
Loading