1 # Disallow Unnecessary Labels (no-extra-label)
3 If a loop contains no nested loops or switches, labeling the loop is unnecessary.
11 You can achieve the same result by removing the label and using `break` or `continue` without a label.
12 Probably those labels would confuse developers because they expect labels to jump to further.
16 This rule is aimed at eliminating unnecessary labels.
18 Examples of **incorrect** code for this rule:
21 /*eslint no-extra-label: "error"*/
27 B: for (let i = 0; i < 10; ++i) {
37 Examples of **correct** code for this rule:
40 /*eslint no-extra-label: "error"*/
46 for (let i = 0; i < 10; ++i) {
76 If you don't want to be notified about usage of labels, then it's safe to disable this rule.
80 * [no-labels](./no-labels.md)
81 * [no-label-var](./no-label-var.md)
82 * [no-unused-labels](./no-unused-labels.md)