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
Rule Proposal: object-curly-newline #6072
Comments
I think we already have an issue opened for something like that, having trouble finding it now. I think proposal was to add option to |
For spacing, rules are separated each kind of braces. So my proposals are, too.
Indeed, |
@ilyavolodin It seems to be closed already: #5203 |
I updated this proposal. |
👍 |
@eslint/eslint-team need some more feedback here. 👍 |
👍 |
Unless there's already a convention to use items when referring to object props, I wonder if there is a better name for the minItems option. minProps/minProperties? A little more verbose, but that's the terminology I'm used to using/seeing. Otherwise, 👍 from me |
@kaicataldo agreed, we should use "props" or "properties" for consistency |
Thank you! I'll update my PR by feedback. |
#5203 isn't actually covered by this proposal. |
@PhiLhoSoft the goal here is not to implement a solution for #5203, it's to create an ESLint rule that is equivalent to two JSCS rules. Those rules only deal with inserting newlines inside of braces and that's what this issue is implementing. |
Yes, I was answering the comment #6072 (comment) actually, referring to the above issue. |
From requirePaddingNewLinesInObjects and disallowPaddingNewLinesInObjects.
This will require/disallow line breaks after open object curlies and before close object curlies.
Options
"always"
- Requires line breaks always."never"
- Disallows line breaks always.multiline
(default isfalse
) - Requires line breaks if the content is multiline. If this isfalse
, this condition is disabled.minItems
(default is0
) - Requires line breaks if the number of properties is more than the given integer. If this is0
, this condition is disabled.Examples
Related Rules
The text was updated successfully, but these errors were encountered: