Skip to content

fix(eslint-plugin): wrap parenthesized concise arrow bodies without leaving stray parens#8887

Open
jacekradko wants to merge 1 commit into
fredrik/add-lint-rule-suggestionsfrom
jacek/fix-eslint-plugin-paren-concise-body
Open

fix(eslint-plugin): wrap parenthesized concise arrow bodies without leaving stray parens#8887
jacekradko wants to merge 1 commit into
fredrik/add-lint-rule-suggestionsfrom
jacek/fix-eslint-plugin-paren-concise-body

Conversation

@jacekradko

Copy link
Copy Markdown
Member

insertProtectCallFix wrapped a concise arrow body with fixer.replaceText(body, ...), but a body node's range excludes the parentheses around it. So () => ({ ok: true }) and () => (<div/>) came out as () => ({ ...block... }), which doesn't parse. Through the bulk clerk-next-fix-auth-protection runner (which applies suggestions by raw splice, no parse guard) that means a silent write of broken source, reported as a clean fix, with the protection dropped.

The fix replaces the whole span after => instead of just the body node, so the wrapping parens go with the old body. Added RuleTester cases for the parenthesized object and JSX shapes, and confirmed end to end that the CLI now rewrites both to a valid async () => { await auth.protect(); return ...; } and that a re-run is a no-op.

Empty changeset since the rule is still unreleased on this branch; the existing feature changeset already covers it.

@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cf42913

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jun 17, 2026 2:36am
swingset Ready Ready Preview, Comment Jun 17, 2026 2:36am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 5fed66a1-8da0-4416-9ff1-5730d2c7d9b7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant