biome icon indicating copy to clipboard operation
biome copied to clipboard

📎 Port `arrow-body-style` from eslint

Open dyc3 opened this issue 1 year ago • 4 comments

Description

Port the arrow-body-style rule from eslint.

Suggested names:

  • useAbbreviatedArrowFunction
  • useArrowExpression
  • noArrowImmediateReturn
  • open to suggestions

The eslint rule has options, but we don't usually implement options on the first iteration of a rule. For this task, implement the functionality that is equivalent to the default option (which would be as-needed).

Source: https://eslint.org/docs/latest/rules/arrow-body-style

Want to contribute? Lets you know you are interested! We will assign you to the issue to prevent several people to work on the same issue. Don't worry, we can unassign you later if you are no longer interested in the issue! Read our contributing guide and analyzer contributing guide.

dyc3 avatar Feb 06 '25 23:02 dyc3

Hey @dyc3 I would like to take this issue! 😀

isjavierdiaz avatar Feb 19 '25 16:02 isjavierdiaz

Is there another task for the "always" eslint setting (i.e., requiring you to add explicit block and return statement)? If not, it would be nice if the title of this were revised to: Port arrow-body-style: as-needed from eslint.

sjc5 avatar Apr 19 '25 15:04 sjc5

We could use a name such as useConsistentArrowReturn. I think that name works even if we add the option.

arendjr avatar Apr 19 '25 17:04 arendjr

We could use a name such as useConsistentArrowReturn. I think that name works even if we add the option.

I like that, and it seems to align with other rules that let you pick a potentially controversial style and enforce it, e.g., useConsistentArrayType

sjc5 avatar Apr 19 '25 18:04 sjc5

Any updates?

devcaeg avatar Jul 21 '25 17:07 devcaeg

@isjavierdiaz it's been 5 months. I assume you don't have time.

ematipico avatar Jul 24 '25 09:07 ematipico

Hey @dyc3 , I would like to take this. I am almost ready to land the implementation

kedevked avatar Aug 17 '25 08:08 kedevked

+1

khidirbekov avatar Oct 16 '25 08:10 khidirbekov