Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upProposal: Maximum params #795
Comments
feross
added
the
enhancement
label
Feb 21, 2017
This comment has been minimized.
This comment has been minimized.
|
I can't see this passing ecosystem without massive breakage. Maybe lets be less restrictive initially and set it to be like maximum of 6-8 first. |
This comment has been minimized.
This comment has been minimized.
|
Hell, you'd be breaking on official node APIs: https://nodejs.org/api/buffer.html#buffer_buf_compare_target_targetstart_targetend_sourcestart_sourceend Again, maybe |
This comment has been minimized.
This comment has been minimized.
|
If it is 6-8 it is too too much. It's ridiculous, when we have promises in mainstream and it is absolutely confirmed better practice to use something like But yea, I'm at least for 5, no more.. it would be just absurd and it would be better to not set that rule at all. As about that exact method of the buffer - that exact module is |
This comment has been minimized.
This comment has been minimized.
Not true. Enforcing some constant would mean we could very easily bring that value down over time and versions if it is so desired. |
This comment has been minimized.
This comment has been minimized.
What? Honestly, I'm leaning towards a general NACK for this proposal. |
This comment has been minimized.
This comment has been minimized.
Actually yea, agree with that. |
This comment has been minimized.
This comment has been minimized.
|
I'm -1 on this rule. One shouldn't write code with that many params, but we've tended to skip these rules based on random constant values like "no more than 80 chars per line" and "no more than 3 nested callbacks" because they're not easy to remember. |
This comment has been minimized.
This comment has been minimized.
|
It seems there's a consensus here (based on @tunnckoCore Thanks for the proposal, hope the rationale makes sense to you. |
tunnckoCore commentedFeb 21, 2017
•
edited
Digging more and more in ESLint rules, i found some good ones which enforces good style and more readable code. This issue is for max-params rule - not fixable.
Suggested configuration.
{ "max-params": "error" }The default
maxoption of this rule is3. In my ~3 years here, ~8 years development and tons of node packages and written functions i have maximum 3-5 cases where i have more than 3 arguments. If there is some need, anyone can add a disable comment. In anyway it is "best practice" for years, not only in node, so i don't believe there will have big system impact.