@putout/plugin-remove-duplicate-case
v3.0.0
Published
šPutout plugin adds ability to find and remove duplicate case
Downloads
57,358
Readme
@putout/plugin-remove-duplicate-case
The
switch
statement evaluates an expression, matching the expression's value to acase
clause, and executes statements associated with thatcase
, as well as statements incases
that follow the matchingcase
.(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