Rule Proposal: func-param-newline #8452
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
enhancement
This change enhances an existing feature of ESLint
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
rule
Relates to ESLint's core rules
This rule was originally proposed by @jesstelford here: #6074 (comment) I looked through previous issues and did not see any other similar proposals.
Please describe what the rule should do:
This rule would enforce that function parameters or argument each appear on a new line, either always or when separated on multiple lines.
What category of rule is this? (place an "X" next to just one item)
[X] Enforces code style
[ ] Warns about a potential error
[ ] Suggests an alternate way of doing something
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
When set to
always-multiline
When set to
always
Why should this rule be included in ESLint (instead of a plugin)?
It is very common to have to break up long function argument list on to multiple lines. Either because of max line length rules or for increased readability. This rule would enforce a consistent style in which this should be done. Code can be hard to read when function arguments are not placed on separate lines and when a function takes in multiple JSON objects it can be hard to tell them apart.
This rule would also complement the code style that our current rules already enforce. Such as
object-property-newline
andobject-curly-newline
. As well as another proposed rulefunction-paren-newline
#8102The text was updated successfully, but these errors were encountered: