noEmptyPattern
Este conteúdo não está disponível em sua língua ainda.
Diagnostic Category: lint/correctness/noEmptyPattern
Since: v1.0.0
Sources:
- Same as:
no-empty-pattern
Disallows empty destructuring patterns.
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-block.js:1:5 lint/correctness/noEmptyPattern ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected empty object pattern.
> 1 │ var {} = foo;
│ ^^
2 │
code-block.js:1:9 lint/correctness/noEmptyPattern ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected empty object pattern.
> 1 │ var {a: {}} = foo;
│ ^^
2 │
code-block.js:1:14 lint/correctness/noEmptyPattern ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unexpected empty object pattern.
> 1 │ function foo({}) {}
│ ^^
2 │
Valid
Section titled ValidThe following cases are valid because they create new bindings.