Skip to content

Select "if else" alignment style #204

Description

@trane77

I think it would be nice to select the style of if/else blocks, it's a feature I miss coming from phpStorm.

Now:

if ($a === 1) {
  // ...
} else if ($a === 2) {
  // ...
} else {
  // ...
}

Add new line after each if/else block:

if ($a === 1) {
  // ...
} 
else if ($a === 2) {
  // ...
} 
else {
  // ...
}

Being able to keep simple if/else blocks on one line would be a nice to have feature:

if ($a === 1) { /* ... */ } 
else if ($a === 2) { /* ... */ } 
else { /* ... */ }

Blocks can also be aligned ( too much? 😃 ):

if ($a === 1)      { /* ... */ } 
else if ($a === 2) { /* ... */ } 
else               { /* ... */ }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions