[no-confusing-arrow]: new line, and multiple parameters should be allowed
See original GitHub issueTell us about your environment
- ESLint Version: 4.1.1
- Node Version: 8.1.3
- npm Version: 5.0.3
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
"no-confusing-arrow": [2, {"allowParens": true}],
What did you do? Please include the actual source code causing the issue.
// case 1: arrow function body in new line
imageURLToBlob(imageURL, (blob) =>
blob ? resolve(blob) : reject());
// case 2: arrow function with multiple parameters
var fn = (exists, localURL) => exists ? resolve(localURL) : reject();
What did you expect to happen? A new line should make the intended arrow function use case of ‘=>’ obvious. Or there should be an option to accept this as not confusing.
Multiple parameters again should make an operator ‘=>’ unambiguously treated as an arrow function.
What actually happened? Please include the actual, raw output from ESLint. Both cases report arrow functions can be confused with mathematical operators.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
no-confusing-arrow - 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 >Correct way to pass multiple values for same parameter name ...
I had a look at the http spec but couldn't see anything about how the 'query' part of a URL should be made...
Read more >eslint/CHANGELOG.md at main - GitHub
Find and fix problems in your JavaScript code. Contribute to eslint/eslint development by creating an account on GitHub.
Read more >Airbnb JavaScript Style Guide()
5.3 Use object destructuring for multiple return values, not array ... 6.2 Strings that cause the line to go over 100 characters should...
Read more >Support for multi-value parameters in Amazon API Gateway
As part of this feature, AWS added two new keys: multiValueQueryStringParameters—Used in the API Gateway request to support a multi-valued ...
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 the
allowParens
option is intended to refer to whether the body of the function is parenthesized, not the parameters.That said, I’ve always been a bit unclear on what makes the arrow “confusing”.
Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to be implemented after 90 days tend to never be implemented, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.