Function getRouteList
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getRouteList(): Promise<any> {
console.log('getroutelist top');
return this.storage.ready().then(() => {
console.log('getroutelist storage ready');
return this.storage.get('routes').then((routes) => {
Identifier 'routeId' is never reassigned; use 'const' instead of 'let'. Open
for (let routeId of routeIds) {
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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.
Identifier 'diff' is never reassigned; use 'const' instead of 'let'. Open
let diff = now.diff(routes.time, 'days');
- Read upRead up
- Exclude checks
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 'promises' is never reassigned; use 'const' instead of 'let'. Open
let promises = [];
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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.