← Back to Pull requests

fix(no-default-export, no-named-export): treat `export * as default from` as a default export #648

Open
unknown opened this pull request with 166 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 22, 2026 05:50 UTC
Author

export as default from './foo' (ES2020) creates a default export, but both rules treat it as a named one:

  • no-default-export does not report it, because it only checks ExportDefaultDeclaration and ExportNamedDeclaration specifiers.

  • no-named-export reports it as noAllowed, because it flags every ExportAllDeclaration.
  • Fix: check node.exported on ExportAllDeclaration. If its value (identifier or string literal) is default, no-default-export now reports preferNamed (same loc as the other cases) and no-named-export lets it through. export from and export as foo from keep their current behaviour.

    Tests: added cases for export as default from and export as "default" from (espree, ecmaVersion 2022) in both specs, plus export as foo from as 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 default as 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 -->

    Diff: 166 lines (+124 / -42) across 2 files Reviewer: thekhegay Review duration: 12156m
    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
    0.40
    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%
    42%
    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.306
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #648"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% 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: 40.1% (MEDIUM) · Higher = larger blast radius
    40.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: 43.0% · Lower = rushed or shallow review
    43.0%
    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: 22.9% · Safe to merge
    22.9%