TargetProcess/tauCharts

View on GitHub
src/tau.charts.ts

Summary

Maintainability
B
4 hrs
Test Coverage

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

import * as utilsDom from './utils/utils-dom';
import * as utils from './utils/utils';
import * as utilsDraw from './utils/utils-draw';
import {GPL} from './charts/tau.gpl';
import {Plot} from './charts/tau.plot';
Severity: Minor
Found in src/tau.charts.ts - About 2 hrs to fix

    Function experimentalShouldAnimate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            experimentalShouldAnimate: (spec) => {
                const createSvg = (tag, attrs) => {
                    var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
                    Object.keys(attrs).forEach((k) => el.setAttribute(k, String(attrs[k])));
                    return el;
    Severity: Minor
    Found in src/tau.charts.ts - About 1 hr to fix

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

                      var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
      Severity: Minor
      Found in src/tau.charts.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 method shorthand in object literal ('{get() {...}}').
      Open

              get: function (name) {
      Severity: Minor
      Found in src/tau.charts.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 method shorthand in object literal ('{get() {...}}').
      Open

              get: function (name) {
      Severity: Minor
      Found in src/tau.charts.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.

      non-arrow functions are forbidden
      Open

              add: function (name, plugin) {
      Severity: Minor
      Found in src/tau.charts.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 'colorBrewers' is never reassigned; use 'const' instead of 'var'.
      Open

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

      var api = {
      Severity: Minor
      Found in src/tau.charts.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 colorBrewers = {};
      Severity: Minor
      Found in src/tau.charts.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 shouldSpecifyFillWithCode = (config.fill && config.code);
      Severity: Minor
      Found in src/tau.charts.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 shouldSpecifyColumns = (config.columns && config.columns.length > 1);
      Severity: Minor
      Found in src/tau.charts.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 method shorthand in object literal ('{add() {...}}').
      Open

              add: function (name, plugin) {
      Severity: Minor
      Found in src/tau.charts.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 'plugins' is never reassigned; use 'const' instead of 'var'.
      Open

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

      var __api__ = {
      Severity: Minor
      Found in src/tau.charts.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 commonRules = [
      Severity: Minor
      Found in src/tau.charts.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 shouldSpecifyBothLatLong = (config.latitude && config.longitude);
      Severity: Minor
      Found in src/tau.charts.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

              add: function (name, brewer) {
      Severity: Minor
      Found in src/tau.charts.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 'shouldSpecifyFillWithCode' is never reassigned; use 'const' instead of 'var'.
      Open

                  var shouldSpecifyFillWithCode = (config.fill && config.code);
      Severity: Minor
      Found in src/tau.charts.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 'shouldSpecifyColumns' is never reassigned; use 'const' instead of 'var'.
      Open

                  var shouldSpecifyColumns = (config.columns && config.columns.length > 1);
      Severity: Minor
      Found in src/tau.charts.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.

      Expected method shorthand in object literal ('{add() {...}}').
      Open

              add: function (name, brewer) {
      Severity: Minor
      Found in src/tau.charts.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.

      Multiple variable declarations in the same statement are forbidden
      Open

                  var i, j, c;
      Severity: Minor
      Found in src/tau.charts.ts by tslint

      Rule: one-variable-per-declaration

      Disallows multiple variable definitions in the same declaration statement.

      Config

      One argument may be optionally provided:

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

      For more information see this page.

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

                  var shouldSpecifyBothLatLong = (config.latitude && config.longitude);
      Severity: Minor
      Found in src/tau.charts.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 __api__ = {
      Severity: Minor
      Found in src/tau.charts.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, j, c;
      Severity: Minor
      Found in src/tau.charts.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

              get: function (name) {
      Severity: Minor
      Found in src/tau.charts.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.

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

      (<any>Plot).__api__ = api;
      Severity: Minor
      Found in src/tau.charts.ts by tslint

      Rule: no-angle-bracket-type-assertion

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

      Rationale

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

      Notes
      • TypeScript Only
      • Has Fix

      Config

      Not configurable.

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

      For more information see this page.

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

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

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

                      var el = document.createElementNS('http://www.w3.org/2000/svg', tag);
      Severity: Minor
      Found in src/tau.charts.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.

      non-arrow functions are forbidden
      Open

              get: function (name) {
      Severity: Minor
      Found in src/tau.charts.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.

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

      (<any>Plot).globalSettings = api.globalSettings;
      Severity: Minor
      Found in src/tau.charts.ts by tslint

      Rule: no-angle-bracket-type-assertion

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

      Rationale

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

      Notes
      • TypeScript Only
      • Has Fix

      Config

      Not configurable.

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

      For more information see this page.

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

      var api = {
      Severity: Minor
      Found in src/tau.charts.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.

      There are no issues that match your filters.

      Category
      Status