Skip to content

fix(ts/formatter): format comment after => in arrow functions#9527

Merged
dyc3 merged 3 commits intobiomejs:mainfrom
mdm317:fix/ts-arrow-after-comment
Mar 17, 2026
Merged

fix(ts/formatter): format comment after => in arrow functions#9527
dyc3 merged 3 commits intobiomejs:mainfrom
mdm317:fix/ts-arrow-after-comment

Conversation

@mdm317
Copy link
Contributor

@mdm317 mdm317 commented Mar 17, 2026

This PR was created with Codex assistance.

fixes: #8959

Summary

Made formatting consistent for comments right after => in TypeScript arrow return types.

Test Plan

Added test code.

@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2026

🦋 Changeset detected

Latest commit: fa20000

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

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

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

@github-actions github-actions bot added A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages labels Mar 17, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 17, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 156 skipped benchmarks1


Comparing mdm317:fix/ts-arrow-after-comment (fa20000) with main (61f53ee)2

Open in CodSpeed

Footnotes

  1. 156 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (bc709f6) during the generation of this report, so 61f53ee was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@mdm317 mdm317 marked this pull request as ready for review March 17, 2026 17:29
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9249024f-3b4e-4c58-9b30-6c6d680668dd

📥 Commits

Reviewing files that changed from the base of the PR and between a816627 and fa20000.

📒 Files selected for processing (1)
  • .changeset/cuddly-dogs-hide.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/cuddly-dogs-hide.md

Walkthrough

Adds handling for TypeScript function types when placing comments that appear after the fat arrow (=>) so such comments become leading comments on the following node (or default if none). Adds tests covering inline and separate-line comments after the arrow in TypeScript function types. Adds a changelog entry for a patch release referencing issue #8959.

Suggested reviewers

  • dyc3
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarises the main change: fixing TypeScript arrow function comment formatting after the fat arrow operator.
Description check ✅ Passed The description is related to the changeset, referencing issue #8959 and explaining the fix for comment formatting consistency.
Linked Issues check ✅ Passed The PR addresses all coding objectives from #8959: handling comments between => and return types consistently, with test cases added.
Out of Scope Changes check ✅ Passed All changes are scoped to the issue requirements: changelog entry, formatter logic fix, and test file additions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Tip

You can generate walkthrough in a markdown collapsible section to save space.

Enable the reviews.collapse_walkthrough setting to generate walkthrough in a markdown collapsible section.

@dyc3 dyc3 merged commit 2f8bf80 into biomejs:main Mar 17, 2026
17 checks passed
@github-actions github-actions bot mentioned this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📝 Comments before the return type of arrow functions are inconsistently formatted

3 participants