← Back to Pull requests

fix(no-duplicates): treat entry points declared in one shared declaration file as different modules #627

Open
unknown opened this pull request with 228 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 12, 2026 08:53 UTC
Author

Closes #308

Svelte bundles all entry points into one types/index.d.ts with declare module 'svelte' {}, declare module 'svelte/transition' {} and so on, and every exports subpath points types at that file. With TS resolver they all resolve to same path, so rule reported them as duplicates and autofix merged them into one import, which breaks the code

Now when imports with different specifiers resolve to same .d.ts / .d.mts / .d.cts, the file is parsed once (cached by mtime) and specifiers it declares with top level declare module become their own modules. Same specifier imported twice is still reported, considerQueryString and whitelist work as before. File is only parsed when one file imports more than one specifier that resolves there

Names come from parser AST, so comments around declare module dont matter, and if file cant be parsed rule groups by path like before. Docs now say svelte needs no whitelist, whitelist examples use made up ui-kit package so they stay correct. New specs fail without the change, full suite 4020 pass

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

Bug Fixes
The duplicate-import check now distinguishes package entry points that resolve to the same declaration file but declare separate modules. Imports from distinct entry points are no longer incorrectly reported as duplicates, while repeated imports of the same entry point are still reported and can be autofixed.
Documentation
Updated the rule documentation with examples explaining how distinct entry points are handled, including cases where the whitelist determines whether imports are treated as duplicates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 228 lines (+171 / -57) across 2 files Reviewer: thekhegay Review duration: 3106m
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 228 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.325
Real PR Conversation Timeline
1 comments
"Review active on #627"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 37.0% (MEDIUM) · Higher = larger blast radius
37.0%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19.7% · Safe to merge
19.7%