Skip to content

#313 Fix/Incorrectly suggesting removal of module used in TYPE_CHECKING#319

Merged
hakancelikdev merged 1 commit intomainfrom
fix/type-checking-import-313
Feb 18, 2026
Merged

#313 Fix/Incorrectly suggesting removal of module used in TYPE_CHECKING#319
hakancelikdev merged 1 commit intomainfrom
fix/type-checking-import-313

Conversation

@hakancelikdev
Copy link
Owner

No description provided.

@hakancelikdev hakancelikdev force-pushed the fix/type-checking-import-313 branch from ba33959 to 1e0a4e4 Compare February 18, 2026 05:05
…ort (#313)

Register TYPE_CHECKING-guarded imports with is_type_checking flag instead of
skipping them entirely. TC imports use read-only matching (match_2) so they
don't interfere with runtime import resolution, and are excluded from
duplicate detection. Genuinely unused TC imports are still detected and removed.

When all TC-guarded imports are unused, the TYPE_CHECKING import itself and
the empty if-block are also removed automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hakancelikdev hakancelikdev force-pushed the fix/type-checking-import-313 branch from 1e0a4e4 to d728ffd Compare February 18, 2026 05:32
@hakancelikdev hakancelikdev merged commit d1670b2 into main Feb 18, 2026
35 checks passed
@hakancelikdev hakancelikdev deleted the fix/type-checking-import-313 branch February 18, 2026 05:52
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