[arrow-parens] Add a "when-brace" option
See original GitHub issueOur 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: https://github.com/SimpliField/eslint-config-simplifield/issues/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
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
arrow-parens - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Add formatting option to force parentheses around parameters ...
Hello, it would be nice if there were a option which forces parentheses around the parameters of an arrow function. Here's an exmaple...
Read more >arrow-parens - Rule
Rule: arrow-parens. Requires parentheses around the parameters of arrow function definitions. Rationale. Maintains stylistic consistency with other arrow ...
Read more >Prettier 1.9: JSX Fragments, EditorConfig and Arrow Parens
This release adds an option for arrow function parens in arguments, support for the new JSX fragment syntax ( <> ), support for ......
Read more >Arrow Parens - Unibeautify
Require parenthesis in arrow function arguments. Configuration option for beautifiers Prettier, ESLint, TSLint and languages JSX, JavaScript, TypeScript.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can champion this!
Thanks! Have we decided that
requireForBlockBody
is the config option name we want? Sounds good to me, just want to make sure.