noNestedTernary
Ta treść nie jest jeszcze dostępna w Twoim języku.
Summary
Section titled “Summary”- Rule available since: 
v1.9.3 - Diagnostic Category: 
lint/style/noNestedTernary - This rule doesn’t have a fix.
 - The default severity of this rule is information.
 - Sources:
- Same as 
no-nested-ternary 
 - Same as 
 
How to configure
Section titled “How to configure”{  "linter": {    "rules": {      "style": {        "noNestedTernary": "error"      }    }  }}Description
Section titled “Description”Disallow nested ternary expressions.
Nesting ternary expressions can make code more difficult to understand.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”const thing = foo ? bar : baz === qux ? quxx : foobar;code-block.js:1:27 lint/style/noNestedTernary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ℹ Do not nest ternary expressions.
  
  > 1 │ const thing = foo ? bar : baz === qux ? quxx : foobar;
      │                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Nesting ternary expressions can make code more difficult to understand.
  
  ℹ Convert nested ternary expression into if-else statements or separate the conditions to make the logic easier to understand.
  
foo ? baz === qux ? quxx() : foobar() : bar();code-block.js:1:7 lint/style/noNestedTernary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ℹ Do not nest ternary expressions.
  
  > 1 │ foo ? baz === qux ? quxx() : foobar() : bar();
      │       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Nesting ternary expressions can make code more difficult to understand.
  
  ℹ Convert nested ternary expression into if-else statements or separate the conditions to make the logic easier to understand.
  
const thing = foo ? bar : foobar;let thing;
if (foo) {    thing = bar;} else if (baz === qux) {    thing = quxx;} else {    thing = foobar;}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.