pure-js/browser-detection

View on GitHub
src/retrieve-version.ts

Summary

Maintainability
A
0 mins
Test Coverage

Use a conditional expression instead of assigning to 'end' in multiple places.
Open

  if (preNum.indexOf('.', 2) > 0) {
Severity: Minor
Found in src/retrieve-version.ts by tslint

Rule: prefer-conditional-expression

Recommends to use a conditional expression instead of assigning to the same thing in each branch of an if statement.

Rationale

This reduces duplication and can eliminate an unnecessary variable declaration.

Config

If check-else-if is specified, the rule also checks nested if-else-if statements.

Examples
"prefer-conditional-expression": true
"prefer-conditional-expression": true,check-else-if
Schema
{
  "type": "string",
  "enum": [
    "check-else-if"
  ]
}

For more information see this page.

There are no issues that match your filters.

Category
Status