Closed Zamralik closed 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.79%. Comparing base (
e1898af
) to head (7552b97
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
The rule array-element-newline doesn't allow combining the
"consistent"
and{ "multiline": true }
options.The
{ "multiline": true }
is excellent for readability.But with singleline values, it entirely forbid having newlines between elements. Yet it's also quite helpful for readability with long values or some nested arrays.
With
{ "multiline": true }
, this is invalid.Linked Issues
None here, but I opened this very issue on the eslint github back in 2020 before the split occured. At the time, stylistic rules were frozen. https://github.com/eslint/eslint/issues/13818
Additional context
This change was made to be entirely backward compatible for ease. It was just a matter of adding the possibility to put a boolean property named "consistent" to the option object.
{ "consistent": true, "multiline": true }
has the meaning "if there is a multiline element, then the rule is"always"
else the rule is"consistent"
".