ManageIQ/manageiq-ui-classic

View on GitHub
app/javascript/menu/miq-logo.jsx

Summary

Maintainability
A
0 mins
Test Coverage

Do not nest ternary expressions.
Open

  const url = customBrand ? logoCustom : (expanded ? logoLarge : logoSmall);
Severity: Minor
Found in app/javascript/menu/miq-logo.jsx by eslint

disallow nested ternary expressions (no-nested-ternary)

Nesting ternary expressions can make code more difficult to understand.

var foo = bar ? baz : qux === quxx ? bing : bam;

Rule Details

The no-nested-ternary rule disallows nested ternary expressions.

Examples of incorrect code for this rule:

/*eslint no-nested-ternary: "error"*/

var thing = foo ? bar : baz === qux ? quxx : foobar;

foo ? baz === qux ? quxx() : foobar() : bar();

Examples of correct code for this rule:

/*eslint no-nested-ternary: "error"*/

var thing = foo ? bar : foobar;

var thing;

if (foo) {
  thing = bar;
} else if (baz === qux) {
  thing = quxx;
} else {
  thing = foobar;
}

Related Rules

There are no issues that match your filters.

Category
Status