TargetProcess/tauCharts

View on GitHub
src/grammar-registry.ts

Summary

Maintainability
F
3 days
Test Coverage

File grammar-registry.ts has 458 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as utils from './utils/utils';
import {UnitDomainPeriodGenerator} from './unit-domain-period-generator';
import {TauChartError as Error, errorCodes} from './error';
import {
    GrammarModel,
Severity: Minor
Found in src/grammar-registry.ts - About 7 hrs to fix

    Function method has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                ((model) => {
                    const dataSource = model.data();
                    const xColors = dataSource
                        .reduce((map, row) => {
                            const x = row[model.scaleX.dim];
    Severity: Minor
    Found in src/grammar-registry.ts - About 1 hr to fix

      Function fixScale has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              const fixScale = (scale: ScaleFunction, start, end, flip) => {
      
                  var domain = scale.domain();
                  var length = Math.abs(scale.value(domain[1]) - scale.value(domain[0]));
                  var koeff = ((domain[1] - domain[0]) / length);
      Severity: Minor
      Found in src/grammar-registry.ts - About 1 hr to fix

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

                model.scaleSize.fixup((prev) => {
        
                    const next: ScaleConfig = {};
        
                    if (!prev.fixed) {
        Severity: Major
        Found in src/grammar-registry.ts and 1 other location - About 4 hrs to fix
        src/grammar-registry.ts on lines 261..276

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

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

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

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

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

        Refactorings

        Further Reading

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

                model.scaleSize.fixup((prev) => {
        
                    const next: ScaleConfig = {};
        
                    if (!prev.fixed) {
        Severity: Major
        Found in src/grammar-registry.ts and 1 other location - About 4 hrs to fix
        src/grammar-registry.ts on lines 344..359

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

        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

                var diff = (xs
                    .slice(1)
                    .map((curr) => {
                        var diff = (curr - prev);
                        prev = curr;
        Severity: Major
        Found in src/grammar-registry.ts and 1 other location - About 2 hrs to fix
        src/grammar-registry.ts on lines 311..321

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

        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 diffX = (xs
                    .slice(1)
                    .map((curr) => {
                        const diff = (curr - prev);
                        prev = curr;
        Severity: Major
        Found in src/grammar-registry.ts and 1 other location - About 2 hrs to fix
        src/grammar-registry.ts on lines 241..251

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

        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

                        if (!ignoreX) {
                            x = model.xi(row);
                            memo.left = Math.min(memo.left, x - r);
                            memo.right = Math.max(memo.right, x + r);
                        }
        Severity: Major
        Found in src/grammar-registry.ts and 1 other location - About 2 hrs to fix
        src/grammar-registry.ts on lines 402..406

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

        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

                        if (!ignoreY) {
                            y = model.yi(row);
                            memo.top = Math.min(memo.top, y - r);
                            memo.bottom = Math.max(memo.bottom, y + r);
                        }
        Severity: Major
        Found in src/grammar-registry.ts and 1 other location - About 2 hrs to fix
        src/grammar-registry.ts on lines 397..401

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

        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 fibers = (Object
                    .keys(groups)
                    .sort((a, b) => model.order(a) - model.order(b)))
                    .reduce((memo, k) => memo.concat([groups[k]]), []);
        Severity: Major
        Found in src/grammar-registry.ts and 1 other location - About 1 hr to fix
        src/elements/element.generic.cartesian.ts on lines 143..146

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

        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

        Shadowed name: 'prev'
        Open

                model.scaleSize.fixup((prev) => {
        Severity: Minor
        Found in src/grammar-registry.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 k = model.group(row);
        Severity: Minor
        Found in src/grammar-registry.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 border = model.data()
        Severity: Minor
        Found in src/grammar-registry.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 'baseScale' is never reassigned; use 'const' instead of 'var'.
        Open

                var baseScale = model.scaleY;
        Severity: Minor
        Found in src/grammar-registry.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 'valsScale' is never reassigned; use 'const' instead of 'var'.
        Open

                var valsScale = model.scaleX;
        Severity: Minor
        Found in src/grammar-registry.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 'relSegmStart' is never reassigned; use 'const' instead of 'var'.
        Open

                                var relSegmStart = ((1 + index) * middleStep);
        Severity: Minor
        Found in src/grammar-registry.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 'categories' is never reassigned; use 'const' instead of 'var'.
        Open

                        var categories = scaleColor.discrete ?
        Severity: Minor
        Found in src/grammar-registry.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 'curr' is never reassigned; use 'const' instead of 'var'.
        Open

                var curr = {
        Severity: Minor
        Found in src/grammar-registry.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 'Ab' is never reassigned; use 'const' instead of 'var'.
        Open

                    var Ab = (currMinSize + maxSizeLimit) / 2;
        Severity: Minor
        Found in src/grammar-registry.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: 'diff'
        Open

                    .filter(diff => (diff > 0))
        Severity: Minor
        Found in src/grammar-registry.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 '_endPad' is never reassigned; use 'const' instead of 'var'.
        Open

                    var _endPad = Math.max(0, (end - length));
        Severity: Minor
        Found in src/grammar-registry.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: 'model'
        Open

                    ((model) => {
        Severity: Minor
        Found in src/grammar-registry.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 baseScale = model.scaleY;
        Severity: Minor
        Found in src/grammar-registry.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 space = ((d) => baseScale.stepSize(d[baseScale.dim]) * (categoriesCount / (1 + categoriesCount)));
        Severity: Minor
        Found in src/grammar-registry.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 plannedMaxSize;
        Severity: Minor
        Found in src/grammar-registry.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 r = ((s >= plannedMinSize ?
        Severity: Minor
        Found in src/grammar-registry.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 startPad = model.flip ? _endPad : _startPad;
        Severity: Minor
        Found in src/grammar-registry.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.

        Multiple variable declarations in the same statement are forbidden
        Open

                        var x, y;
        Severity: Minor
        Found in src/grammar-registry.ts by tslint

        Rule: one-variable-per-declaration

        Disallows multiple variable definitions in the same declaration statement.

        Config

        One argument may be optionally provided:

        • ignore-for-loop allows multiple variable definitions in a for loop declaration.
        Examples
        "one-variable-per-declaration": true
        "one-variable-per-declaration": true,ignore-for-loop
        Schema
        {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "ignore-for-loop"
            ]
          },
          "minLength": 0,
          "maxLength": 1
        }

        For more information see this page.

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

                        var diff = (curr - prev);
        Severity: Minor
        Found in src/grammar-registry.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 'border' is never reassigned; use 'const' instead of 'var'.
        Open

                var border = model.data()
        Severity: Minor
        Found in src/grammar-registry.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 method: GrammarRule = (model.scaleX.discrete ?
        Severity: Minor
        Found in src/grammar-registry.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 prev = xs[0];
        Severity: Minor
        Found in src/grammar-registry.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 At = maxSizeLimit;
        Severity: Minor
        Found in src/grammar-registry.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 _endPad = Math.max(0, (end - length));
        Severity: Minor
        Found in src/grammar-registry.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 'next' is never reassigned; use 'const' instead of 'var'.
        Open

                    var next: ScaleConfig = {};
        Severity: Minor
        Found in src/grammar-registry.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 'At' is never reassigned; use 'const' instead of 'var'.
        Open

                    var At = maxSizeLimit;
        Severity: Minor
        Found in src/grammar-registry.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 domain = scale.domain();
        Severity: Minor
        Found in src/grammar-registry.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 '_startPad' is never reassigned; use 'const' instead of 'var'.
        Open

                    var _startPad = Math.max(0, (-start));
        Severity: Minor
        Found in src/grammar-registry.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 diff = (xs
        Severity: Minor
        Found in src/grammar-registry.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 endVal = Number(domain[1]) + ((flip ? startPad : endPad) * koeff);
        Severity: Minor
        Found in src/grammar-registry.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 'r' is never reassigned; use 'const' instead of 'var'.
        Open

                        var r = ((s >= plannedMinSize ?
        Severity: Minor
        Found in src/grammar-registry.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 trackedMaxY = Number.MIN_VALUE;
        Severity: Minor
        Found in src/grammar-registry.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 diff = (curr - prev);
        Severity: Minor
        Found in src/grammar-registry.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 Wx = 0.5;
        Severity: Minor
        Found in src/grammar-registry.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 x, y;
        Severity: Minor
        Found in src/grammar-registry.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 linearlyScaledMaxSize = Math.min(plannedMaxSize * kx, plannedMaxSize * ky);
        Severity: Minor
        Found in src/grammar-registry.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 'availableSpace' is never reassigned; use 'const' instead of 'var'.
        Open

                                var availableSpace = space(d);
        Severity: Minor
        Found in src/grammar-registry.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 'absTickStart' is never reassigned; use 'const' instead of 'var'.
        Open

                                var absTickStart = (model.xi(d) - (total + 1) * middleStep / 2);
        Severity: Minor
        Found in src/grammar-registry.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 categoriesCount = (categories.length || 1);
        Severity: Minor
        Found in src/grammar-registry.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 curr = {
        Severity: Minor
        Found in src/grammar-registry.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 's' is never reassigned; use 'const' instead of 'var'.
        Open

                        var s = model.size(row);
        Severity: Minor
        Found in src/grammar-registry.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: 'prev'
        Open

                model.scaleSize.fixup((prev) => {
        Severity: Minor
        Found in src/grammar-registry.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 availableSpace = space(d);
        Severity: Minor
        Found in src/grammar-registry.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 next: ScaleConfig = {};
        Severity: Minor
        Found in src/grammar-registry.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 prev = xs[0];
        Severity: Minor
        Found in src/grammar-registry.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 Ab = (currMinSize + maxSizeLimit) / 2;
        Severity: Minor
        Found in src/grammar-registry.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 plannedMinSize;
        Severity: Minor
        Found in src/grammar-registry.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 'middleStep' is never reassigned; use 'const' instead of 'var'.
        Open

                                var middleStep = (availableSpace / (categoriesCount + 1));
        Severity: Minor
        Found in src/grammar-registry.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 'method' is never reassigned; use 'const' instead of 'var'.
        Open

                var method: GrammarRule = (model.scaleX.discrete ?
        Severity: Minor
        Found in src/grammar-registry.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 'startPad' is never reassigned; use 'const' instead of 'var'.
        Open

                    var startPad = model.flip ? _endPad : _startPad;
        Severity: Minor
        Found in src/grammar-registry.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: 'groups'
        Open

                    const groups = utils.groupBy(fiberSorted, (row) => row[dx]);
        Severity: Minor
        Found in src/grammar-registry.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.

        Shadowed name: 'xs'
        Open

                    const xs = getUsualXs() as Date[];
        Severity: Minor
        Found in src/grammar-registry.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 valsScale = model.scaleX;
        Severity: Minor
        Found in src/grammar-registry.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 middleStep = (availableSpace / (categoriesCount + 1));
        Severity: Minor
        Found in src/grammar-registry.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 _startPad = Math.max(0, (-start));
        Severity: Minor
        Found in src/grammar-registry.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 'Wx' is never reassigned; use 'const' instead of 'var'.
        Open

                    var Wx = 0.5;
        Severity: Minor
        Found in src/grammar-registry.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: 'curr'
        Open

                    .map((curr) => {
        Severity: Minor
        Found in src/grammar-registry.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 absTickStart = (model.xi(d) - (total + 1) * middleStep / 2);
        Severity: Minor
        Found in src/grammar-registry.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 X0 = currMinSize;
        Severity: Minor
        Found in src/grammar-registry.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 length = Math.abs(scale.value(domain[1]) - scale.value(domain[0]));
        Severity: Minor
        Found in src/grammar-registry.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 kx = (ignoreX ? 1 : fixScale(model.scaleX, border.left, border.right, false));
        Severity: Minor
        Found in src/grammar-registry.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 linearlyScaledMinSize = Math.min(plannedMinSize * kx, plannedMinSize * ky);
        Severity: Minor
        Found in src/grammar-registry.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 'scaleColor' is never reassigned; use 'const' instead of 'var'.
        Open

                        var scaleColor = model.scaleColor;
        Severity: Minor
        Found in src/grammar-registry.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 'linearlyScaledMaxSize' is never reassigned; use 'const' instead of 'var'.
        Open

                var linearlyScaledMaxSize = Math.min(plannedMaxSize * kx, plannedMaxSize * ky);
        Severity: Minor
        Found in src/grammar-registry.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 trackedMinY = Number.MAX_VALUE;
        Severity: Minor
        Found in src/grammar-registry.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 endPad = model.flip ? _startPad : _endPad;
        Severity: Minor
        Found in src/grammar-registry.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 startVal = Number(domain[0]) - ((flip ? endPad : startPad) * koeff);
        Severity: Minor
        Found in src/grammar-registry.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 ky = (ignoreY ? 1 : fixScale(model.scaleY, border.top, border.bottom, true));
        Severity: Minor
        Found in src/grammar-registry.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 'categoriesCount' is never reassigned; use 'const' instead of 'var'.
        Open

                        var categoriesCount = (categories.length || 1);
        Severity: Minor
        Found in src/grammar-registry.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 'space' is never reassigned; use 'const' instead of 'var'.
        Open

                        var space = ((d) => baseScale.stepSize(d[baseScale.dim]) * (categoriesCount / (1 + categoriesCount)));
        Severity: Minor
        Found in src/grammar-registry.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 'k' is never reassigned; use 'const' instead of 'var'.
        Open

                    var k = model.group(row);
        Severity: Minor
        Found in src/grammar-registry.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 'diff' is never reassigned; use 'const' instead of 'var'.
        Open

                var diff = (xs
        Severity: Minor
        Found in src/grammar-registry.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: 'curr'
        Open

                    .map((curr) => {
        Severity: Minor
        Found in src/grammar-registry.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 baseScale = model.scaleX;
        Severity: Minor
        Found in src/grammar-registry.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 scaleColor = model.scaleColor;
        Severity: Minor
        Found in src/grammar-registry.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 'baseScale' is never reassigned; use 'const' instead of 'var'.
        Open

                        var baseScale = model.scaleX;
        Severity: Minor
        Found in src/grammar-registry.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 'X0' is never reassigned; use 'const' instead of 'var'.
        Open

                    var X0 = currMinSize;
        Severity: Minor
        Found in src/grammar-registry.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 'length' is never reassigned; use 'const' instead of 'var'.
        Open

                    var length = Math.abs(scale.value(domain[1]) - scale.value(domain[0]));
        Severity: Minor
        Found in src/grammar-registry.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 'endVal' is never reassigned; use 'const' instead of 'var'.
        Open

                    var endVal = Number(domain[1]) + ((flip ? startPad : endPad) * koeff);
        Severity: Minor
        Found in src/grammar-registry.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 'kx' is never reassigned; use 'const' instead of 'var'.
        Open

                var kx = (ignoreX ? 1 : fixScale(model.scaleX, border.left, border.right, false));
        Severity: Minor
        Found in src/grammar-registry.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 'linearlyScaledMinSize' is never reassigned; use 'const' instead of 'var'.
        Open

                var linearlyScaledMinSize = Math.min(plannedMinSize * kx, plannedMinSize * ky);
        Severity: Minor
        Found in src/grammar-registry.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: 'diff'
        Open

                        var diff = (curr - prev);
        Severity: Minor
        Found in src/grammar-registry.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.

        Shadowed name: 'memo'
        Open

                            return Object.keys(bySign).reduce((memo, s) => memo.concat(merge(xs, bySign[s], s)), memo);
        Severity: Minor
        Found in src/grammar-registry.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 categories = scaleColor.discrete ?
        Severity: Minor
        Found in src/grammar-registry.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 relSegmStart = ((1 + index) * middleStep);
        Severity: Minor
        Found in src/grammar-registry.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 s = model.size(row);
        Severity: Minor
        Found in src/grammar-registry.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 koeff = ((domain[1] - domain[0]) / length);
        Severity: Minor
        Found in src/grammar-registry.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 next: ScaleConfig = {};
        Severity: Minor
        Found in src/grammar-registry.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 'startVal' is never reassigned; use 'const' instead of 'var'.
        Open

                    var startVal = Number(domain[0]) - ((flip ? endPad : startPad) * koeff);
        Severity: Minor
        Found in src/grammar-registry.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 'ky' is never reassigned; use 'const' instead of 'var'.
        Open

                var ky = (ignoreY ? 1 : fixScale(model.scaleY, border.top, border.bottom, true));
        Severity: Minor
        Found in src/grammar-registry.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 'next' is never reassigned; use 'const' instead of 'var'.
        Open

                        var next: ScaleConfig = {};
        Severity: Minor
        Found in src/grammar-registry.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 'endPad' is never reassigned; use 'const' instead of 'var'.
        Open

                    var endPad = model.flip ? _startPad : _endPad;
        Severity: Minor
        Found in src/grammar-registry.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 'domain' is never reassigned; use 'const' instead of 'var'.
        Open

                    var domain = scale.domain();
        Severity: Minor
        Found in src/grammar-registry.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 'koeff' is never reassigned; use 'const' instead of 'var'.
        Open

                    var koeff = ((domain[1] - domain[0]) / length);
        Severity: Minor
        Found in src/grammar-registry.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.

        There are no issues that match your filters.

        Category
        Status