← Back to Pull requests

chore: bump prettier to v3.10.0 and fix no-rename-default for wrapped assignments #614

Closed
unknown closed this pull request without merging on Nov 12, 2026 08:35 UTC
View on GitHub
unknown unknown commented on Nov 10, 2026 09:14 UTC
Author

Summary

Bump prettier to 3.10.0 and fix the no-rename-default gap that the new version exposes.

Prettier

  • devDependencies.prettier: ^3.6.1 → ^3.10.0

  • removed resolutions.prettier (^3.5.3); every dependent range is satisfied by ^3.9.10, so the lockfile resolves a single prettier@3.10.0

  • reformatted sources and docs (src/*, test/utils/.spec.ts, docs/rules/.md, README.md, fixtures); the rule docs table was regenerated with yarn update:eslint-docs because 3.9 escapes inside table cells
  • no-rename-default fix

    Prettier 3.9 formats export default fn = function () {} as export default (fn = function () {}). The module lexer only recognised the assignment form at opened === 0, so a parenthesized assignment fell through to the closing-paren check, getDefaultExportSourceName() returned undefined, and the rule silently stopped reporting — a false negative that would hit any repo formatted with prettier 3.9.

    src/core/module-lexer.ts now derives the name from the wrapped form too, but only when:

  • plain parentheses wrap the whole assignment (not a call argument: withHoc(fn = 1) has no name)

  • nothing continues past the parentheses, and further wrappers close right after it (export default (fn = 1) + 1 and export default ((fn = 1) + 1) have no name)

  • the wrapped expression is not a sequence (export default (fn = 1, bar) has no name)

  • the right-hand side has no strings/templates//, which can't be balanced without a tokenizer (same fail-open tradeoff as skipToCallClose)
  • All of which mirrors what the AST route reports. The assign- fixtures are no longer in .prettierignore, so they are formatted (and now parenthesized) and cover the new branch end-to-end; paren-assign-continued.js, paren-sequence.js and call-assign.js cover the shapes that must stay silent, and test/utils/module-lexer.spec.ts pins the shapes prettier can't produce (((fn = 1)), ((fn = 1) + 1), quotes, nested brackets).

    Verification

    | Command | Result |
    | --- | --- |
    | yarn install --immutable | exit 0 |
    | prettier --check . | passed |
    | yarn lint (lint:docs, lint:es, lint:tsc) | exit 0 |
    | yarn test | 3863 passed, 1 skipped |

    Before the fix, formatting the fixtures made test/rules/no-rename-default.spec.ts fail with Should have 1 error but had 0; it now passes, and every new line/branch in module-lexer.ts is covered (the only uncovered lines left there are pre-existing).

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

    Summary by CodeRabbit

    Bug Fixes
    Improved default-export name detection for assignments wrapped in parentheses, including function and class assignments. Strings and comments are handled more reliably; assignments that are part of larger expressions, sequences, or call arguments remain unrecognized.
    Chores
    Updated the development formatter and removed an older version override.
    Style
    Applied formatting-only updates to documentation, examples, and tests. These changes do not alter documented settings or test behavior.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Follow-ups from review

  • no-rename-default masking now matches strings and comments in one pass: an apostrophe inside a comment (` export default connect(a)(/ don't / Comp) ) paired with a quote in a later statement and swallowed the name; // / / inside a string no longer opens a comment either. Covered by reads comments and strings in one pass.

  • literals the masking pass cannot balance (a line continuation, or the 512-character slice cutting one in half) used to leave their quotes behind, so a ) inside them closed the wrapper and the rule reported a name that does not exist — both scanners now give up on any quote left after masking.

  • the inline comment about call arguments was wrong (resolveDefaultName names withHoc(Foo = 1) through arguments[0]`; the lexer gives up on it, which is a documented fail-open corner) — reworded.
  • Diff: 512 lines (+384 / -128) across 6 files Reviewer: thekhegay Review duration: 2841m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 512 lines diff across 6 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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
    Diff Size diff_size
    0.373
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #614"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 47.6% (MEDIUM) · Higher = larger blast radius
    47.6%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 18.8% · Safe to merge
    18.8%