umts/pvta-multiplatform

View on GitHub
src/providers/stop.service.ts

Summary

Maintainability
A
0 mins
Test Coverage

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

          let diff = now.diff(stops.time, 'days');
Severity: Minor
Found in src/providers/stop.service.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 'now' is never reassigned; use 'const' instead of 'let'.
Open

          let now = moment();
Severity: Minor
Found in src/providers/stop.service.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.

import with explicit side-effect
Open

import 'rxjs/add/operator/toPromise';
Severity: Minor
Found in src/providers/stop.service.ts by tslint

Rule: no-import-side-effect

Avoid import statements with side-effect.

Rationale

Imports with side effects may have behavior which is hard for static verification.

Config

One argument may be optionally provided:

  • ignore-module allows to specify a regex and ignore modules which it matches.
Examples
"no-import-side-effect": true
"no-import-side-effect": true,[object Object]
Schema
{
  "items": {
    "properties": {
      "ignore-module": {
        "type": "string"
      }
    },
    "type": "object"
  },
  "maxLength": 1,
  "minLength": 0,
  "type": "array"
}

For more information see this page.

There are no issues that match your filters.

Category
Status