feat(namespace): check heritage clauses against JSDoc types of JavaScript modules #632
All Vouch review confidence checks passed
Residual risk 0.19 = 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 · 213 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.321
Real PR Conversation Timeline
1 comments
"Review active on #632"
general
weight: 0.35
thekhegay
Closes #592
Since #567 heritage clauses (
interface X extends ns.Foo,class Y implements ns.Foo) skip JavaScript modules entirely, so typo in member of JS module isnt caught there. Now a non TS module (JS, or.mdxand such with their configured parser) is checked against its exports plus@typedef/@callbacknames from JSDoc comments of its AST, each read with existingparseComment, so no new dependency (question from the #567 thread). Names are read lazily, only when such clause hits such module, and cached per moduleTo avoid new false positives it still skips modules whose types may come from elsewhere: anything under
node_modules(own.d.ts,@types) and modules withexport. A.d.tsnext to module is resolver job, TS resolver already picks it over.jsTwo #567 valid cases (
ns.Tfromnamed-exports.js,b.Tthroughdeep/a) name nothing there, so they are invalid now, thats the precision coming back. Full suite 4033 pass<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
The
import-x/namespacerule recognizes JSDoc@typedefand@callbackdeclarations in local JavaScript modules when validating names used in heritage clauses.Missing names are reported when they are neither exported nor declared with a supported JSDoc tag. Package modules and modules using
exportare excluded from this validation.Documentation
* Updated the rule documentation to explain the JSDoc checks, exclusions, and how declaration-file selection depends on the resolver.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->