@putout/plugin-remove-duplicate-case

3.0.0 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

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

Weekly Downloads

13,239

Version

3.0.0

License

MIT

Unpacked Size

4.42 kB

Total Files

4

Last publish

Collaborators

  • coderaiser