eslint-plugin-empty-returns
v1.0.2
Published
Eslint plugin to ensure undefined returns are empty.
Downloads
95
Readme
Returns should omit specifying undefined. (empty-returns)
This rule is for codebases where we want to use return;
instead of return undefined;
.
Rule Details
This rule aims to...
Examples of incorrect code for this rule:
invalid: [{
code: "var x = function() {return undefined;}",
output: "var x = function() {return;}",
}]
Examples of correct code for this rule:
valid: [
"var x = function() {return;}",
"var x = function() {return true;}",
"var x = function(hello) {return hello;}",
"var x = function() {return 'hello';}",
"var x = function() {return {};}",
"var x = function() {return false;}",
]