← Back to Pull requests

fix: classify resolved paths correctly when the linted file is reached through a symlink #631

Open
unknown opened this pull request with 256 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 12, 2026 09:52 UTC
Author

Refs #490

When ESLint gets the linted file through a symlink (VS Code opened on symlinked worktree, its cwd and filenames are the link) and the resolver returns real paths, package root came from the symlinked filename and never contained the real resolved path. So internal files were classed external: no-extraneous-dependencies and order misreported them, and no-relative-parent-imports misreported aliases

Now isExternalPath / isInternalPath compare a resolved path that falls outside the package path with the real path of the package's package.json (cached once per package), and in that case no-relative-parent-imports takes real path of the linted file before path.relative. Without symlinks nothing changes: a path inside the package returns before any fs call

Ran same files through real path and through a symlink with 8 resolver setups (ts legacy/next/project, node, webpack): messages that showed up only via the link went from 26 / 22 / 34 (no-extraneous-dependencies / order / no-relative-parent-imports) to 0, real path counts are identical to master. Plain realpathSync at those lines, as suggested in the issue, made no-relative-parent-imports worse (34 to 64), thats why the linted file is resolved too

Not covered: no-cycle, no-self-import, no-restricted-paths, no-duplicates still miss some real reports through a symlink, same as master, and no-unresolved from the issue didnt reproduce. Full suite 4037 pass

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

Summary by CodeRabbit

Bug Fixes
Fixed import classification and parent-relative import checks when files or packages are accessed through symlinks. Imports are evaluated using the resolved file location, including when package metadata is symlinked.
* Corrected checks for imports that resolve within or outside a project, including aliased imports and deeply nested relative paths.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 256 lines (+192 / -64) across 3 files Reviewer: thekhegay Review duration: 3047m
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 256 lines diff across 3 files
0.39
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.332
Real PR Conversation Timeline
1 comments
"Review active on #631"
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: 39.1% (MEDIUM) · Higher = larger blast radius
39.1%
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: 20.8% · Safe to merge
20.8%