chore: bump prettier to v3.10.0 and fix no-rename-default for wrapped assignments #614
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
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
thekhegay
Summary
Bump
prettierto3.10.0and fix theno-rename-defaultgap that the new version exposes.Prettier
devDependencies.prettier:^3.6.1→^3.10.0resolutions.prettier(^3.5.3); every dependent range is satisfied by^3.9.10, so the lockfile resolves a singleprettier@3.10.0src/*,test/utils/.spec.ts,docs/rules/.md,README.md, fixtures); the rule docs table was regenerated withyarn update:eslint-docsbecause 3.9 escapesinside table cellsno-rename-defaultfixPrettier 3.9 formats
export default fn = function () {}asexport default (fn = function () {}). The module lexer only recognised the assignment form atopened === 0, so a parenthesized assignment fell through to the closing-paren check,getDefaultExportSourceName()returnedundefined, and the rule silently stopped reporting — a false negative that would hit any repo formatted with prettier 3.9.src/core/module-lexer.tsnow derives the name from the wrapped form too, but only when:withHoc(fn = 1)has no name)export default (fn = 1) + 1andexport default ((fn = 1) + 1)have no name)export default (fn = 1, bar)has no name)/, which can't be balanced without a tokenizer (same fail-open tradeoff asskipToCallClose)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.jsandcall-assign.jscover the shapes that must stay silent, andtest/utils/module-lexer.spec.tspins 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.tsfail withShould have 1 error but had 0; it now passes, and every new line/branch inmodule-lexer.tsis 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-defaultmasking 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 byreads comments and strings in one pass.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.nameswithHoc(Foo = 1)througharguments[0]`; the lexer gives up on it, which is a documented fail-open corner) — reworded.