question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[no-confusing-arrow]: new line, and multiple parameters should be allowed

See original GitHub issue

Tell 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:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
not-an-aardvarkcommented, Jul 4, 2017

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”.

0reactions
nzakascommented, Oct 19, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found