1.0.2 • Published 6 years ago

eslint-plugin-empty-returns v1.0.2

Weekly downloads
39
License
MIT
Repository
github
Last release
6 years ago

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;}",
]