TargetProcess/tauCharts

View on GitHub
src/charts/tau.gpl.ts

Summary

Maintainability
C
1 day
Test Coverage

File tau.gpl.ts has 280 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {Emitter} from '../event';
import * as utils from '../utils/utils';
import {FramesAlgebra} from '../algebra';
import {DataFrame} from '../data-frame';
import {
Severity: Minor
Found in src/charts/tau.gpl.ts - About 2 hrs to fix

    Function getDrawScenarioQueue has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        getDrawScenarioQueue(root: GrammarElement) {
            const grammarRules = this.grammarRules;
            var scaleInfoQueue = this._flattenDrawScenario(root, (parentInstance, unit, rootFrame) => {
                // Rule to cancel parent frame inheritance
                const frame = (unit.expression.inherit === false) ? null : rootFrame;
    Severity: Minor
    Found in src/charts/tau.gpl.ts - About 1 hr to fix

      Function _flattenDrawScenario has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _flattenDrawScenario(
              root: GrammarElement,
              iterator: (parentInstance: GrammarElement, unit: Unit, rootFrame: DataFrame) => GrammarElement
          ) {
      
      
      Severity: Minor
      Found in src/charts/tau.gpl.ts - About 1 hr to fix

        Function constructor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            constructor(
                config: GPLSpec,
                scalesRegistryInstance: ScalesFactory,
                unitsRegistry: UnitsRegistry,
                grammarRules: GrammarRegistry
        Severity: Minor
        Found in src/charts/tau.gpl.ts - About 1 hr to fix

          Function _expandUnitsStructure has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _expandUnitsStructure(root: Unit, parentPipe: DataFilter[] = []) {
          
                  var self = this;
          
                  if (root.expression.operator === false) {
          Severity: Minor
          Found in src/charts/tau.gpl.ts - About 1 hr to fix

            Function _expandUnitsStructure has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                _expandUnitsStructure(root: Unit, parentPipe: DataFilter[] = []) {
            
                    var self = this;
            
                    if (root.expression.operator === false) {
            Severity: Minor
            Found in src/charts/tau.gpl.ts - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                        const instance = this.unitSet.create(
                            unit.type,
                            Object.assign(
                                {},
                                (unit),
            Severity: Minor
            Found in src/charts/tau.gpl.ts and 1 other location - About 55 mins to fix
            src/charts/tau.gpl.ts on lines 177..183

            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 53.

            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

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

                        const instance = this.unitSet.create(
                            unit.type,
                            Object.assign(
                                {},
                                (unit),
            Severity: Minor
            Found in src/charts/tau.gpl.ts and 1 other location - About 55 mins to fix
            src/charts/tau.gpl.ts on lines 152..158

            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 53.

            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 createScales = (() => {
            Severity: Minor
            Found in src/charts/tau.gpl.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 uid = utils.generateHash(
            Severity: Minor
            Found in src/charts/tau.gpl.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 ('{func}').
            Open

                        func: func,
            Severity: Minor
            Found in src/charts/tau.gpl.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.

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

                    var updateScalesQueue = this._flattenDrawScenario(root, (parentInstance, unit, rootFrame) => {
            Severity: Minor
            Found in src/charts/tau.gpl.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 'self' is never reassigned; use 'const' instead of 'var'.
            Open

                    var self = this;
            Severity: Minor
            Found in src/charts/tau.gpl.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.

            'Object.assign' returns the first argument. Prefer object spread if you want a new object.
            Open

                    this.transformations = Object.assign(
                        config.transformations || {},
                        {
                            where(data, tuple) {
                                var predicates = Object.keys(tuple || {}).map((k) => {
            Severity: Minor
            Found in src/charts/tau.gpl.ts by tslint

            Rule: prefer-object-spread

            Enforces the use of the ES2018 object spread operator over Object.assign() where appropriate.

            Rationale

            Object spread allows for better type checking and inference.

            Notes
            • Has Fix

            Config

            Not configurable.

            Examples
            "prefer-object-spread": true

            For more information see this page.

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

                    var traverse = (node: Unit, enter: Iteratee, exit: Iteratee, parentNode: Unit, currFrame: DataFrame) => {
            Severity: Minor
            Found in src/charts/tau.gpl.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.

            Use the object spread operator instead.
            Open

                            Object.assign(
                                {},
                                (unit),
                                {options: parentInstance.allocateRect(rootFrame.key)}
                            ));
            Severity: Minor
            Found in src/charts/tau.gpl.ts by tslint

            Rule: prefer-object-spread

            Enforces the use of the ES2018 object spread operator over Object.assign() where appropriate.

            Rationale

            Object spread allows for better type checking and inference.

            Notes
            • Has Fix

            Config

            Not configurable.

            Examples
            "prefer-object-spread": true

            For more information see this page.

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

                    var self = this;
            Severity: Minor
            Found in src/charts/tau.gpl.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.

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

                                        .reduce((memo, key) => (memo[key] = unit[key], memo), {})) +
            Severity: Minor
            Found in src/charts/tau.gpl.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.

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

                    var queue: (() => void)[] = [];
            Severity: Minor
            Found in src/charts/tau.gpl.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 queue = GPL.traverseSpec(
            Severity: Minor
            Found in src/charts/tau.gpl.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: (() => void)[] = [];
            Severity: Minor
            Found in src/charts/tau.gpl.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.

            Use the object spread operator instead.
            Open

                            Object.assign(
                                {},
                                (unit),
                                {options: parentInstance.allocateRect(rootFrame.key)}
                            ));
            Severity: Minor
            Found in src/charts/tau.gpl.ts by tslint

            Rule: prefer-object-spread

            Enforces the use of the ES2018 object spread operator over Object.assign() where appropriate.

            Rationale

            Object spread allows for better type checking and inference.

            Notes
            • Has Fix

            Config

            Not configurable.

            Examples
            "prefer-object-spread": true

            For more information see this page.

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

                    var scaleInfoQueue = this._flattenDrawScenario(root, (parentInstance, unit, rootFrame) => {
            Severity: Minor
            Found in src/charts/tau.gpl.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 frameConfig = {
            Severity: Minor
            Found in src/charts/tau.gpl.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 func = FramesAlgebra[funcName];
            Severity: Minor
            Found in src/charts/tau.gpl.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 'scaleInfoQueue' is never reassigned; use 'const' instead of 'var'.
            Open

                    var scaleInfoQueue = this._flattenDrawScenario(root, (parentInstance, unit, rootFrame) => {
            Severity: Minor
            Found in src/charts/tau.gpl.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.

            Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead.
            Open

            const MixinModel: new (prev: GrammarModel) => GrammarModel = <any>function (prev: GrammarModel) {
                Object
                    .keys(prev)
                    .forEach((k) => this[k] = prev[k]);
            };
            Severity: Minor
            Found in src/charts/tau.gpl.ts by tslint

            Rule: no-angle-bracket-type-assertion

            Requires the use of as Type for type assertions instead of <Type>.

            Rationale

            Both formats of type assertions have the same effect, but only as type assertions work in .tsx files. This rule ensures that you have a consistent type assertion style across your codebase.

            Notes
            • TypeScript Only
            • Has Fix

            Config

            Not configurable.

            Examples
            "no-angle-bracket-type-assertion": true

            For more information see this page.

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

                        var key = (alias || `${type}:default`);
            Severity: Minor
            Found in src/charts/tau.gpl.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 'cast' is never reassigned; use 'const' instead of 'var'.
            Open

            var cast = (v) => (utils.isDate(v) ? v.getTime() : v);
            Severity: Minor
            Found in src/charts/tau.gpl.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.

            Shadowed name: 'unitsRegistry'
            Open

                    unitsRegistry: UnitsRegistry,
            Severity: Minor
            Found in src/charts/tau.gpl.ts by tslint

            Rule: no-shadowed-variable

            Disallows shadowing variable declarations.

            Rationale

            When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

            const a = 'no shadow';
            function print() {
                console.log(a);
            }
            print(); // logs 'no shadow'.
            const a = 'no shadow';
            function print() {
                const a = 'shadow'; // TSLint will complain here.
                console.log(a);
            }
            print(); // logs 'shadow'.

            ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

            Config

            You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

            The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

            The following example shows how the "temporalDeadZone" option changes the linting result:

            function fn(value) {
                if (value) {
                    const tmp = value; // no error on this line if "temporalDeadZone" is false
                    return tmp;
                }
                let tmp = undefined;
                if (!value) {
                    const tmp = value; // this line always contains an error
                    return tmp;
                }
            }
            Examples
            "no-shadowed-variable": true
            "no-shadowed-variable": true,[object Object]
            Schema
            {
              "type": "object",
              "properties": {
                "class": {
                  "type": "boolean"
                },
                "enum": {
                  "type": "boolean"
                },
                "function": {
                  "type": "boolean"
                },
                "import": {
                  "type": "boolean"
                },
                "interface": {
                  "type": "boolean"
                },
                "namespace": {
                  "type": "boolean"
                },
                "typeAlias": {
                  "type": "boolean"
                },
                "typeParameter": {
                  "type": "boolean"
                },
                "temporalDeadZone": {
                  "type": "boolean"
                },
                "underscore": {
                  "type": "boolean"
                }
              }
            }

            For more information see this page.

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

                            var instance = iterator(top(), unit, currFrame);
            Severity: Minor
            Found in src/charts/tau.gpl.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 'expr' is never reassigned; use 'const' instead of 'var'.
            Open

                        var expr = this._parseExpression(root.expression, parentPipe, root.guide);
            Severity: Minor
            Found in src/charts/tau.gpl.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 flow = (expr.inherit ? parentPipe : []);
            Severity: Minor
            Found in src/charts/tau.gpl.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 bInherit = expr.inherit !== false; // true by default
            Severity: Minor
            Found in src/charts/tau.gpl.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 ('{pipe}').
            Open

                                pipe: pipe,
            Severity: Minor
            Found in src/charts/tau.gpl.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 predicates = Object.keys(tuple || {}).map((k) => {
            Severity: Minor
            Found in src/charts/tau.gpl.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 uids = {};
            Severity: Minor
            Found in src/charts/tau.gpl.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 self = this;
            Severity: Minor
            Found in src/charts/tau.gpl.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 key = (alias || `${type}:default`);
            Severity: Minor
            Found in src/charts/tau.gpl.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 'top' is never reassigned; use 'const' instead of 'var'.
            Open

                    var top = (() => stack[0]);
            Severity: Minor
            Found in src/charts/tau.gpl.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.

            Shadowed name: 'enter'
            Open

                    var traverse = (node: Unit, enter: Iteratee, exit: Iteratee, parentNode: Unit, currFrame: DataFrame) => {
            Severity: Minor
            Found in src/charts/tau.gpl.ts by tslint

            Rule: no-shadowed-variable

            Disallows shadowing variable declarations.

            Rationale

            When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

            const a = 'no shadow';
            function print() {
                console.log(a);
            }
            print(); // logs 'no shadow'.
            const a = 'no shadow';
            function print() {
                const a = 'shadow'; // TSLint will complain here.
                console.log(a);
            }
            print(); // logs 'shadow'.

            ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

            Config

            You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

            The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

            The following example shows how the "temporalDeadZone" option changes the linting result:

            function fn(value) {
                if (value) {
                    const tmp = value; // no error on this line if "temporalDeadZone" is false
                    return tmp;
                }
                let tmp = undefined;
                if (!value) {
                    const tmp = value; // this line always contains an error
                    return tmp;
                }
            }
            Examples
            "no-shadowed-variable": true
            "no-shadowed-variable": true,[object Object]
            Schema
            {
              "type": "object",
              "properties": {
                "class": {
                  "type": "boolean"
                },
                "enum": {
                  "type": "boolean"
                },
                "function": {
                  "type": "boolean"
                },
                "import": {
                  "type": "boolean"
                },
                "interface": {
                  "type": "boolean"
                },
                "namespace": {
                  "type": "boolean"
                },
                "typeAlias": {
                  "type": "boolean"
                },
                "typeParameter": {
                  "type": "boolean"
                },
                "temporalDeadZone": {
                  "type": "boolean"
                },
                "underscore": {
                  "type": "boolean"
                }
              }
            }

            For more information see this page.

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

                    var funcName = expr.operator || 'none';
            Severity: Minor
            Found in src/charts/tau.gpl.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 funcArgs = expr.params;
            Severity: Minor
            Found in src/charts/tau.gpl.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 'instance' is never reassigned; use 'const' instead of 'var'.
            Open

                            var instance = iterator(top(), unit, currFrame);
            Severity: Minor
            Found in src/charts/tau.gpl.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 'scenario' is never reassigned; use 'const' instead of 'var'.
            Open

                    var scenario: GrammarElement[] = [];
            Severity: Minor
            Found in src/charts/tau.gpl.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.

            Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead.
            Open

                    return <ScaleFactoryMethod>((type, alias, dynamicProps) => {
                        var key = (alias || `${type}:default`);
                        return self
                            .scalesHub
                            .createScaleInfo(self.scales[key], passFrame)
            Severity: Minor
            Found in src/charts/tau.gpl.ts by tslint

            Rule: no-angle-bracket-type-assertion

            Requires the use of as Type for type assertions instead of <Type>.

            Rationale

            Both formats of type assertions have the same effect, but only as type assertions work in .tsx files. This rule ensures that you have a consistent type assertion style across your codebase.

            Notes
            • TypeScript Only
            • Has Fix

            Config

            Not configurable.

            Examples
            "no-angle-bracket-type-assertion": true

            For more information see this page.

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

                    var put = ((x) => stack.unshift(x));
            Severity: Minor
            Found in src/charts/tau.gpl.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 traverse = (node: Unit, enter: Iteratee, exit: Iteratee, parentNode: Unit, currFrame: DataFrame) => {
            Severity: Minor
            Found in src/charts/tau.gpl.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 pop = (() => stack.shift());
            Severity: Minor
            Found in src/charts/tau.gpl.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 self = this;
            Severity: Minor
            Found in src/charts/tau.gpl.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 clone = utils.clone(unit);
            Severity: Minor
            Found in src/charts/tau.gpl.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 'createScales' is never reassigned; use 'const' instead of 'var'.
            Open

                    var createScales = (() => {
            Severity: Minor
            Found in src/charts/tau.gpl.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 'funcName' is never reassigned; use 'const' instead of 'var'.
            Open

                    var funcName = expr.operator || 'none';
            Severity: Minor
            Found in src/charts/tau.gpl.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 'funcArgs' is never reassigned; use 'const' instead of 'var'.
            Open

                    var funcArgs = expr.params;
            Severity: Minor
            Found in src/charts/tau.gpl.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 'frameConfig' is never reassigned; use 'const' instead of 'var'.
            Open

                    var frameConfig = {
            Severity: Minor
            Found in src/charts/tau.gpl.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 'put' is never reassigned; use 'const' instead of 'var'.
            Open

                    var put = ((x) => stack.unshift(x));
            Severity: Minor
            Found in src/charts/tau.gpl.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 'pop' is never reassigned; use 'const' instead of 'var'.
            Open

                    var pop = (() => stack.shift());
            Severity: Minor
            Found in src/charts/tau.gpl.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 'queue' is never reassigned; use 'const' instead of 'var'.
            Open

                    var queue = GPL.traverseSpec(
            Severity: Minor
            Found in src/charts/tau.gpl.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 'self' is never reassigned; use 'const' instead of 'var'.
            Open

                    var self = this;
            Severity: Minor
            Found in src/charts/tau.gpl.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 stack = [root];
            Severity: Minor
            Found in src/charts/tau.gpl.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 top = (() => stack[0]);
            Severity: Minor
            Found in src/charts/tau.gpl.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 expr = this._parseExpression(root.expression, parentPipe, root.guide);
            Severity: Minor
            Found in src/charts/tau.gpl.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 srcAlias = expr.source;
            Severity: Minor
            Found in src/charts/tau.gpl.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 'dataFn' is never reassigned; use 'const' instead of 'var'.
            Open

                    var dataFn = () => this._datify(frameConfig).part();
            Severity: Minor
            Found in src/charts/tau.gpl.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.

            Shadowed name: 'exit'
            Open

                    var traverse = (node: Unit, enter: Iteratee, exit: Iteratee, parentNode: Unit, currFrame: DataFrame) => {
            Severity: Minor
            Found in src/charts/tau.gpl.ts by tslint

            Rule: no-shadowed-variable

            Disallows shadowing variable declarations.

            Rationale

            When a variable in a local scope and a variable in the containing scope have the same name, shadowing occurs. Shadowing makes it impossible to access the variable in the containing scope and obscures to what value an identifier actually refers. Compare the following snippets:

            const a = 'no shadow';
            function print() {
                console.log(a);
            }
            print(); // logs 'no shadow'.
            const a = 'no shadow';
            function print() {
                const a = 'shadow'; // TSLint will complain here.
                console.log(a);
            }
            print(); // logs 'shadow'.

            ESLint has an equivalent rule. For more background information, refer to this MDN closure doc.

            Config

            You can optionally pass an object to disable checking for certain kinds of declarations. Possible keys are "class", "enum", "function", "import", "interface", "namespace", "typeAlias" and "typeParameter". You can also pass "underscore" to ignore variable names that begin with _. Just set the value to false for the check you want to disable. All checks default to true, i.e. are enabled by default. Note that you cannot disable variables and parameters.

            The option "temporalDeadZone" defaults to true which shows errors when shadowing block scoped declarations in their temporal dead zone. When set to false parameters, classes, enums and variables declared with let or const are not considered shadowed if the shadowing occurs within their temporal dead zone.

            The following example shows how the "temporalDeadZone" option changes the linting result:

            function fn(value) {
                if (value) {
                    const tmp = value; // no error on this line if "temporalDeadZone" is false
                    return tmp;
                }
                let tmp = undefined;
                if (!value) {
                    const tmp = value; // this line always contains an error
                    return tmp;
                }
            }
            Examples
            "no-shadowed-variable": true
            "no-shadowed-variable": true,[object Object]
            Schema
            {
              "type": "object",
              "properties": {
                "class": {
                  "type": "boolean"
                },
                "enum": {
                  "type": "boolean"
                },
                "function": {
                  "type": "boolean"
                },
                "import": {
                  "type": "boolean"
                },
                "interface": {
                  "type": "boolean"
                },
                "namespace": {
                  "type": "boolean"
                },
                "typeAlias": {
                  "type": "boolean"
                },
                "typeParameter": {
                  "type": "boolean"
                },
                "temporalDeadZone": {
                  "type": "boolean"
                },
                "underscore": {
                  "type": "boolean"
                }
              }
            }

            For more information see this page.

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

                            var flow = (expr.inherit ? parentPipe : []);
            Severity: Minor
            Found in src/charts/tau.gpl.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 'pipe' is never reassigned; use 'const' instead of 'var'.
            Open

                            var pipe = (flow)
            Severity: Minor
            Found in src/charts/tau.gpl.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 cast = (v) => (utils.isDate(v) ? v.getTime() : v);
            Severity: Minor
            Found in src/charts/tau.gpl.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 updateScalesQueue = this._flattenDrawScenario(root, (parentInstance, unit, rootFrame) => {
            Severity: Minor
            Found in src/charts/tau.gpl.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 scenario: GrammarElement[] = [];
            Severity: Minor
            Found in src/charts/tau.gpl.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 pipe = (flow)
            Severity: Minor
            Found in src/charts/tau.gpl.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 dataFn = () => this._datify(frameConfig).part();
            Severity: Minor
            Found in src/charts/tau.gpl.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 'uids' is never reassigned; use 'const' instead of 'var'.
            Open

                    var uids = {};
            Severity: Minor
            Found in src/charts/tau.gpl.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 'predicates' is never reassigned; use 'const' instead of 'var'.
            Open

                                var predicates = Object.keys(tuple || {}).map((k) => {
            Severity: Minor
            Found in src/charts/tau.gpl.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 'stack' is never reassigned; use 'const' instead of 'var'.
            Open

                    var stack = [root];
            Severity: Minor
            Found in src/charts/tau.gpl.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 'clone' is never reassigned; use 'const' instead of 'var'.
            Open

                                        var clone = utils.clone(unit);
            Severity: Minor
            Found in src/charts/tau.gpl.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 'srcAlias' is never reassigned; use 'const' instead of 'var'.
            Open

                    var srcAlias = expr.source;
            Severity: Minor
            Found in src/charts/tau.gpl.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 'bInherit' is never reassigned; use 'const' instead of 'var'.
            Open

                    var bInherit = expr.inherit !== false; // true by default
            Severity: Minor
            Found in src/charts/tau.gpl.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 'func' is never reassigned; use 'const' instead of 'var'.
            Open

                    var func = FramesAlgebra[funcName];
            Severity: Minor
            Found in src/charts/tau.gpl.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.

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

                    var self = this;
            Severity: Minor
            Found in src/charts/tau.gpl.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.

            There are no issues that match your filters.

            Category
            Status