Skip to content

Curly all rule #237

Open
Open
@flippidippi

Description

@flippidippi

What version of this package are you using?
17.0.0

What problem do you want to solve?
Have a tighter rule around curly for better consistency.
Currently, the rule is set to "multi-line", which can still end up with code that isn't consistent or harder to read.

For example of consistency, both of these are ok and I think it's better to have a tighter rule around this.

if (foo) foo++
if (foo) {
  foo++
}

Another example if when the if statement is long, and the reader has to scan far to understand what will be done (usually this would happen with longer variables names)

if (foo != bar1 && foo != bar2 && foo != bar3 && foo != bar4 && foo != bar5 && foo != bar6 && foo != bar7) foo++

What do you think is the correct solution to this problem?
Change rule to curly: "all"

Are you willing to submit a pull request to implement this change?
Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions