noUndeclaredVariables
Это содержимое пока не доступно на вашем языке.
Summary
Section titled “Summary”- Rule available since: 
v1.0.0 - Diagnostic Category: 
lint/correctness/noUndeclaredVariables - This rule doesn’t have a fix.
 - The default severity of this rule is error.
 - Sources:
- Same as 
no-undef 
 - Same as 
 
How to configure
Section titled “How to configure”{  "linter": {    "rules": {      "correctness": {        "noUndeclaredVariables": "error"      }    }  }}Description
Section titled “Description”Prevents the usage of variables that haven’t been declared inside the document.
If you need to allow-list some global bindings, you can use the javascript.globals configuration.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”foobar;code-block.js:1:1 lint/correctness/noUndeclaredVariables ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ The foobar variable is undeclared.
  
  > 1 │ foobar;
      │ ^^^^^^
    2 │ 
  
  ℹ By default, Biome recognizes browser and Node.js globals.
    You can ignore more globals using the javascript.globals configuration.
  
// throw diagnostic for JavaScript filesPromiseLike;code-block.js:2:1 lint/correctness/noUndeclaredVariables ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ The PromiseLike variable is undeclared.
  
    1 │ // throw diagnostic for JavaScript files
  > 2 │ PromiseLike;
      │ ^^^^^^^^^^^
    3 │ 
  
  ℹ By default, Biome recognizes browser and Node.js globals.
    You can ignore more globals using the javascript.globals configuration.
  
type B<T> = PromiseLike<T>Options
Section titled “Options”checkTypes
Section titled “checkTypes”When set to true, it checks for undeclared types too.
The option defaults to false.
{  "linter": {    "rules": {      "correctness": {        "noUndeclaredVariables": {          "options": {            "checkTypes": true          }        }      }    }  }}type A = number extends infer T ? never : T;code-block.ts:1:43 lint/correctness/noUndeclaredVariables ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ The T variable is undeclared.
  
  > 1 │ type A = number extends infer T ? never : T;
      │                                           ^
    2 │ 
  
  ℹ By default, Biome recognizes browser and Node.js globals.
    You can ignore more globals using the javascript.globals configuration.
  
Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.