Vertically align (indent) values in object literals
See original GitHub issueWould be nice to modify from
{
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
}
to
{
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
}
but cannot find such an option. Any clues? Or is this functionality missing?
Issue Analytics
- State:
- Created 10 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
vertical-align - CSS: Cascading Style Sheets - MDN Web Docs
The vertical-align property can be used in two contexts: To vertically align an inline element's box inside its containing line box.
Read more >Why I vertically align my code (and you should too!)
Vertical alignment doesn't work in every context - but for quickly assessing data, its readability is unparalleled. Coding is a creative medium ...
Read more >10 JavaScript Indentation Best Practices
1. Indent with two spaces · 2. Align your code vertically when possible · 3. Put a space after the colon in object...
Read more >Why I vertically align my code (and you should too!)
You can automatically re-indent the code (change tabs to spaces or ... When you vertically align the variable/value pairs, it reads like a...
Read more >Alignment, indentation, leading and spacing in cells
Click How to define spacing and leading in PdfPCell objects? centeredtextincell indenttable indentationincell leadingincell simpletable4 tablewithtab ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Possible solution (unsure how Q&D attempt is going - I’ll try it out later). The Alignment plugin (Sublime Text, Textmate etc) utilises .jsbeautifyrc and offers the following settings and the desired functionality of this enhancement. Alignment Settings
Alternative setting, following .eslintrc rules:
Based on whether Array, Object, or sequential Variable declarations, parse file as per usual with multiline for each of these flagged to do so. Parser stores type and line range. ie:
This way 3 unique formatting methods can be applied in turn.
Is it still shameless code borrowing if you reference the source? ^grin^
Pull requests are always welcome.