8.0.0 β€’ Published 7 months ago

@putout/plugin-remove-useless-arguments v8.0.0

Weekly downloads
3,025
License
MIT
Repository
github
Last release
7 months ago

@putout/plugin-remove-useless-arguments NPM version

🐊Putout plugin adds ability to find and remove useless arguments.

Install

npm i @putout/plugin-remove-useless-arguments

Rule

{
    "rules": {
        "remove-useless-arguments/arguments": "on",
        "remove-useless-arguments/destructuring": "on",
        "remove-useless-arguments/method": "on"
    }
}

arguments

❌ Example of incorrect code

const sum = (a, b) => {}; // destructuring
sum(a, b, c);

βœ… Example of correct code

const sum = (a, b) => {};
sum(a, b, c);

destructuring

❌ Example of incorrect code

onIfStatement({
    push,
    generate,
    abc,
    helloworld,
});

function onIfStatement({push}) {}

βœ… Example of correct code

onIfStatement({
    push,
});

function onIfStatement({push}) {}

method

Check it out in 🐊Putout Editor.

❌ Example of incorrect code

class Parser {
    parseStatement(context, topLevel, exports) {
        this.parseGuard(a, b);
    }
    
    parseGuard() {}
}

βœ… Example of correct code

class Parser {
    parseStatement(context, topLevel, exports) {
        this.parseGuard();
    }
    
    parseGuard() {}
}

License

MIT

8.0.0

7 months ago

7.0.0

10 months ago

6.3.0

2 years ago

6.2.0

2 years ago

6.1.0

2 years ago

6.0.0

2 years ago

5.2.0

3 years ago

5.1.0

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.2.1

4 years ago

4.2.0

4 years ago

4.1.0

4 years ago

4.0.2

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago