fix(no-default-export, no-named-export): treat `export * as default from` as a default export #648
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 166 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.306
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #648"
general
weight: 0.35
thekhegay
export as default from './foo'(ES2020) creates a default export, but both rules treat it as a named one:no-default-exportdoes not report it, because it only checksExportDefaultDeclarationandExportNamedDeclarationspecifiers.no-named-exportreports it asnoAllowed, because it flags everyExportAllDeclaration.Fix: check
node.exportedonExportAllDeclaration. If its value (identifier or string literal) isdefault,no-default-exportnow reportspreferNamed(same loc as the other cases) andno-named-exportlets it through.export fromandexport as foo fromkeep their current behaviour.Tests: added cases for
export as default fromandexport as "default" from(espree, ecmaVersion 2022) in both specs, plusexport as foo fromas a control. The new cases fail before the change and pass after it. Changeset included.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Corrected export rules to recognize
export as defaultas a default export and apply the appropriate named-export checks.Namespace re-exports with other names continue to follow the existing rule behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->