diff --git a/codeflash/languages/javascript/import_resolver.py b/codeflash/languages/javascript/import_resolver.py index 4e237b8d6..740768067 100644 --- a/codeflash/languages/javascript/import_resolver.py +++ b/codeflash/languages/javascript/import_resolver.py @@ -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