noEmptyPattern
诊断类别:lint/correctness/noEmptyPattern
¥Diagnostic Category: lint/correctness/noEmptyPattern
自从:v1.0.0
¥Since: v1.0.0
来源:
¥Sources:
-
与以下相同:
no-empty-pattern
¥Same as:
no-empty-pattern
禁止空的解构模式。
¥Disallows empty destructuring patterns.
¥Examples
¥Invalid
code-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
以下情况有效,因为它们会创建新的绑定。
¥The following cases are valid because they create new bindings.
¥Related links