New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update: Separate pattern/expression options for array-element-newline #11796
Update: Separate pattern/expression options for array-element-newline #11796
Conversation
Hi @jacobparish, thanks for the PR. I'll support this. Sorry for the delay in triaging this PR. |
I will champion this. |
It's accepted now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for putting this together @jacobparish! And apologies for how long it took us to get to this. One request for the documentation, but if you've moved on, someone from the team can take care of it so we can get this change in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Thank you for contributing! Apologies once again for the delay on our end. |
…eslint#11796) * Update: Separate pattern/expression options for array-element-newline * Docs: Add pattern vs expression examples for array-element-newline
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[X] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What rule do you want to change?
https://eslint.org/docs/rules/array-element-newline
Does this change cause the rule to produce more or fewer warnings?
The number of warnings will stay the same.
How will the change be implemented? (New option, new default behavior, etc.)?
The current options for this rule can now be set differently for array patterns vs. array expressions (or disabled for one of the two).
Please provide some example code that this change will affect:
What does the rule currently do for this code?
Forces the style to be the same for both the array pattern and the array expression (i.e. if the setting were "always", would force the pattern to separate lines, or if it were "never", would force the expression to be on the same line.
What will the rule do after it's changed?
Allow different styles for array patterns and array expressions.
What changes did you make? (Give an overview)
Is there anything you'd like reviewers to focus on?
I also would like to make a similar change to array-bracket-newline if the reviewers feel that this change is helpful.