Skip to content

[arrow-parens] Add a "when-brace" option #6557

@nfroidure

Description

@nfroidure

Our team would like to adopt the AirBnb best practice for arrow functions parens but it appears the current options of this rule doesn't fit it. Since we want to rely on automated coding style rules only and found out it would be useful for others too, here is the PR that fulfill it.

See https://github.com/airbnb/javascript#arrows--one-arg-parens
Discussion: SimpliField/eslint-config-simplifield#14

  • The version of ESLint you are using

2.11.1
https://github.com/SimpliField/eslint-config-simplifield/blob/master/package.json#L20

  • The rule you want to change

'arrow-parens'

  • The code you want to be flagged as incorrect
a => { a } // (1)
(a) => a // (2)
  • What happens when the rule is applied to the code without your change

with 'as-needed' (1) is valid

with 'always' (2) is valid

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionenhancementThis change enhances an existing feature of ESLintruleRelates to ESLint's core rules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions