Update: Add never option to arrow-body-style
See original GitHub issueVersion: 2.10.0
Arrow functions that return object literals can look very similar to arrow functions with brace bodies. Some syntactic ambiguity can be avoided by disallowing block-style arrow functions in favour of ES5 function expressions.
Outcome
The following patterns are considered problems:
/*eslint arrow-body-style: ["error", "never"]*/
/*eslint-env es6*/
let foo = () => {
return 0;
};
let foo = (retv, name) => {
retv[name] = true;
return retv;
};
The following patterns are not considered problems:
/*eslint arrow-body-style: ["error", "never"]*/
/*eslint-env es6*/
let foo = () => 0;
let foo = () => ({ key: 0 });
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
arrow-body-style - 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 >Rule Change: add maxLines option to arrow-body-style · Issue ...
I am open to taking a swing at a PR for this. In my naive review, this seems pretty straightforward to enforce? The...
Read more >Unexpected block statement surrounding arrow body; move ...
I am getting the error Failed to Compile Unexpected block statement surrounding arrow body; move the returned value immediately after the =>.
Read more >Arrow function expressions - JavaScript - MDN Web Docs
An arrow function expression is a compact alternative to a traditional function expression, with some semantic differences and deliberate ...
Read more >Tooltips - Bootstrap
Documentation and examples for adding custom Bootstrap tooltips with CSS and ... Specify container: 'body' to avoid rendering problems in more complex ...
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 think we can support “never” along with #5936. I’ll champion this.
👍