-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
New option proposal for requireObjectKeysOnNewLine
#6205
Comments
Marked as enhancement since there is a separate feature request issue (#5667) for the rule itself. Feel free to change the labels if I goofed. |
I mentioned this in #5667 (comment) already, but just to make sure this doesn't get lost: The var obj = {
foo: "foo", bar: "bar", baz: "baz"
};
var obj = { foo: "foo", bar: "bar", baz: "baz" }; You will notice that their example for "good" when that option is present also has the curly braces on separate lines. So what you're proposing would be a new option, and not a port of the JSCS option. |
Thanks for clarifying - in that case, I misunderstood the previous jscs behavior to be sufficient for my use cases. New option it is! |
allExceptSameLine
option for requireObjectKeysOnNewLine
requireObjectKeysOnNewLine
Essentially what I want, then, is "either all on one line, or everything on its own line" - meaning, if it can't fit on one line, i never want multiples on the same line. I'm not sure what a good option name would be. |
I'm seeing a separate rule for line breaks inside braces: #6072 |
True! I think it looks like it would satisfy what you want, @ljharb? |
Yes, absolutely the combination would work for me :-) Feel free to close this in favor of #6072, otherwise I'll leave this open until the other one is closed. |
Seems fixed by #6223 |
Per #5667 (comment)
The JSCS rule
requireObjectKeysOnNewLine
had anallExcept: ['sameLine']
option, thateslint
currently lacks. The idea was to configure it so that the following code warned:and only the following did not:
The
allowMultiplePropertiesPerLine
isn't quite the same thing. Can an option be added to support this behavior from jscs?The text was updated successfully, but these errors were encountered: