waiterio/api

View on GitHub
common/logging.js

Summary

Maintainability
A
1 hr
Test Coverage

Function getLogger has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getLogger() {
    const loggerObject = new (winston.Logger)({
        levels: {
            trace: 0,
            debug: 1,
Severity: Minor
Found in common/logging.js - About 1 hr to fix

    Unexpected tab character.
    Open

                trace: 0,
    Severity: Minor
    Found in common/logging.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

            levels: {
    Severity: Minor
    Found in common/logging.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

                route: 2,
    Severity: Minor
    Found in common/logging.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

                help: 4,
    Severity: Minor
    Found in common/logging.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

                info: 5,
    Severity: Minor
    Found in common/logging.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 loggerObject = new (winston.Logger)({
    Severity: Minor
    Found in common/logging.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

                debug: 1,
    Severity: Minor
    Found in common/logging.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

                data: 3,
    Severity: Minor
    Found in common/logging.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

                error: 7
    Severity: Minor
    Found in common/logging.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

                new (winston.transports.File)({ name: 'file-log', filename: './logs/general.log' })
    Severity: Minor
    Found in common/logging.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 common/logging.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 common/logging.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

                route: 'blue',
    Severity: Minor
    Found in common/logging.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

            loggerObject.remove('file-log');
    Severity: Minor
    Found in common/logging.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

            colors: {
    Severity: Minor
    Found in common/logging.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

                new (winston.transports.Console)({ name: 'console-log', colorize: true, silent: false, level: 'error'}),
    Severity: Minor
    Found in common/logging.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 (settings.environment === 'production') {
    Severity: Minor
    Found in common/logging.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

                debug: 'cyan',
    Severity: Minor
    Found in common/logging.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 common/logging.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

                warn: 'yellow',
    Severity: Minor
    Found in common/logging.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

            transports: [
    Severity: Minor
    Found in common/logging.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

                info: 'green',
    Severity: Minor
    Found in common/logging.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

                handleExceptions: false,
    Severity: Minor
    Found in common/logging.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(process.env.NODE_ENV === 'test') {
    Severity: Minor
    Found in common/logging.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

                warn: 6,
    Severity: Minor
    Found in common/logging.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

        try {
    Severity: Minor
    Found in common/logging.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

            loggerObject.remove('console-log');
    Severity: Minor
    Found in common/logging.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

            fileSystem.mkdirSync('./logs/');
    Severity: Minor
    Found in common/logging.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 common/logging.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

                exitOnError: true,
    Severity: Minor
    Found in common/logging.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 space(s) after "if".
    Open

        if(process.env.NODE_ENV === 'test') {
    Severity: Minor
    Found in common/logging.js by eslint

    enforce consistent spacing before and after keywords (keyword-spacing)

    Keywords are syntax elements of JavaScript, such as function and if. These identifiers have special meaning to the language and so often appear in a different color in code editors. As an important part of the language, style guides often refer to the spacing that should be used around keywords. For example, you might have a style guide that says keywords should be always surrounded by spaces, which would mean if-else statements must look like this:

    if (foo) {
        // ...
    } else {
        // ...
    }

    Of course, you could also have a style guide that disallows spaces around keywords.

    Rule Details

    This rule enforces consistent spacing around keywords and keyword-like tokens: as (in module declarations), async (of async functions), await (of await expressions), break, case, catch, class, const, continue, debugger, default, delete, do, else, export, extends, finally, for, from (in module declarations), function, get (of getters), if, import, in, instanceof, let, new, of (in for-of statements), return, set (of setters), static, super, switch, this, throw, try, typeof, var, void, while, with, and yield. This rule is designed carefully not to conflict with other spacing rules: it does not apply to spacing where other rules report problems.

    Options

    This rule has an object option:

    • "before": true (default) requires at least one space before keywords
    • "before": false disallows spaces before keywords
    • "after": true (default) requires at least one space after keywords
    • "after": false disallows spaces after keywords
    • "overrides" allows overriding spacing style for specified keywords

    before

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

    /*eslint keyword-spacing: ["error", { "before": true }]*/
    
    if (foo) {
        //...
    }else if (bar) {
        //...
    }else {
        //...
    }

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

    /*eslint keyword-spacing: ["error", { "before": true }]*/
    /*eslint-env es6*/
    
    if (foo) {
        //...
    } else if (bar) {
        //...
    } else {
        //...
    }
    
    // no conflict with `array-bracket-spacing`
    let a = [this];
    let b = [function() {}];
    
    // no conflict with `arrow-spacing`
    let a = ()=> this.foo;
    
    // no conflict with `block-spacing`
    {function foo() {}}
    
    // no conflict with `comma-spacing`
    let a = [100,this.foo, this.bar];
    
    // not conflict with `computed-property-spacing`
    obj[this.foo] = 0;
    
    // no conflict with `generator-star-spacing`
    function *foo() {}
    
    // no conflict with `key-spacing`
    let obj = {
        foo:function() {}
    };
    
    // no conflict with `object-curly-spacing`
    let obj = {foo: this};
    
    // no conflict with `semi-spacing`
    let a = this;function foo() {}
    
    // no conflict with `space-in-parens`
    (function () {})();
    
    // no conflict with `space-infix-ops`
    if ("foo"in {foo: 0}) {}
    if (10+this.foo<= this.bar) {}
    
    // no conflict with `jsx-curly-spacing`
    let a = 

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

    /*eslint keyword-spacing: ["error", { "before": false }]*/
    
    if (foo) {
        //...
    } else if (bar) {
        //...
    } else {
        //...
    }

    Examples of correct code for this rule with the { "before": false } option:

    /*eslint keyword-spacing: ["error", { "before": false }]*/
    
    if (foo) {
        //...
    }else if (bar) {
        //...
    }else {
        //...
    }

    after

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

    /*eslint keyword-spacing: ["error", { "after": true }]*/
    
    if(foo) {
        //...
    } else if(bar) {
        //...
    } else{
        //...
    }

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

    /*eslint keyword-spacing: ["error", { "after": true }]*/
    
    if (foo) {
        //...
    } else if (bar) {
        //...
    } else {
        //...
    }
    
    // not conflict with `array-bracket-spacing`
    let a = [this];
    
    // not conflict with `arrow-spacing`
    let a = ()=> this.foo;
    
    // not conflict with `comma-spacing`
    let a = [100, this.foo, this.bar];
    
    // not conflict with `computed-property-spacing`
    obj[this.foo] = 0;
    
    // not conflict with `generator-star-spacing`
    function* foo() {}
    
    // not conflict with `key-spacing`
    let obj = {
        foo:function() {}
    };
    
    // not conflict with `func-call-spacing`
    class A {
        constructor() {
            super();
        }
    }
    
    // not conflict with `object-curly-spacing`
    let obj = {foo: this};
    
    // not conflict with `semi-spacing`
    let a = this;function foo() {}
    
    // not conflict with `space-before-function-paren`
    function() {}
    
    // no conflict with `space-infix-ops`
    if ("foo"in{foo: 0}) {}
    if (10+this.foo<= this.bar) {}
    
    // no conflict with `space-unary-ops`
    function* foo(a) {
        return yield+a;
    }
    
    // no conflict with `yield-star-spacing`
    function* foo(a) {
        return yield* a;
    }
    
    // no conflict with `jsx-curly-spacing`
    let a = 

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

    /*eslint keyword-spacing: ["error", { "after": false }]*/
    
    if (foo) {
        //...
    } else if (bar) {
        //...
    } else {
        //...
    }

    Examples of correct code for this rule with the { "after": false } option:

    /*eslint keyword-spacing: ["error", { "after": false }]*/
    
    if(foo) {
        //...
    } else if(bar) {
        //...
    } else{
        //...
    }

    overrides

    Examples of correct code for this rule with the { "overrides": { "if": { "after": false }, "for": { "after": false }, "while": { "after": false } } } option:

    /*eslint keyword-spacing: ["error", { "overrides": {
      "if": { "after": false },
      "for": { "after": false },
      "while": { "after": false }
    } }]*/
    
    if(foo) {
        //...
    } else if(bar) {
        //...
    } else {
        //...
    }
    
    for(;;);
    
    while(true) {
      //...
    }

    When Not To Use It

    If you don't want to enforce consistency on keyword spacing, then it's safe to disable this rule. Source: http://eslint.org/docs/rules/

    Unexpected tab character.
    Open

                data: 'grey',
    Severity: Minor
    Found in common/logging.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

                filename: './logs/error.log',
    Severity: Minor
    Found in common/logging.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

        } catch (e) {
    Severity: Minor
    Found in common/logging.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

                trace: 'grey',
    Severity: Minor
    Found in common/logging.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

                name: 'exceptions-log',
    Severity: Minor
    Found in common/logging.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

                help: 'magenta',
    Severity: Minor
    Found in common/logging.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 common/logging.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 common/logging.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

            fileSystem.accessSync('./logs/', fileSystem.W_OK);
    Severity: Minor
    Found in common/logging.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 loggerObject;
    Severity: Minor
    Found in common/logging.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 common/logging.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 common/logging.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

    A space is required before '}'.
    Open

                new (winston.transports.Console)({ name: 'console-log', colorize: true, silent: false, level: 'error'}),
    Severity: Minor
    Found in common/logging.js by eslint

    enforce consistent spacing inside braces (object-curly-spacing)

    While formatting preferences are very personal, a number of style guides require or disallow spaces between curly braces in the following situations:

    // simple object literals
    var obj = { foo: "bar" };
    
    // nested object literals
    var obj = { foo: { zoo: "bar" } };
    
    // destructuring assignment (EcmaScript 6)
    var { x, y } = y;
    
    // import/export declarations (EcmaScript 6)
    import { foo } from "bar";
    export { foo };

    Rule Details

    This rule enforce consistent spacing inside braces of object literals, destructuring assignments, and import/export specifiers.

    Options

    This rule has two options, a string option and an object option.

    String option:

    • "never" (default) disallows spacing inside of braces
    • "always" requires spacing inside of braces (except {})

    Object option:

    • "arraysInObjects": true requires spacing inside of braces of objects beginning and/or ending with an array element (applies when the first option is set to never)
    • "arraysInObjects": false disallows spacing inside of braces of objects beginning and/or ending with an array element (applies when the first option is set to always)
    • "objectsInObjects": true requires spacing inside of braces of objects beginning and/or ending with an object element (applies when the first option is set to never)
    • "objectsInObjects": false disallows spacing inside of braces of objects beginning and/or ending with an object element (applies when the first option is set to always)

    never

    Examples of incorrect code for this rule with the default "never" option:

    /*eslint object-curly-spacing: ["error", "never"]*/
    
    var obj = { 'foo': 'bar' };
    var obj = {'foo': 'bar' };
    var obj = { baz: {'foo': 'qux'}, bar};
    var obj = {baz: { 'foo': 'qux'}, bar};
    var {x } = y;
    import { foo } from 'bar';

    Examples of correct code for this rule with the default "never" option:

    /*eslint object-curly-spacing: ["error", "never"]*/
    
    var obj = {'foo': 'bar'};
    var obj = {'foo': {'bar': 'baz'}, 'qux': 'quxx'};
    var obj = {
      'foo': 'bar'
    };
    var obj = {'foo': 'bar'
    };
    var obj = {
      'foo':'bar'};
    var obj = {};
    var {x} = y;
    import {foo} from 'bar';

    always

    Examples of incorrect code for this rule with the "always" option:

    /*eslint object-curly-spacing: ["error", "always"]*/
    
    var obj = {'foo': 'bar'};
    var obj = {'foo': 'bar' };
    var obj = { baz: {'foo': 'qux'}, bar};
    var obj = {baz: { 'foo': 'qux' }, bar};
    var obj = {'foo': 'bar'
    };
    var obj = {
      'foo':'bar'};
    var {x} = y;
    import {foo } from 'bar';

    Examples of correct code for this rule with the "always" option:

    /*eslint object-curly-spacing: ["error", "always"]*/
    
    var obj = {};
    var obj = { 'foo': 'bar' };
    var obj = { 'foo': { 'bar': 'baz' }, 'qux': 'quxx' };
    var obj = {
      'foo': 'bar'
    };
    var { x } = y;
    import { foo } from 'bar';

    arraysInObjects

    Examples of additional correct code for this rule with the "never", { "arraysInObjects": true } options:

    /*eslint object-curly-spacing: ["error", "never", { "arraysInObjects": true }]*/
    
    var obj = {"foo": [ 1, 2 ] };
    var obj = {"foo": [ "baz", "bar" ] };

    Examples of additional correct code for this rule with the "always", { "arraysInObjects": false } options:

    /*eslint object-curly-spacing: ["error", "always", { "arraysInObjects": false }]*/
    
    var obj = { "foo": [ 1, 2 ]};
    var obj = { "foo": [ "baz", "bar" ]};

    objectsInObjects

    Examples of additional correct code for this rule with the "never", { "objectsInObjects": true } options:

    /*eslint object-curly-spacing: ["error", "never", { "objectsInObjects": true }]*/
    
    var obj = {"foo": {"baz": 1, "bar": 2} };

    Examples of additional correct code for this rule with the "always", { "objectsInObjects": false } options:

    /*eslint object-curly-spacing: ["error", "always", { "objectsInObjects": false }]*/
    
    var obj = { "foo": { "baz": 1, "bar": 2 }};

    When Not To Use It

    You can turn this rule off if you are not concerned with the consistency of spacing between curly braces.

    Related Rules

    Unexpected tab character.
    Open

            loggerObject.add(winston.transports.File, {
    Severity: Minor
    Found in common/logging.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

                error: 'red'
    Severity: Minor
    Found in common/logging.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

                humanReadableUnhandledException: false,
    Severity: Minor
    Found in common/logging.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

                level: 'error'
    Severity: Minor
    Found in common/logging.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

    There are no issues that match your filters.

    Category
    Status