@putout/plugin-remove-unused-labels
v1.0.2
Published
🐊Putout plugin adds ability to find and remove unused 'label' statement
Downloads
15,083
Maintainers
Readme
@putout/plugin-remove-unused-labels
A labeled statement is any statement that is prefixed with an identifier. You can jump to this label using a
break
orcontinue
statement nested within the labeled statement.>(c) MDN
🐊Putout plugin adds ability to find and remove unused label
statement. Merged to @putout/plugin-labels
.
Checkout in 🐊Putout Editor.
Install
npm i @putout/plugin-remove-unused-labels
Rule
{
"rules": {
"remove-unused-labels": "on"
}
}
❌ Example of incorrect code
hello: while (true) {
break;
}
✅ Example of correct code
while (true) {
break;
}
Comparison
| Linter | Rule | Fix |
|---------------|------------------------------------------------------------------------------------------------------------------------|-----|
| 🐊 Putout | remove-unused-labels
| ✅ |
| ⏣ ESLint | no-unused-labels
| ❌ |
| 🦕 Deno | no-unused-labels
| ❌ |
License
MIT