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.

proposal:add new option to rule `array-callback-return` and `getter-return`

See original GitHub issue

What rule do you want to change? array-callback-return

Does this change cause the rule to produce more or fewer warnings? fewer.

How will the change be implemented? (New option, new default behavior, etc.)? new option: “allowImplicit”: true – allows implicitly returning undefined with a return; statement.

Please provide some example code that this change will affect:

/* eslint array-callback-return: [2, {allowImplicit: true} */
[1, 2, 3].map(function (item) {
  return; // return undefined implicitly.
});

What does the rule currently do for this code? Function expected a return value.(array-callback-return)

What will the rule do after it’s changed? no error.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
ilyavolodincommented, Nov 2, 2017

Marking as accepted since @Aladdin-ADD is part of the team and will be the champion.

3reactions
platinumazurecommented, Jun 27, 2017

@ljharb You could use return void 0;, that’s perfectly safe.

That said, I’m 👍 to there being an option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

getter-return - 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 >

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