TargetProcess/tauCharts

View on GitHub
src/spec-transform-auto-layout.ts

Summary

Maintainability
F
1 wk
Test Coverage

File spec-transform-auto-layout.ts has 665 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as utils from './utils/utils';
import {FormatterRegistry} from './formatter-registry';
import * as d3 from 'd3-scale';
import {
    ChartSettings,
Severity: Major
Found in src/spec-transform-auto-layout.ts - About 1 day to fix

    Function calcXYGuide has 124 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function calcXYGuide(
        guide: UnitGuide,
        settings: ChartSettings,
        xMeta,
        yMeta,
    Severity: Major
    Found in src/spec-transform-auto-layout.ts - About 4 hrs to fix

      Function calcXYGuide has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

      function calcXYGuide(
          guide: UnitGuide,
          settings: ChartSettings,
          xMeta,
          yMeta,
      Severity: Minor
      Found in src/spec-transform-auto-layout.ts - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function BUILD-LABELS has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          'BUILD-LABELS': (srcSpec, meta) => {
      
              var spec = utils.clone(srcSpec);
      
              var xLabels = [];
      Severity: Major
      Found in src/spec-transform-auto-layout.ts - About 2 hrs to fix

        Function BUILD-GUIDE has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            'BUILD-GUIDE': (srcSpec, meta, settings) => {
        
                var spec = utils.clone(srcSpec);
                fnTraverseSpec(
                    utils.clone(spec.unit),
        Severity: Major
        Found in src/spec-transform-auto-layout.ts - About 2 hrs to fix

          Function BUILD-COMPACT has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              'BUILD-COMPACT': (srcSpec, meta, settings) => {
          
                  var spec = utils.clone(srcSpec);
                  fnTraverseSpec(
                      utils.clone(spec.unit),
          Severity: Minor
          Found in src/spec-transform-auto-layout.ts - About 1 hr to fix

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

                get: (typeName, settings, srcSpec, fnCreateScale) => {
            
                    var engine = (SpecEngineTypeMap[typeName] || SpecEngineTypeMap.NONE);
            
                    var meta: EngineMeta = {
            Severity: Minor
            Found in src/spec-transform-auto-layout.ts - About 1 hr to fix

              Function calcXYGuide has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  guide: UnitGuide,
                  settings: ChartSettings,
                  xMeta,
                  yMeta,
                  inlineLabels?: boolean,
              Severity: Minor
              Found in src/spec-transform-auto-layout.ts - About 45 mins to fix

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

                var calcUnitGuide = function ({unit, meta, settings, allowXVertical, allowYVertical, inlineLabels}: CalcUnitArgs) {
                
                    var dimX = meta.dimension(unit.x);
                    var dimY = meta.dimension(unit.y);
                
                
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts - About 45 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function getMaxTickLabelSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                var getMaxTickLabelSize = function (domainValues, formatter, fnCalcTickLabelSize, axisLabelLimit) {
                
                    if (domainValues.length === 0) {
                        return {width: 0, height: 0};
                    }
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function BUILD-LABELS has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    'BUILD-LABELS': (srcSpec, meta) => {
                
                        var spec = utils.clone(srcSpec);
                
                        var xLabels = [];
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                                if (x) {
                                    xLabels.push(x);
                                    unit.guide.x.tickFormatNullAlias = unit.guide.x.hasOwnProperty('tickFormatNullAlias') ?
                                        unit.guide.x.tickFormatNullAlias :
                                    'No ' + x;
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 4 hrs to fix
                src/spec-transform-auto-layout.ts on lines 562..569

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

                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 (y) {
                                    yLabels.push(y);
                                    unit.guide.y.tickFormatNullAlias = unit.guide.y.hasOwnProperty('tickFormatNullAlias') ?
                                        unit.guide.y.tickFormatNullAlias :
                                    'No ' + y;
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 4 hrs to fix
                src/spec-transform-auto-layout.ts on lines 552..559

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

                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

                                unit.guide.y.label = utils.isObject(unit.guide.y.label)
                                    ? unit.guide.y.label
                                    : {text: unit.guide.y.label && unit.guide.y.label.text ? unit.guide.y.label.text : ''};
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 4 hrs to fix
                src/spec-transform-auto-layout.ts on lines 536..538

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

                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

                                unit.guide.x.label = utils.isObject(unit.guide.x.label)
                                    ? unit.guide.x.label
                                    : {text: unit.guide.x.label && unit.guide.x.label.text ? unit.guide.x.label.text : ''};
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 4 hrs to fix
                src/spec-transform-auto-layout.ts on lines 539..541

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

                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

                    guide.y = Object.assign(
                        (guide.y),
                        {
                            density: (rotYBox.height + getSettings(settings, 'yDensityPadding', yMeta.dimType) * 2),
                            tickFontHeight: maxYTickBox.height,
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 3 hrs to fix
                src/spec-transform-auto-layout.ts on lines 394..403

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

                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

                    guide.x = Object.assign(
                        (guide.x),
                        {
                            density: (rotXBox.width + getSettings(settings, 'xDensityPadding', xMeta.dimType) * 2),
                            tickFontHeight: maxXTickBox.height,
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 3 hrs to fix
                src/spec-transform-auto-layout.ts on lines 405..414

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

                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

                                unit.guide.y = Object.assign(
                                    (unit.guide.y),
                                    {
                                        cssClass: (isFacetUnit) ? (unit.guide.y.cssClass + ' facet-axis') : (unit.guide.y.cssClass),
                                        avoidCollisions: (isFacetUnit) ? false : (unit.guide.y.avoidCollisions)
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 3 hrs to fix
                src/spec-transform-auto-layout.ts on lines 630..635

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

                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

                                unit.guide.x = Object.assign(
                                    (unit.guide.x),
                                    {
                                        cssClass: (isFacetUnit) ? (unit.guide.x.cssClass + ' facet-axis') : (unit.guide.x.cssClass),
                                        avoidCollisions: (isFacetUnit) ? true : (unit.guide.x.avoidCollisions)
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 3 hrs to fix
                src/spec-transform-auto-layout.ts on lines 637..642

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

                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 (maxYTickBox.width > settings.yAxisTickLabelLimit) {
                        guide.y.tickFormatWordWrap = true;
                        guide.y.tickFormatWordWrapLines = settings.yTickWordWrapLinesLimit;
                        multiLinesYBox = wrapLine(maxYTickBox, settings.yAxisTickLabelLimit, settings.yTickWordWrapLinesLimit);
                    }
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 1 hr to fix
                src/spec-transform-auto-layout.ts on lines 292..296

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

                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 (maxXTickBox.width > settings.xAxisTickLabelLimit) {
                        guide.x.tickFormatWordWrap = true;
                        guide.x.tickFormatWordWrapLines = settings.xTickWordWrapLinesLimit;
                        multiLinesXBox = wrapLine(maxXTickBox, settings.xAxisTickLabelLimit, settings.xTickWordWrapLinesLimit);
                    }
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 1 hr to fix
                src/spec-transform-auto-layout.ts on lines 298..302

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

                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 (unit.x) {
                                    unit.guide.x.label.text = unit.guide.x.label.text || meta.dimension(unit.x).dimName;
                                }
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 1 hr to fix
                src/spec-transform-auto-layout.ts on lines 547..549

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

                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 (unit.y) {
                                    unit.guide.y.label.text = unit.guide.y.label.text || meta.dimension(unit.y).dimName;
                                }
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 1 hr to fix
                src/spec-transform-auto-layout.ts on lines 543..545

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

                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 (yUnit) {
                            yUnit.guide.y.label.text = (yUnit.guide.y.label.hide) ? '' : yLabels.join(rightArrow);
                        }
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 1 hr to fix
                src/spec-transform-auto-layout.ts on lines 576..578

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

                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 (xUnit) {
                            xUnit.guide.x.label.text = (xUnit.guide.x.label.hide) ? '' : xLabels.join(rightArrow);
                        }
                Severity: Major
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 1 hr to fix
                src/spec-transform-auto-layout.ts on lines 580..582

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

                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

                    unit.guide.y.tickFormat = shortFormat(
                        (unit.guide.y.tickFormat || getTickFormat(dimY, settings.defaultFormats)),
                        settings.utcTime);
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 55 mins to fix
                src/spec-transform-auto-layout.ts on lines 438..440

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 53.

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

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

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

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

                Refactorings

                Further Reading

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

                    unit.guide.x.tickFormat = shortFormat(
                        (unit.guide.x.tickFormat || getTickFormat(dimX, settings.defaultFormats)),
                        settings.utcTime);
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 55 mins to fix
                src/spec-transform-auto-layout.ts on lines 441..443

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 53.

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

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

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

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

                Refactorings

                Further Reading

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

                    constructor(spec: GPLSpec) {
                        this.spec = spec;
                        this.isApplicable = utils.isSpecRectCoordsOnly(spec.unit);
                    }
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 40 mins to fix
                src/spec-transform-calc-size.ts on lines 243..246

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

                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

                SpecEngineTypeMap.AUTO = (srcSpec, meta, settings) => {
                    return ['BUILD-LABELS', 'BUILD-GUIDE'].reduce(
                        (spec, engineName) => SpecEngineTypeMap[engineName](spec, meta, settings),
                        srcSpec
                    );
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 40 mins to fix
                src/spec-transform-auto-layout.ts on lines 727..732

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

                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

                SpecEngineTypeMap.COMPACT = (srcSpec, meta, settings) => {
                    return ['BUILD-LABELS', 'BUILD-COMPACT'].reduce(
                        (spec, engineName) => SpecEngineTypeMap[engineName](spec, meta, settings),
                        srcSpec
                    );
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 40 mins to fix
                src/spec-transform-auto-layout.ts on lines 720..725

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

                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

                        childUnit.guide.y = utils.defaults(childUnit.guide.y, utils.clone(root.guide.y));
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 40 mins to fix
                src/spec-transform-auto-layout.ts on lines 144..144

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

                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

                        childUnit.guide.x = utils.defaults(childUnit.guide.x, utils.clone(root.guide.x));
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 40 mins to fix
                src/spec-transform-auto-layout.ts on lines 145..145

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

                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 maxXTickBox = getMaxTickLabelSize(
                        xValues,
                        FormatterRegistry.get(guide.x.tickFormat, guide.x.tickFormatNullAlias),
                        settings.getAxisTickLabelSize,
                        settings.xAxisTickLabelLimit);
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 35 mins to fix
                src/spec-transform-auto-layout.ts on lines 283..287

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

                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 maxYTickBox = getMaxTickLabelSize(
                        yValues,
                        FormatterRegistry.get(guide.y.tickFormat, guide.y.tickFormatNullAlias),
                        settings.getAxisTickLabelSize,
                        settings.yAxisTickLabelLimit);
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts and 1 other location - About 35 mins to fix
                src/spec-transform-auto-layout.ts on lines 277..281

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

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

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

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

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

                Refactorings

                Further Reading

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

                    var guide = customUnit.guide || {};
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 maxXTickText = domainValues.reduce((prev, value) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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.

                Shadowed name: 'sum'
                Open

                var sum = ((arr: number[]) => arr.reduce((sum, x) => (sum + x), 0));
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 getMaxTickLabelSize = function (domainValues, formatter, fnCalcTickLabelSize, axisLabelLimit) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xRules: [number, number, string][] = (xOrY === 'x') ?
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 multiLinesXBox = maxXTickBox;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xMeta = meta.scaleMeta(unit.x, unit.guide.x);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xRef = applyNodeDefaults(specUnitRef);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 meta: EngineMeta = {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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.

                non-arrow functions are forbidden
                Open

                var extendLabel = function (guide: UnitGuide, dimension: string, extend?) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: only-arrow-functions

                Disallows traditional (non-arrow) function expressions.

                Note that non-arrow functions are allowed if 'this' appears somewhere in its body (as such functions cannot be converted to arrow functions).

                Rationale

                Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.

                Config

                Two arguments may be optionally provided:

                • "allow-declarations" allows standalone function declarations.
                • "allow-named-functions" allows the expression function foo() {} but not function() {}.
                Examples
                "only-arrow-functions": true
                "only-arrow-functions": true,allow-declarations,allow-named-functions
                Schema
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "allow-declarations",
                      "allow-named-functions"
                    ]
                  },
                  "minLength": 0,
                  "maxLength": 1
                }

                For more information see this page.

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

                    var children = root.units || [];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'isLeaf' is never reassigned; use 'const' instead of 'var'.
                Open

                    var isLeaf = !root.hasOwnProperty('units');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'rad' is never reassigned; use 'const' instead of 'var'.
                Open

                    var rad = Math.abs(utils.toRadian(angle));
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'xMeta' is never reassigned; use 'const' instead of 'var'.
                Open

                                var xMeta = meta.scaleMeta(unit.x, unit.guide.x);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 key = [dimType, scaleType, specifier].join(':');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 rotateBox = ({width, height}, angle) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xValues = xMeta.values;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 kyLabelW = (yLabel.text && !yLabel.hide) ? 1 : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 dim = srcSpec.sources[scaleCfg.source].dims[scaleCfg.dim] || {};
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 spec = this.spec;
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: no-var-keyword

                Disallows usage of the var keyword.

                Use let or const instead.

                Rationale

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

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

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "no-var-keyword": true

                For more information see this page.

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

                        isLeaf: isLeaf,
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: object-literal-shorthand

                Enforces/disallows use of ES6 object literal shorthand.

                Notes
                • Has Fix

                Config

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

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

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

                For more information see this page.

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

                                    values: values,
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: object-literal-shorthand

                Enforces/disallows use of ES6 object literal shorthand.

                Notes
                • Has Fix

                Config

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

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

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

                For more information see this page.

                Identifier 'yLabel' is never reassigned; use 'const' instead of 'let'.
                Open

                        let yLabel = unit.guide.y.label;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 scaleType = dim.scaleType;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 timeFormats = ['day', 'week', 'month'];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 = unit.guide.x.label.text;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 spec = utils.clone(srcSpec);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 SpecEngineFactory = {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 scaleCfg = srcSpec.scales[scaleId];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 size = spec.settings.size;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'properties' is never reassigned; use 'const' instead of 'let'.
                Open

                        let properties = config[name];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'yLabel' is never reassigned; use 'const' instead of 'var'.
                Open

                    var yLabel = guide.y.label;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 inheritProps = (childUnit: Unit, root: Unit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 yValues = yMeta.values;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 maxXTickBox = getMaxTickLabelSize(
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xLabel = guide.x.label;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xIsEmptyAxis = (xMeta.isEmpty);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 isYVertical = allowYVertical ? !(dimY.dimType === 'measure') : false;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 yLabels = [];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 fnTraverseSpec = (orig, specUnitRef, transformRules) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 unitSpec = {unit: utils.clone(srcSpec.unit)};
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'guide' is never reassigned; use 'const' instead of 'var'.
                Open

                    var guide = customUnit.guide || {};
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'rotXBox' is never reassigned; use 'const' instead of 'var'.
                Open

                    var rotXBox = rotateBox(multiLinesXBox, guide.x.rotate);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 sum = ((arr: number[]) => arr.reduce((sum, x) => (sum + x), 0));
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 paddingB = (guide.padding && guide.padding.b) ? guide.padding.b : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 paddingNoTicksB = (guide.paddingNoTicks && guide.paddingNoTicks.b) ? guide.paddingNoTicks.b : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 isXVertical = allowXVertical ? !(dimX.dimType === 'measure') : false;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'xIsEmptyAxis' is never reassigned; use 'const' instead of 'var'.
                Open

                    var xIsEmptyAxis = (xMeta.isEmpty);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'xLabels' is never reassigned; use 'const' instead of 'var'.
                Open

                        var xLabels = [];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 applyCustomProps = (targetUnit: Unit, customUnit: Unit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 dimType = dim.dimType;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 rotYBox = rotateBox(multiLinesYBox, guide.y.rotate);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 spec = utils.clone(srcSpec);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 y = unit.guide.y.label.text;
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: no-var-keyword

                Disallows usage of the var keyword.

                Use let or const instead.

                Rationale

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

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

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "no-var-keyword": true

                For more information see this page.

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

                                computed: computed
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: object-literal-shorthand

                Enforces/disallows use of ES6 object literal shorthand.

                Notes
                • Has Fix

                Config

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

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

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

                For more information see this page.

                Identifier 'koeffLinesCount' is never reassigned; use 'const' instead of 'let'.
                Open

                    let koeffLinesCount = Math.min(guessLinesCount, linesCountLimit);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'yValues' is never reassigned; use 'const' instead of 'var'.
                Open

                    var yValues = yMeta.values;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'spec' is never reassigned; use 'const' instead of 'var'.
                Open

                        var spec = utils.clone(srcSpec);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'spec' is never reassigned; use 'const' instead of 'var'.
                Open

                        var spec = utils.clone(srcSpec);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'spec' is never reassigned; use 'const' instead of 'var'.
                Open

                        var spec = this.spec;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'rotateBox' is never reassigned; use 'const' instead of 'var'.
                Open

                var rotateBox = ({width, height}, angle) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 specifier = '*';
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 getSettings = (settings, prop, dimType) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 rad = Math.abs(utils.toRadian(angle));
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 wrapLine = (box, lineWidthLimit, linesCountLimit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 kxAxisW = xIsEmptyAxis ? 0 : 1;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 engine = (SpecEngineTypeMap[typeName] || SpecEngineTypeMap.NONE);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'scaleCfg' is never reassigned; use 'const' instead of 'var'.
                Open

                                var scaleCfg = srcSpec.scales[scaleId];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'rule' is never reassigned; use 'const' instead of 'var'.
                Open

                        var rule = spec.settings.specEngine.find((rule) => (
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'SpecEngineFactory' is never reassigned; use 'const' instead of 'var'.
                Open

                var SpecEngineFactory = {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 extendLabel = function (guide: UnitGuide, dimension: string, extend?) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 angle = utils.normalizeAngle(xAngle);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 spec = utils.clone(srcSpec);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xLabels = [];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 yUnit = null;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 scale = fnCreateScale('pos', scaleId);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 values = scale.domain();
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'isLeafParent' is never reassigned; use 'const' instead of 'var'.
                Open

                    var isLeafParent = !children.some((c) => c.hasOwnProperty('units'));
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'xIsEmptyAxis' is never reassigned; use 'const' instead of 'var'.
                Open

                    var xIsEmptyAxis = (xMeta.isEmpty || guide.x.hideTicks);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'dim' is never reassigned; use 'const' instead of 'var'.
                Open

                                var dim = srcSpec.sources[scaleCfg.source].dims[scaleCfg.dim] || {};
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'unitSpec' is never reassigned; use 'const' instead of 'var'.
                Open

                        var unitSpec = {unit: utils.clone(srcSpec.unit)};
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 yLabel = guide.y.label;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 spec = utils.clone(srcSpec);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 scaleCfg = srcSpec.scales[scaleId];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 fullSpec = engine(unitSpec, meta, settings);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'config' is never reassigned; use 'const' instead of 'var'.
                Open

                    var config = {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'size' is never reassigned; use 'const' instead of 'var'.
                Open

                        var size = fnCalcTickLabelSize('TauChart Library');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'xRules' is never reassigned; use 'const' instead of 'var'.
                Open

                    var xRules: [number, number, string][] = (xOrY === 'x') ?
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'xLabel' is never reassigned; use 'const' instead of 'let'.
                Open

                        let xLabel = unit.guide.x.label;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'prop' is never reassigned; use 'const' instead of 'var'.
                Open

                    var prop = utils.omit(xRef, 'units');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'getTextAnchorByAngle' is never reassigned; use 'const' instead of 'var'.
                Open

                var getTextAnchorByAngle = (xAngle: number, xOrY = 'x') => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-const

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

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

                Notes
                • Has Fix

                Config

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

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

                For more information see this page.

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

                                unit.guide.x = Object.assign(
                                    (unit.guide.x),
                                    {
                                        cssClass: (isFacetUnit) ? (unit.guide.x.cssClass + ' facet-axis') : (unit.guide.x.cssClass),
                                        avoidCollisions: (isFacetUnit) ? true : (unit.guide.x.avoidCollisions)
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-object-spread

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

                Rationale

                Object spread allows for better type checking and inference.

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "prefer-object-spread": true

                For more information see this page.

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

                    var isLeaf = !root.hasOwnProperty('units');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 tag = [dimType, scaleType].join(':');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xIsEmptyAxis = (xMeta.isEmpty || guide.x.hideTicks);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 maxYTickBox = getMaxTickLabelSize(
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 prop = utils.omit(xRef, 'units');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'yMeta' is never reassigned; use 'const' instead of 'var'.
                Open

                                var yMeta = meta.scaleMeta(unit.y, unit.guide.y);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'shortFormat' is never reassigned; use 'const' instead of 'var'.
                Open

                var shortFormat = (format, utc) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'wrapLine' is never reassigned; use 'const' instead of 'var'.
                Open

                var wrapLine = (box, lineWidthLimit, linesCountLimit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'fnTraverseSpec' is never reassigned; use 'const' instead of 'var'.
                Open

                var fnTraverseSpec = (orig, specUnitRef, transformRules) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 guide_dim = guide.hasOwnProperty(dimension) ? guide[dimension] : {};
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 multiLinesYBox = maxYTickBox;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 kyAxisW = yIsEmptyAxis ? 0 : 1;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 SpecEngineTypeMap: SpecEngines = {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 yMeta = meta.scaleMeta(unit.y, unit.guide.y);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'dimType' is never reassigned; use 'const' instead of 'var'.
                Open

                    var dimType = dim.dimType;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'scaleType' is never reassigned; use 'const' instead of 'var'.
                Open

                    var scaleType = dim.scaleType;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'specifier' is never reassigned; use 'const' instead of 'var'.
                Open

                    var specifier = '*';
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'tag' is never reassigned; use 'const' instead of 'var'.
                Open

                    var tag = [dimType, scaleType].join(':');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'timeFormats' is never reassigned; use 'const' instead of 'var'.
                Open

                    var timeFormats = ['day', 'week', 'month'];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'paddingB' is never reassigned; use 'const' instead of 'var'.
                Open

                    var paddingB = (guide.padding && guide.padding.b) ? guide.padding.b : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'dimX' is never reassigned; use 'const' instead of 'var'.
                Open

                    var dimX = meta.dimension(unit.x);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'x' is never reassigned; use 'const' instead of 'var'.
                Open

                                var x = unit.guide.x.label.text;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'scale' is never reassigned; use 'const' instead of 'var'.
                Open

                                var scale = fnCreateScale('pos', scaleId);
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-const

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

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

                Notes
                • Has Fix

                Config

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

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

                For more information see this page.

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

                    guide.y = Object.assign(
                        (guide.y),
                        {
                            density: (rotYBox.height + getSettings(settings, 'yDensityPadding', yMeta.dimType) * 2),
                            tickFontHeight: maxYTickBox.height,
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-object-spread

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

                Rationale

                Object spread allows for better type checking and inference.

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "prefer-object-spread": true

                For more information see this page.

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

                var createSelectorPredicates = (root: Unit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 children = root.units || [];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 yIsEmptyAxis = (yMeta.isEmpty || guide.y.hideTicks);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 rotXBox = rotateBox(multiLinesXBox, guide.x.rotate);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 yMeta = meta.scaleMeta(unit.y, unit.guide.y);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xMeta = meta.scaleMeta(unit.x, unit.guide.x);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'guessLinesCount' is never reassigned; use 'const' instead of 'let'.
                Open

                    let guessLinesCount = Math.ceil(box.width / lineWidthLimit);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'sum' is never reassigned; use 'const' instead of 'var'.
                Open

                var sum = ((arr: number[]) => arr.reduce((sum, x) => (sum + x), 0));
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'createSelectorPredicates' is never reassigned; use 'const' instead of 'var'.
                Open

                var createSelectorPredicates = (root: Unit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'getTickFormat' is never reassigned; use 'const' instead of 'var'.
                Open

                var getTickFormat = (dim, defaultFormats) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-const

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

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

                Notes
                • Has Fix

                Config

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

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

                For more information see this page.

                Use the object spread operator instead.
                Open

                    guide.paddingNoTicks = Object.assign(
                        {},
                        (guide.paddingNoTicks),
                        {
                            b: (guide.x.hide) ?
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-object-spread

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

                Rationale

                Object spread allows for better type checking and inference.

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "prefer-object-spread": true

                For more information see this page.

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

                                unit.guide.y = Object.assign(
                                    (unit.guide.y),
                                    {
                                        cssClass: (isFacetUnit) ? (unit.guide.y.cssClass + ' facet-axis') : (unit.guide.y.cssClass),
                                        avoidCollisions: (isFacetUnit) ? false : (unit.guide.y.avoidCollisions)
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-object-spread

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

                Rationale

                Object spread allows for better type checking and inference.

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "prefer-object-spread": true

                For more information see this page.

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

                                unit.guide = Object.assign(
                                    (unit.guide),
                                    {
                                        showGridLines: ((unit.guide.hasOwnProperty('showGridLines')) ?
                                            (unit.guide.showGridLines) :
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-object-spread

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

                Rationale

                Object spread allows for better type checking and inference.

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "prefer-object-spread": true

                For more information see this page.

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

                    var isLeafParent = !children.some((c) => c.hasOwnProperty('units'));
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 getTickFormat = (dim, defaultFormats) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 i = xRules.findIndex((r) => (angle >= r[0] && angle < r[1]));
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 paddingNoTicksL = (guide.paddingNoTicks && guide.paddingNoTicks.l) ? guide.paddingNoTicks.l : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 isFacetUnit = (!selectorPredicates.isLeaf && !selectorPredicates.isLeafParent);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'key' is never reassigned; use 'const' instead of 'var'.
                Open

                    var key = [dimType, scaleType, specifier].join(':');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'xValues' is never reassigned; use 'const' instead of 'var'.
                Open

                    var xValues = xMeta.values;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'maxXTickBox' is never reassigned; use 'const' instead of 'var'.
                Open

                    var maxXTickBox = getMaxTickLabelSize(
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'kyAxisW' is never reassigned; use 'const' instead of 'var'.
                Open

                    var kyAxisW = yIsEmptyAxis ? 0 : 1;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'spec' is never reassigned; use 'const' instead of 'var'.
                Open

                        var spec = utils.clone(srcSpec);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'values' is never reassigned; use 'const' instead of 'var'.
                Open

                                var values = scale.domain();
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'applyNodeDefaults' is never reassigned; use 'const' instead of 'var'.
                Open

                var applyNodeDefaults = (node: Unit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-const

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

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

                Notes
                • Has Fix

                Config

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

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

                For more information see this page.

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

                    guide.x = Object.assign(
                        (guide.x),
                        {
                            density: (rotXBox.width + getSettings(settings, 'xDensityPadding', xMeta.dimType) * 2),
                            tickFontHeight: maxXTickBox.height,
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-object-spread

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

                Rationale

                Object spread allows for better type checking and inference.

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "prefer-object-spread": true

                For more information see this page.

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

                    var config = {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 extendAxis = function (guide: UnitGuide, dimension: 'x' | 'y', extend?) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 applyNodeDefaults = (node: Unit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 calcUnitGuide = function ({unit, meta, settings, allowXVertical, allowYVertical, inlineLabels}: CalcUnitArgs) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 size = fnCalcTickLabelSize('TauChart Library');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 shortFormat = (format, utc) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 yIsEmptyAxis = (yMeta.isEmpty);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 xUnit = null;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 dimX = meta.dimension(unit.x);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 dim = srcSpec.sources[scaleCfg.source].dims[scaleCfg.dim] || {};
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 dimY = meta.dimension(unit.y);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 rule = spec.settings.specEngine.find((rule) => (
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: no-var-keyword

                Disallows usage of the var keyword.

                Use let or const instead.

                Rationale

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

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

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "no-var-keyword": true

                For more information see this page.

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

                                value: value,
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: object-literal-shorthand

                Enforces/disallows use of ES6 object literal shorthand.

                Notes
                • Has Fix

                Config

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

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

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

                For more information see this page.

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

                                var isXVertical = !isFacetUnit && (Boolean(xMeta.dimType) && xMeta.dimType !== 'measure');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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.

                non-arrow functions are forbidden
                Open

                var extendAxis = function (guide: UnitGuide, dimension: 'x' | 'y', extend?) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: only-arrow-functions

                Disallows traditional (non-arrow) function expressions.

                Note that non-arrow functions are allowed if 'this' appears somewhere in its body (as such functions cannot be converted to arrow functions).

                Rationale

                Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.

                Config

                Two arguments may be optionally provided:

                • "allow-declarations" allows standalone function declarations.
                • "allow-named-functions" allows the expression function foo() {} but not function() {}.
                Examples
                "only-arrow-functions": true
                "only-arrow-functions": true,allow-declarations,allow-named-functions
                Schema
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "allow-declarations",
                      "allow-named-functions"
                    ]
                  },
                  "minLength": 0,
                  "maxLength": 1
                }

                For more information see this page.

                non-arrow functions are forbidden
                Open

                var calcUnitGuide = function ({unit, meta, settings, allowXVertical, allowYVertical, inlineLabels}: CalcUnitArgs) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: only-arrow-functions

                Disallows traditional (non-arrow) function expressions.

                Note that non-arrow functions are allowed if 'this' appears somewhere in its body (as such functions cannot be converted to arrow functions).

                Rationale

                Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.

                Config

                Two arguments may be optionally provided:

                • "allow-declarations" allows standalone function declarations.
                • "allow-named-functions" allows the expression function foo() {} but not function() {}.
                Examples
                "only-arrow-functions": true
                "only-arrow-functions": true,allow-declarations,allow-named-functions
                Schema
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "allow-declarations",
                      "allow-named-functions"
                    ]
                  },
                  "minLength": 0,
                  "maxLength": 1
                }

                For more information see this page.

                non-arrow functions are forbidden
                Open

                var getMaxTickLabelSize = function (domainValues, formatter, fnCalcTickLabelSize, axisLabelLimit) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: only-arrow-functions

                Disallows traditional (non-arrow) function expressions.

                Note that non-arrow functions are allowed if 'this' appears somewhere in its body (as such functions cannot be converted to arrow functions).

                Rationale

                Traditional functions don't bind lexical scope, which can lead to unexpected behavior when accessing 'this'.

                Config

                Two arguments may be optionally provided:

                • "allow-declarations" allows standalone function declarations.
                • "allow-named-functions" allows the expression function foo() {} but not function() {}.
                Examples
                "only-arrow-functions": true
                "only-arrow-functions": true,allow-declarations,allow-named-functions
                Schema
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "allow-declarations",
                      "allow-named-functions"
                    ]
                  },
                  "minLength": 0,
                  "maxLength": 1
                }

                For more information see this page.

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

                    var maxXTickText = domainValues.reduce((prev, value) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'yIsEmptyAxis' is never reassigned; use 'const' instead of 'var'.
                Open

                    var yIsEmptyAxis = (yMeta.isEmpty || guide.y.hideTicks);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'angle' is never reassigned; use 'const' instead of 'var'.
                Open

                    var angle = utils.normalizeAngle(xAngle);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'rotYBox' is never reassigned; use 'const' instead of 'var'.
                Open

                    var rotYBox = rotateBox(multiLinesYBox, guide.y.rotate);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'i' is never reassigned; use 'const' instead of 'var'.
                Open

                    var i = xRules.findIndex((r) => (angle >= r[0] && angle < r[1]));
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'kxAxisW' is never reassigned; use 'const' instead of 'var'.
                Open

                    var kxAxisW = xIsEmptyAxis ? 0 : 1;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'xLabel' is never reassigned; use 'const' instead of 'var'.
                Open

                    var xLabel = guide.x.label;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'y' is never reassigned; use 'const' instead of 'var'.
                Open

                                var y = unit.guide.y.label.text;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'applyCustomProps' is never reassigned; use 'const' instead of 'var'.
                Open

                var applyCustomProps = (targetUnit: Unit, customUnit: Unit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'inheritProps' is never reassigned; use 'const' instead of 'var'.
                Open

                var inheritProps = (childUnit: Unit, root: Unit) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'getMaxTickLabelSize' is never reassigned; use 'const' instead of 'var'.
                Open

                var getMaxTickLabelSize = function (domainValues, formatter, fnCalcTickLabelSize, axisLabelLimit) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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: 'rule'
                Open

                        var rule = spec.settings.specEngine.find((rule) => (
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 getTextAnchorByAngle = (xAngle: number, xOrY = 'x') => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 kxLabelW = (xLabel.text && !xLabel.hide) ? 1 : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 paddingL = (guide.padding && guide.padding.l) ? guide.padding.l : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'computed' is never reassigned; use 'const' instead of 'let'.
                Open

                        let computed = formatter(value).toString().length;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'maxYTickBox' is never reassigned; use 'const' instead of 'var'.
                Open

                    var maxYTickBox = getMaxTickLabelSize(
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'paddingNoTicksB' is never reassigned; use 'const' instead of 'var'.
                Open

                    var paddingNoTicksB = (guide.paddingNoTicks && guide.paddingNoTicks.b) ? guide.paddingNoTicks.b : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'paddingNoTicksL' is never reassigned; use 'const' instead of 'var'.
                Open

                    var paddingNoTicksL = (guide.paddingNoTicks && guide.paddingNoTicks.l) ? guide.paddingNoTicks.l : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'isXVertical' is never reassigned; use 'const' instead of 'var'.
                Open

                    var isXVertical = allowXVertical ? !(dimX.dimType === 'measure') : false;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'getSettings' is never reassigned; use 'const' instead of 'var'.
                Open

                var getSettings = (settings, prop, dimType) => {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'calcUnitGuide' is never reassigned; use 'const' instead of 'var'.
                Open

                var calcUnitGuide = function ({unit, meta, settings, allowXVertical, allowYVertical, inlineLabels}: CalcUnitArgs) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'SpecEngineTypeMap' is never reassigned; use 'const' instead of 'var'.
                Open

                var SpecEngineTypeMap: SpecEngines = {
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-const

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

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

                Notes
                • Has Fix

                Config

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

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

                For more information see this page.

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

                    guide.padding = Object.assign(
                        (guide.padding),
                        {
                            b: (guide.x.hide) ?
                                paddingB :
                Severity: Minor
                Found in src/spec-transform-auto-layout.ts by tslint

                Rule: prefer-object-spread

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

                Rationale

                Object spread allows for better type checking and inference.

                Notes
                • Has Fix

                Config

                Not configurable.

                Examples
                "prefer-object-spread": true

                For more information see this page.

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

                                var dim = srcSpec.sources[scaleCfg.source].dims[scaleCfg.dim] || {};
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'scaleCfg' is never reassigned; use 'const' instead of 'var'.
                Open

                                var scaleCfg = srcSpec.scales[scaleId];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'engine' is never reassigned; use 'const' instead of 'var'.
                Open

                        var engine = (SpecEngineTypeMap[typeName] || SpecEngineTypeMap.NONE);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'size' is never reassigned; use 'const' instead of 'var'.
                Open

                        var size = spec.settings.size;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'extendAxis' is never reassigned; use 'const' instead of 'var'.
                Open

                var extendAxis = function (guide: UnitGuide, dimension: 'x' | 'y', extend?) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'dimY' is never reassigned; use 'const' instead of 'var'.
                Open

                    var dimY = meta.dimension(unit.y);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'xMeta' is never reassigned; use 'const' instead of 'var'.
                Open

                    var xMeta = meta.scaleMeta(unit.x, unit.guide.x);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'spec' is never reassigned; use 'const' instead of 'var'.
                Open

                        var spec = utils.clone(srcSpec);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'paddingL' is never reassigned; use 'const' instead of 'var'.
                Open

                    var paddingL = (guide.padding && guide.padding.l) ? guide.padding.l : 0;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'yLabels' is never reassigned; use 'const' instead of 'var'.
                Open

                        var yLabels = [];
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'yMeta' is never reassigned; use 'const' instead of 'var'.
                Open

                    var yMeta = meta.scaleMeta(unit.y, unit.guide.y);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'yIsEmptyAxis' is never reassigned; use 'const' instead of 'var'.
                Open

                    var yIsEmptyAxis = (yMeta.isEmpty);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'isYVertical' is never reassigned; use 'const' instead of 'var'.
                Open

                    var isYVertical = allowYVertical ? !(dimY.dimType === 'measure') : false;
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'isFacetUnit' is never reassigned; use 'const' instead of 'var'.
                Open

                                var isFacetUnit = (!selectorPredicates.isLeaf && !selectorPredicates.isLeafParent);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'isXVertical' is never reassigned; use 'const' instead of 'var'.
                Open

                                var isXVertical = !isFacetUnit && (Boolean(xMeta.dimType) && xMeta.dimType !== 'measure');
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'meta' is never reassigned; use 'const' instead of 'var'.
                Open

                        var meta: EngineMeta = {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'fullSpec' is never reassigned; use 'const' instead of 'var'.
                Open

                        var fullSpec = engine(unitSpec, meta, settings);
                Severity: Minor
                Found in src/spec-transform-auto-layout.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 'extendLabel' is never reassigned; use 'const' instead of 'var'.
                Open

                var extendLabel = function (guide: UnitGuide, dimension: string, extend?) {
                Severity: Minor
                Found in src/spec-transform-auto-layout.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