waiterio/api

View on GitHub
api/orders/ordersPost.js

Summary

Maintainability
A
1 hr
Test Coverage

Function addOrder has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports.addOrder = function(req, res) {
    const orderItems = req.body.orderitems;
    const orderData = [
        { field: 'notes', input: req.body.notes, rules: { notEmpty: false, type: 'string' } },
        { field: 'ordertimestamp', input: new Date().getTime().toString(), rules: { notEmpty: true, type: 'string' } },
Severity: Minor
Found in api/orders/ordersPost.js - About 1 hr to fix

    Unexpected tab character.
    Open

                });
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

            });
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                                req.app.get('db').action.addRecord({ table: 'orderitems' }, dbHelpers.getInsertQueryData(orderItemData));
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

            { field: 'tablenumber', input: req.body.tablenumber, rules: { notEmpty: true, type: 'number' } }
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                    const orderId = this.lastID;
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

        const orderItems = req.body.orderitems;
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

            { field: 'ordertimestamp', input: new Date().getTime().toString(), rules: { notEmpty: true, type: 'string' } },
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                            if (validationResultOrderItem.status === true) {
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                    });
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

            { field: 'notes', input: req.body.notes, rules: { notEmpty: false, type: 'string' } },
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

            req.app.get('db').db.serialize(function() {
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                            ];
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                            const validationResultOrderItem = validator.validate(orderItemData);
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

            return res.status(validationResult.statusCode).json({ status: validationResult.statusCode, message: validationResult.message });
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                        orderItems.forEach(function(value) {
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

        if (validationResult.status === true) {
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                            const orderItemData = [
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

        ];
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

        const validationResult = validator.validate(orderData);
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                            }
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                                { field: 'orders_id', input: parseInt(orderId, 10), rules: { notEmpty: true, type: 'number' } },
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                    return res.json({ id: orderId });
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                        });
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

        }
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

        const orderData = [
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                                { field: 'dishes_id', input: parseInt(value.dishes_id, 10), rules: { notEmpty: true, type: 'number' } }
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

        } else {
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                req.app.get('db').action.addRecord({ table: 'orders' }, dbHelpers.getInsertQueryData(orderData), function() {
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Unexpected tab character.
    Open

                    req.app.get('db').db.serialize(function() {
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    disallow all tabs (no-tabs)

    Some style guides don't allow the use of tab characters at all, including within comments.

    Rule Details

    This rule looks for tabs anywhere inside a file: code, comments or anything else.

    Examples of incorrect code for this rule:

    var a /t= 2;
    
    /**
    * /t/t it's a test function
    */
    function test(){}
    
    var x = 1; // /t test

    Examples of correct code for this rule:

    var a = 2;
    
    /**
    * it's a test function
    */
    function test(){}
    
    var x = 1; // test

    When Not To Use It

    If you have established a standard where having tabs is fine.

    Compatibility

    Expected to return a value at the end of function.
    Open

    module.exports.addOrder = function(req, res) {
    Severity: Minor
    Found in api/orders/ordersPost.js by eslint

    require return statements to either always or never specify values (consistent-return)

    Unlike statically-typed languages which enforce that a function returns a specified type of value, JavaScript allows different code paths in a function to return different types of values.

    A confusing aspect of JavaScript is that a function returns undefined if any of the following are true:

    • it does not execute a return statement before it exits
    • it executes return which does not specify a value explicitly
    • it executes return undefined
    • it executes return void followed by an expression (for example, a function call)
    • it executes return followed by any other expression which evaluates to undefined

    If any code paths in a function return a value explicitly but some code path do not return a value explicitly, it might be a typing mistake, especially in a large function. In the following example:

    • a code path through the function returns a Boolean value true
    • another code path does not return a value explicitly, therefore returns undefined implicitly
    function doSomething(condition) {
        if (condition) {
            return true;
        } else {
            return;
        }
    }

    Rule Details

    This rule requires return statements to either always or never specify values. This rule ignores function definitions where the name begins with an uppercase letter, because constructors (when invoked with the new operator) return the instantiated object implicitly if they do not return another object explicitly.

    Examples of incorrect code for this rule:

    /*eslint consistent-return: "error"*/
    
    function doSomething(condition) {
        if (condition) {
            return true;
        } else {
            return;
        }
    }
    
    function doSomething(condition) {
        if (condition) {
            return true;
        }
    }

    Examples of correct code for this rule:

    /*eslint consistent-return: "error"*/
    
    function doSomething(condition) {
        if (condition) {
            return true;
        } else {
            return false;
        }
    }
    
    function Foo() {
        if (!(this instanceof Foo)) {
            return new Foo();
        }
    
        this.a = 0;
    }

    Options

    This rule has an object option:

    • "treatUndefinedAsUnspecified": false (default) always either specify values or return undefined implicitly only.
    • "treatUndefinedAsUnspecified": true always either specify values or return undefined explicitly or implicitly.

    treatUndefinedAsUnspecified

    Examples of incorrect code for this rule with the default { "treatUndefinedAsUnspecified": false } option:

    /*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": false }]*/
    
    function foo(callback) {
        if (callback) {
            return void callback();
        }
        // no return statement
    }
    
    function bar(condition) {
        if (condition) {
            return undefined;
        }
        // no return statement
    }

    Examples of incorrect code for this rule with the { "treatUndefinedAsUnspecified": true } option:

    /*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": true }]*/
    
    function foo(callback) {
        if (callback) {
            return void callback();
        }
        return true;
    }
    
    function bar(condition) {
        if (condition) {
            return undefined;
        }
        return true;
    }

    Examples of correct code for this rule with the { "treatUndefinedAsUnspecified": true } option:

    /*eslint consistent-return: ["error", { "treatUndefinedAsUnspecified": true }]*/
    
    function foo(callback) {
        if (callback) {
            return void callback();
        }
        // no return statement
    }
    
    function bar(condition) {
        if (condition) {
            return undefined;
        }
        // no return statement
    }

    When Not To Use It

    If you want to allow functions to have different return behavior depending on code branching, then it is safe to disable this rule. Source: http://eslint.org/docs/rules/

    There are no issues that match your filters.

    Category
    Status