TargetProcess/tauCharts

View on GitHub
src/event.ts

Summary

Maintainability
B
6 hrs
Test Coverage

Function createDispatcher has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createDispatcher(eventName: string) {
    var eventFunction = events[eventName];

    if (!eventFunction) {
        eventFunction = function () {
Severity: Minor
Found in src/event.ts - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

                            for (i = 0; i < arguments.length; i++) {
                                args.push(arguments[i]);
                            }
    Severity: Major
    Found in src/event.ts - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for (i = 0; i < arguments.length; i++) {
                                  args.push(arguments[i]);
                              }
      Severity: Major
      Found in src/event.ts - About 45 mins to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                            if (!args) {
                                // it should be better for browser optimizations
                                // (instead of [this].concat(slice.call(arguments)))
                                args = [this];
                                for (i = 0; i < arguments.length; i++) {
        Severity: Major
        Found in src/event.ts and 1 other location - About 1 hr to fix
        src/event.ts on lines 29..36

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 61.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                            if (!args) {
                                // it should be better for browser optimizations
                                // (instead of [this].concat(slice.call(arguments)))
                                args = [this];
                                for (i = 0; i < arguments.length; i++) {
        Severity: Major
        Found in src/event.ts and 1 other location - About 1 hr to fix
        src/event.ts on lines 48..55

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 61.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

                var prev;
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

            var eventFunction = events[eventName];
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Assignments in conditional expressions are forbidden
        Open

                    while (cursor = cursor.handler) { // eslint-disable-line
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-conditional-assignment

        Disallows any type of assignment in conditionals.

        This applies to do-while, for, if, and while statements and conditional (ternary) expressions.

        Rationale

        Assignments in conditionals are often typos: for example if (var1 = var2) instead of if (var1 == var2). They also can be an indicator of overly clever code which decreases maintainability.

        Config

        Not configurable.

        Examples
        "no-conditional-assignment": true

        For more information see this page.

        Assignments in conditional expressions are forbidden
        Open

                while (prev = cursor, cursor = cursor.handler) { // jshint ignore:line
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-conditional-assignment

        Disallows any type of assignment in conditionals.

        This applies to do-while, for, if, and while statements and conditional (ternary) expressions.

        Rationale

        Assignments in conditionals are often typos: for example if (var1 = var2) instead of if (var1 == var2). They also can be an indicator of overly clever code which decreases maintainability.

        Config

        Not configurable.

        Examples
        "no-conditional-assignment": true

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

                    var args;
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

                var cursor: HandlerObject | this = this;
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Expected property shorthand in object literal ('{fn}').
        Open

                                fn: fn,
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: object-literal-shorthand

        Enforces/disallows use of ES6 object literal shorthand.

        Notes
        • Has Fix

        Config

        "always" assumed to be default option, thus with no options provided the rule enforces object literal methods and properties shorthands. With "never" option provided, any shorthand object literal syntax causes an error.

        The rule can be configured in a more granular way. With {"property": "never"} provided (which is equivalent to {"property": "never", "method": "always"}), the rule only flags property shorthand assignments, and respectively with {"method": "never"} (equivalent to {"property": "always", "method": "never"}), the rule fails only on method shorthands.

        Examples
        "object-literal-shorthand": true
        "object-literal-shorthand": true,never
        "object-literal-shorthand": true,[object Object]
        Schema
        {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "never"
              ]
            },
            {
              "type": "object",
              "properties": {
                "property": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                }
              },
              "minProperties": 1,
              "maxProperties": 2
            }
          ]
        }

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

                    var queue = [];
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Expected property shorthand in object literal ('{args}').
        Open

                                        args: args
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: object-literal-shorthand

        Enforces/disallows use of ES6 object literal shorthand.

        Notes
        • Has Fix

        Config

        "always" assumed to be default option, thus with no options provided the rule enforces object literal methods and properties shorthands. With "never" option provided, any shorthand object literal syntax causes an error.

        The rule can be configured in a more granular way. With {"property": "never"} provided (which is equivalent to {"property": "never", "method": "always"}), the rule only flags property shorthand assignments, and respectively with {"method": "never"} (equivalent to {"property": "always", "method": "never"}), the rule fails only on method shorthands.

        Examples
        "object-literal-shorthand": true
        "object-literal-shorthand": true,never
        "object-literal-shorthand": true,[object Object]
        Schema
        {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "never"
              ]
            },
            {
              "type": "object",
              "properties": {
                "property": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                }
              },
              "minProperties": 1,
              "maxProperties": 2
            }
          ]
        }

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

        var events: EventHandlerMap = {};
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Identifier 'events' is never reassigned; use 'const' instead of 'var'.
        Open

        var events: EventHandlerMap = {};
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: prefer-const

        Requires that variable declarations use const instead of let and var if possible.

        If a variable is only assigned to once when it is declared, it should be declared using 'const'

        Notes
        • Has Fix

        Config

        An optional object containing the property "destructuring" with two possible values:

        • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
        • "all" - Only warns if all variables in destructuring can be const.
        Examples
        "prefer-const": true
        "prefer-const": true,[object Object]
        Schema
        {
          "type": "object",
          "properties": {
            "destructuring": {
              "type": "string",
              "enum": [
                "all",
                "any"
              ]
            }
          }
        }

        For more information see this page.

        Assignments in conditional expressions are forbidden
        Open

                while (prev = cursor, cursor = cursor.handler) { // jshint ignore:line
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-conditional-assignment

        Disallows any type of assignment in conditionals.

        This applies to do-while, for, if, and while statements and conditional (ternary) expressions.

        Rationale

        Assignments in conditionals are often typos: for example if (var1 = var2) instead of if (var1 == var2). They also can be an indicator of overly clever code which decreases maintainability.

        Config

        Not configurable.

        Examples
        "no-conditional-assignment": true

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

                    var cursor = this;
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Assigning this reference to local variable not allowed: cursor.
        Open

                    var cursor = this;
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-this-assignment

        Disallows unnecessary references to this.

        Rationale

        Assigning a variable to this instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.

        Instead of storing a reference to this and using it inside a function () {:

        const self = this;
        
        setTimeout(function () {
            self.doWork();
        });

        Use () => arrow lambdas, as they preserve this scope for you:

        setTimeout(() => {
            this.doWork();
        });

        Config

        Two options may be provided on an object:

        • allow-destructuring allows using destructuring to access members of this (e.g. { foo, bar } = this;).
        • allowed-names may be specified as a list of regular expressions to match allowed variable names.
        Examples
        "no-this-assignment": true
        "no-this-assignment": true,[object Object]
        Schema
        {
          "additionalProperties": false,
          "properties": {
            "allow-destructuring": {
              "type": "boolean"
            },
            "allowed-names": {
              "listType": "string",
              "type": "list"
            }
          },
          "type": "object"
        }

        For more information see this page.

        Assigning this reference to local variable not allowed: cursor.
        Open

                var cursor: HandlerObject | this = this;
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-this-assignment

        Disallows unnecessary references to this.

        Rationale

        Assigning a variable to this instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well.

        Instead of storing a reference to this and using it inside a function () {:

        const self = this;
        
        setTimeout(function () {
            self.doWork();
        });

        Use () => arrow lambdas, as they preserve this scope for you:

        setTimeout(() => {
            this.doWork();
        });

        Config

        Two options may be provided on an object:

        • allow-destructuring allows using destructuring to access members of this (e.g. { foo, bar } = this;).
        • allowed-names may be specified as a list of regular expressions to match allowed variable names.
        Examples
        "no-this-assignment": true
        "no-this-assignment": true,[object Object]
        Schema
        {
          "additionalProperties": false,
          "properties": {
            "allow-destructuring": {
              "type": "boolean"
            },
            "allowed-names": {
              "listType": "string",
              "type": "list"
            }
          },
          "type": "object"
        }

        For more information see this page.

        Identifier 'obj' is never reassigned; use 'const' instead of 'var'.
        Open

                var obj = {};
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: prefer-const

        Requires that variable declarations use const instead of let and var if possible.

        If a variable is only assigned to once when it is declared, it should be declared using 'const'

        Notes
        • Has Fix

        Config

        An optional object containing the property "destructuring" with two possible values:

        • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
        • "all" - Only warns if all variables in destructuring can be const.
        Examples
        "prefer-const": true
        "prefer-const": true,[object Object]
        Schema
        {
          "type": "object",
          "properties": {
            "destructuring": {
              "type": "string",
              "enum": [
                "all",
                "any"
              ]
            }
          }
        }

        For more information see this page.

        Identifier 'NULL_HANDLER' is never reassigned; use 'const' instead of 'var'.
        Open

        var NULL_HANDLER: EventHandlerMap = {};
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: prefer-const

        Requires that variable declarations use const instead of let and var if possible.

        If a variable is only assigned to once when it is declared, it should be declared using 'const'

        Notes
        • Has Fix

        Config

        An optional object containing the property "destructuring" with two possible values:

        • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
        • "all" - Only warns if all variables in destructuring can be const.
        Examples
        "prefer-const": true
        "prefer-const": true,[object Object]
        Schema
        {
          "type": "object",
          "properties": {
            "destructuring": {
              "type": "string",
              "enum": [
                "all",
                "any"
              ]
            }
          }
        }

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

        var NULL_HANDLER: EventHandlerMap = {};
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

                var obj = {};
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Identifier 'queue' is never reassigned; use 'const' instead of 'var'.
        Open

                    var queue = [];
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: prefer-const

        Requires that variable declarations use const instead of let and var if possible.

        If a variable is only assigned to once when it is declared, it should be declared using 'const'

        Notes
        • Has Fix

        Config

        An optional object containing the property "destructuring" with two possible values:

        • "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
        • "all" - Only warns if all variables in destructuring can be const.
        Examples
        "prefer-const": true
        "prefer-const": true,[object Object]
        Schema
        {
          "type": "object",
          "properties": {
            "destructuring": {
              "type": "string",
              "enum": [
                "all",
                "any"
              ]
            }
          }
        }

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

                    var i = 0;
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Do not use comma operator here because it can be easily misunderstood or lead to unintended bugs.
        Open

                while (prev = cursor, cursor = cursor.handler) { // jshint ignore:line
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: ban-comma-operator

        Disallows the comma operator to be used.

        Read more about the comma operator here.

        Rationale

        Using the comma operator can create a potential for many non-obvious bugs or lead to misunderstanding of code.

        Examples

        foo((bar, baz)); // evaluates to 'foo(baz)' because of the extra parens - confusing and not obvious
        switch (foo) {
            case 1, 2: // equals 'case 2' - probably intended 'case 1: case2:'
                return true;
            case 3:
                return false;
        }
        let x = (y = 1, z = 2); // x is equal to 2 - this may not be immediately obvious.
        Examples
        "ban-comma-operator": true

        For more information see this page.

        Expected property shorthand in object literal ('{args}').
        Open

                                args:args
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: object-literal-shorthand

        Enforces/disallows use of ES6 object literal shorthand.

        Notes
        • Has Fix

        Config

        "always" assumed to be default option, thus with no options provided the rule enforces object literal methods and properties shorthands. With "never" option provided, any shorthand object literal syntax causes an error.

        The rule can be configured in a more granular way. With {"property": "never"} provided (which is equivalent to {"property": "never", "method": "always"}), the rule only flags property shorthand assignments, and respectively with {"method": "never"} (equivalent to {"property": "always", "method": "never"}), the rule fails only on method shorthands.

        Examples
        "object-literal-shorthand": true
        "object-literal-shorthand": true,never
        "object-literal-shorthand": true,[object Object]
        Schema
        {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "never"
              ]
            },
            {
              "type": "object",
              "properties": {
                "property": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                }
              },
              "minProperties": 1,
              "maxProperties": 2
            }
          ]
        }

        For more information see this page.

        Expected property shorthand in object literal ('{context}').
        Open

                    context: context,
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: object-literal-shorthand

        Enforces/disallows use of ES6 object literal shorthand.

        Notes
        • Has Fix

        Config

        "always" assumed to be default option, thus with no options provided the rule enforces object literal methods and properties shorthands. With "never" option provided, any shorthand object literal syntax causes an error.

        The rule can be configured in a more granular way. With {"property": "never"} provided (which is equivalent to {"property": "never", "method": "always"}), the rule only flags property shorthand assignments, and respectively with {"method": "never"} (equivalent to {"property": "always", "method": "never"}), the rule fails only on method shorthands.

        Examples
        "object-literal-shorthand": true
        "object-literal-shorthand": true,never
        "object-literal-shorthand": true,[object Object]
        Schema
        {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "never"
              ]
            },
            {
              "type": "object",
              "properties": {
                "property": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                }
              },
              "minProperties": 1,
              "maxProperties": 2
            }
          ]
        }

        For more information see this page.

        Forbidden 'var' keyword, use 'let' or 'const' instead
        Open

                    var fn;
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: no-var-keyword

        Disallows usage of the var keyword.

        Use let or const instead.

        Rationale

        Declaring variables using var has several edge case behaviors that make var unsuitable for modern code. Variables declared by var have their parent function block as their scope, ignoring other control flow statements. vars have declaration "hoisting" (similar to functions) and can appear to be used before declaration.

        Variables declared by const and let instead have as their scope the block in which they are defined, and are not allowed to used before declaration or be re-declared with another const or let.

        Notes
        • Has Fix

        Config

        Not configurable.

        Examples
        "no-var-keyword": true

        For more information see this page.

        Expected property shorthand in object literal ('{fn}').
        Open

                                fn: fn,
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: object-literal-shorthand

        Enforces/disallows use of ES6 object literal shorthand.

        Notes
        • Has Fix

        Config

        "always" assumed to be default option, thus with no options provided the rule enforces object literal methods and properties shorthands. With "never" option provided, any shorthand object literal syntax causes an error.

        The rule can be configured in a more granular way. With {"property": "never"} provided (which is equivalent to {"property": "never", "method": "always"}), the rule only flags property shorthand assignments, and respectively with {"method": "never"} (equivalent to {"property": "always", "method": "never"}), the rule fails only on method shorthands.

        Examples
        "object-literal-shorthand": true
        "object-literal-shorthand": true,never
        "object-literal-shorthand": true,[object Object]
        Schema
        {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "never"
              ]
            },
            {
              "type": "object",
              "properties": {
                "property": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                }
              },
              "minProperties": 1,
              "maxProperties": 2
            }
          ]
        }

        For more information see this page.

        Expected property shorthand in object literal ('{callbacks}').
        Open

                    callbacks: callbacks,
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: object-literal-shorthand

        Enforces/disallows use of ES6 object literal shorthand.

        Notes
        • Has Fix

        Config

        "always" assumed to be default option, thus with no options provided the rule enforces object literal methods and properties shorthands. With "never" option provided, any shorthand object literal syntax causes an error.

        The rule can be configured in a more granular way. With {"property": "never"} provided (which is equivalent to {"property": "never", "method": "always"}), the rule only flags property shorthand assignments, and respectively with {"method": "never"} (equivalent to {"property": "always", "method": "never"}), the rule fails only on method shorthands.

        Examples
        "object-literal-shorthand": true
        "object-literal-shorthand": true,never
        "object-literal-shorthand": true,[object Object]
        Schema
        {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "never"
              ]
            },
            {
              "type": "object",
              "properties": {
                "property": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "never"
                  ]
                }
              },
              "minProperties": 1,
              "maxProperties": 2
            }
          ]
        }

        For more information see this page.

        missing whitespace
        Open

                                args:args
        Severity: Minor
        Found in src/event.ts by tslint

        Rule: whitespace

        Enforces whitespace style conventions.

        Rationale

        Helps maintain a readable, consistent style in your codebase.

        Notes
        • Has Fix

        Config

        Several arguments may be optionally provided:

        • "check-branch" checks branching statements (if/else/for/while) are followed by whitespace.
        • "check-decl"checks that variable declarations have whitespace around the equals token.
        • "check-operator" checks for whitespace around operator tokens.
        • "check-module" checks for whitespace in import & export statements.
        • "check-separator" checks for whitespace after separator tokens (,/;).
        • "check-rest-spread" checks that there is no whitespace after rest/spread operator (...).
        • "check-type" checks for whitespace before a variable type specification.
        • "check-typecast" checks for whitespace between a typecast and its target.
        • "check-type-operator" checks for whitespace between type operators | and &.
        • "check-preblock" checks for whitespace before the opening brace of a block.
        • "check-postbrace" checks for whitespace after an opening brace.
        Examples
        "whitespace": true,check-branch,check-operator,check-typecast
        Schema
        {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "check-branch",
              "check-decl",
              "check-operator",
              "check-module",
              "check-separator",
              "check-rest-spread",
              "check-type",
              "check-typecast",
              "check-type-operator",
              "check-preblock",
              "check-postbrace"
            ]
          },
          "minLength": 0,
          "maxLength": 11
        }

        For more information see this page.

        There are no issues that match your filters.

        Category
        Status