noEmptyPattern
Esta página aún no está disponible en tu idioma.
Summary
Section titled “Summary”- Rule available since: 
v1.0.0 - Diagnostic Category: 
lint/correctness/noEmptyPattern - This rule is recommended, which means is enabled by default.
 - This rule doesn’t have a fix.
 - The default severity of this rule is error.
 - Sources:
- Same as 
no-empty-pattern 
 - Same as 
 
How to configure
Section titled “How to configure”{  "linter": {    "rules": {      "correctness": {        "noEmptyPattern": "error"      }    }  }}Description
Section titled “Description”Disallows empty destructuring patterns.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”var {} = foo;code-block.js:1:5 lint/correctness/noEmptyPattern ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Unexpected empty object pattern.
  
  > 1 │ var {} = foo;
      │     ^^
    2 │ 
  
var {a: {}} = foo;code-block.js:1:9 lint/correctness/noEmptyPattern ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Unexpected empty object pattern.
  
  > 1 │ var {a: {}} = foo;
      │         ^^
    2 │ 
  
function foo({}) {}code-block.js:1:14 lint/correctness/noEmptyPattern ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Unexpected empty object pattern.
  
  > 1 │ function foo({}) {}
      │              ^^
    2 │ 
  
The following cases are valid because they create new bindings.
var {a = {}} = foo;var {a, b = {}} = foo;var {a = []} = foo;function foo({a = {}}) {}function foo({a = []}) {}var [a] = foo;Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.