Skip to content

Conversation

@seveibar
Copy link
Contributor

Summary

  • skip import type statements when collecting dependency names
  • add a regression test to ensure type-only imports do not trigger circular detection

Testing

  • bun test tests/features/import-type-does-not-cause-circular.test.tsx
  • bunx tsc --noEmit

https://chatgpt.com/codex/tasks/task_b_68f7fa6cb194832e94af7cc15f816ee3

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 9 to 14
while ((match = importRegex.exec(code)) !== null) {
const fullMatch = match[0]
if (/^\s*import\s+type\b/.test(fullMatch)) {
continue
}
imports.push(match[1])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle inline type-only imports

The new filter only skips statements that literally start with import type, but TypeScript also allows pure type imports in the form import { type Foo } from "./foo". For those statements the regex still pushes the module name because the line begins with import {, so type-only dependencies remain in the returned list and continue to trigger circular-detection logic despite having no runtime dependency. Consider detecting inline type specifiers (when the statement contains only type bindings) before pushing the import name.

Useful? React with 👍 / 👎.

@seveibar seveibar merged commit a09b0cf into main Oct 22, 2025
35 of 43 checks passed
@seveibar seveibar deleted the codex/allow-deferred-fetching-for-type-imports branch October 22, 2025 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant