A labeled statement is any
statement
that is prefixed with anidentifier
. You can jump to this label using abreak
orcontinue
statement nested within the labeled statement. (c) MDN
🐊Putout plugin adds ability to find and remove unused label
statement.
npm i @putout/plugin-labels -D
{
"rules": {
"labels/convert-to-object": "on",
"labels/remove-unused": "on"
}
}
☝️ If you want to override any of it, update .putout.json
in the directory near your files.
🦉 Configuration section of 🐊Putout documentation tell you more about all configuration options supported.
Checkout in 🐊Putout Editor.
const a = () => {
hello: 'world';
x: 'm';
};
const a = () => ({
hello: 'world',
x: 'm',
});
Checkout in 🐊Putout Editor.
hello: while (true) {
break;
}
while (true) {
break;
}
Linter | Rule | Fix |
---|---|---|
🐊 Putout | remove-unused-labels |
✅ |
⏣ ESLint | no-unused-labels |
❌ |
🦕 Deno | no-unused-labels |
❌ |
MIT