proposal:add new option to rule `array-callback-return` and `getter-return`
See original GitHub issueWhat 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:
- Created 6 years ago
- Reactions:4
- Comments:11 (10 by maintainers)
Top 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 >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
Marking as accepted since @Aladdin-ADD is part of the team and will be the champion.
@ljharb You could use
return void 0;
, that’s perfectly safe.That said, I’m 👍 to there being an option.