noUnsafeNegation
Это содержимое пока не доступно на вашем языке.
Summary
Section titled “Summary”- Rule available since: 
v1.0.0 - Diagnostic Category: 
lint/suspicious/noUnsafeNegation - This rule is recommended, which means is enabled by default.
 - This rule has an unsafe fix.
 - The default severity of this rule is error.
 - Sources:
- Same as 
no-unsafe-negation 
 - Same as 
 
How to configure
Section titled “How to configure”{  "linter": {    "rules": {      "suspicious": {        "noUnsafeNegation": "error"      }    }  }}Description
Section titled “Description”Disallow using unsafe negation.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”!1 in [1,2];code-block.js:1:1 lint/suspicious/noUnsafeNegation  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ The negation operator is used unsafely on the left side of this binary expression.
  
  > 1 │ !1 in [1,2];
      │ ^^^^^^^^^^^
    2 │ 
  
  ℹ Unsafe fix: Wrap the expression with a parenthesis
  
    1 │ !(1·in·[1,2]);
      │  +          + 
/**test*/!/** test*/1 instanceof [1,2];code-block.js:1:10 lint/suspicious/noUnsafeNegation  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ The negation operator is used unsafely on the left side of this binary expression.
  
  > 1 │ /**test*/!/** test*/1 instanceof [1,2];
      │          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Unsafe fix: Wrap the expression with a parenthesis
  
    1 │ /**test*/!/**·test*/(1·instanceof·[1,2]);
      │                     +                  + 
-1 in [1,2];~1 in [1,2];typeof 1 in [1,2];void 1 in [1,2];delete 1 in [1,2];+1 instanceof [1,2];Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.