noUnusedLabels
Este conteúdo não está disponível em sua língua ainda.
Diagnostic Category: lint/correctness/noUnusedLabels
Since: v1.0.0
Sources:
- Same as:
no-unused-labels
Disallow unused labels.
Labels that are declared and never used are most likely an error due to incomplete refactoring.
The rule ignores reactive Svelte statements in Svelte components.
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-block.js:1:1 lint/correctness/noUnusedLabels FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Unused label.
> 1 │ LOOP: for (const x of xs) {
│ ^^^^
2 │ if (x > 0) {
3 │ break;
ℹ The label is not used by any break statement and continue statement.
ℹ Safe fix: Remove the unused label.
1 │ LOOP:·for·(const·x·of·xs)·{
│ ------