1 # Disallow Unused Labels (no-unused-labels)
3 Labels that are declared and not used anywhere in the code are most likely an error due to incomplete refactoring.
7 for (const student of students) {
8 if (checkScores(student.scores)) {
15 In this case, probably removing `OUTER_LOOP:` had been forgotten.
16 Such labels take up space in the code and can lead to confusion by readers.
20 This rule is aimed at eliminating unused labels.
22 Examples of **incorrect** code for this rule:
25 /*eslint no-unused-labels: "error"*/
34 for (let i = 0; i < 10; ++i) {
39 Examples of **correct** code for this rule:
42 /*eslint no-unused-labels: "error"*/
52 for (let i = 0; i < 10; ++i) {
62 If you don't want to be notified about unused labels, then it's safe to disable this rule.
66 * [no-extra-label](./no-extra-label.md)
67 * [no-labels](./no-labels.md)
68 * [no-label-var](./no-label-var.md)