@putout/plugin-remove-useless-arguments
v9.0.0
Published
🐊Putout plugin adds ability to find and remove useless arguments
Downloads
64,396
Maintainers
Readme
@putout/plugin-remove-useless-arguments
🐊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