Function placeVehicles
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
placeVehicles (isVehicleRefresh) {
// Places every vehicle on said route on the map
this.mapSvc.removeAllMarkers();
if (!this.vehicles) {
return;
Identifier 'vehicle' is never reassigned; use 'const' instead of 'let'. Open
for (let vehicle of this.vehicles) {
- 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 'busDetails' is never reassigned; use 'const' instead of 'let'. Open
let busDetails = `Bus ${vehicle.Name} - ${vehicle.DisplayStatus}`;
- 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.
Forbidden 'var' keyword, use 'let' or 'const' instead Open
var content = `
- Read upRead up
- Exclude checks
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.
var
s have declaration "hoisting" (similar to function
s) 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 'content' is never reassigned; use 'const' instead of 'var'. Open
var content = `
- 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 'autoRefreshValidity' is never reassigned; use 'const' instead of 'let'. Open
let autoRefreshValidity: [boolean, number] = this.refreshSvc
- 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.
Forbidden 'var' keyword, use 'let' or 'const' instead Open
var loc = new google.maps.LatLng(vehicle.Latitude, vehicle.Longitude);
- Read upRead up
- Exclude checks
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.
var
s have declaration "hoisting" (similar to function
s) 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 'icon' is never reassigned; use 'const' instead of 'var'. Open
var icon = {
- 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.
Forbidden 'var' keyword, use 'let' or 'const' instead Open
var icon = {
- Read upRead up
- Exclude checks
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.
var
s have declaration "hoisting" (similar to function
s) 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 'loc' is never reassigned; use 'const' instead of 'var'. Open
var loc = new google.maps.LatLng(vehicle.Latitude, vehicle.Longitude);
- 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.