3.0.0 β€’ Published 10 months ago

@putout/plugin-remove-duplicate-case v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@putout/plugin-remove-duplicate-case NPM version

The switch statement evaluates an expression, matching the expression's value to a case clause, and executes statements associated with that case, as well as statements in cases that follow the matching case.

(c) MDN

🐊Putout plugin adds ability to find and remove duplecate case.

Install

npm i @putout/plugin-remove-duplicate-case

Rule

{
    "rules": {
        "remove-duplicate-case": "on"
    }
}

❌ Example of incorrect code

switch(x) {
case 5:
    console.log('hello');
    break;

case 5:
    console.log('zz');
    break;
}

βœ… Example of correct code

switch(x) {
case 5:
    console.log('hello');
    break;
}

License

MIT