Skip to content
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

Aligning nested objects #112

Open
kikito opened this issue Aug 16, 2017 · 0 comments
Open

Aligning nested objects #112

kikito opened this issue Aug 16, 2017 · 0 comments

Comments

@kikito
Copy link

kikito commented Aug 16, 2017

Hi,

I've been looking around the docs but could not find a way to do this. Say I have a nested javascript object, such as this:

var collection = {
  title: "Star Wars",
  author: "George Lucas & others",
  episodes: {
    "IV": "A New Hope",
    "V": "The Empire Strikes Back",
    "VI": "Revenge of the Sith"
  }
}

What is the fastest way to align the colons taking into account the nesting, so it becomes like this?

var collection = {
  title   : "Star Wars",
  author  : "George Lucas & others",
  episodes: {
    "IV": "A New Hope",
    "V" : "The Empire Strikes Back",
    "VI": "Revenge of the Sith"
  }
}

The only way I've found so far is manually selecting every sub-object, but that's a bit painful with lots of nesting / lots of individual objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant