@putout/plugin-labels
🐊Putout plugin helps with labels
Last updated 10 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/plugin-labels 
SYNC missed versions from official npm registry.

@putout/plugin-labels NPM version

A labeled statement is any statement that is prefixed with an identifier. You can jump to this label using a break or continue statement nested within the labeled statement.

(c) MDN

🐊Putout plugin adds ability to find and remove unused label statement.

Install

npm i @putout/plugin-labels -D

Rules

Config

{
    "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.

convert-to-object

Checkout in 🐊Putout Editor.

❌ Example of incorrect code

const a = () => {
    hello: 'world';
    x: 'm';
};

βœ… Example of correct code

const a = () => ({
    hello: 'world',
    x: 'm',
});

remove-unused

Checkout in 🐊Putout Editor.

❌ 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

Current Tags

  • 3.0.0                                ...           latest (10 months ago)

4 Versions

  • 3.0.0                                ...           10 months ago
  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (7)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE