Change allowArrowFunctions in func-style to string option
See original GitHub issueHi everyone! Thanks for eslint, it is awesome 😃
I would like to allow arrow functions without bodies, like:
// Good
const bla = () => true;
// Good
const bla = () => ({
prop: true
});
// Bad
const bla = () => {
return true;
};
// Bad
const bla = () => {
const blub = true;
return blub;
};
You’d configure it like this:
/*eslint func-style: ["error", "declaration", { "allowArrowFunctions": "expression-body" }]*/
/*eslint func-style: ["error", "declaration", { "allowArrowFunctions": "all" }]*/
What you be open for that change or do you see any problems?
@flootr would be interested in doing a PR 😃
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:13 (9 by maintainers)
Top Results From Across the Web
func-style - Pluggable JavaScript Linter - ESLint
This option applies only when the string option is set to "declaration" (arrow functions are always allowed when the string option is set...
Read more >Arrow function expressions - JavaScript - MDN Web Docs
Let's decompose a traditional anonymous function down to the simplest arrow function step-by-step. Each step along the way is a valid arrow ...
Read more >Arrow functions, the basics - The Modern JavaScript Tutorial
It's called “arrow functions”, because it looks like this: let func = (arg1, arg2, ..., argN) => expression; This creates a function func...
Read more >How To Use Javascript Arrow Functions & This Keyword
This guide will discuss how to use the arrow function to write your JavaScript functions. Focusing on converting regular functions to arrow ...
Read more >TypeScript Arrow Functions - TutorialsTeacher
Using fat arrow => , we dropped the need to use the function keyword. Parameters are passed in the parenthesis () , and...
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
@eslint/eslint-team This proposal has a lot of votes. Is anyone willing to champion it?
Closing this issue because no one on the team was willing to champion it. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach consensus after a long time tend to never do it, and as such, we close those issues. This doesn’t mean the idea isn’t interesting, just that it’s not something the team can commit to.