getify / eslint-plugin-proper-arrows

ESLint rules to ensure proper arrow function definitions
MIT License
305 stars 14 forks source link

Add rule to forbid unused parameters #5

Closed getify closed 5 years ago

getify commented 5 years ago

Some people like to define arrows like this:

x => 1;
x => {};
x => void 0;

Those forms are all generally to avoid the () => ... But since this can be confusing to a reader to see a parameter listed that isn't used, this rule would forbid that.

It would also catch straight-up mistakes like:

(x,y,z) => x + y;   // z is unused here

This is similar to the built-in "no-unused-vars" rule, but is much narrower in focus: only for arrow functions.