fix(eslint-plugin): wrap parenthesized concise arrow bodies without leaving stray parens#8887
Conversation
…eaving stray parens
🦋 Changeset detectedLatest commit: cf42913 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
insertProtectCallFixwrapped a concise arrow body withfixer.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 bulkclerk-next-fix-auth-protectionrunner (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 validasync () => { 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.