auto align colons in object literals, variables, and equals like WebStorm
See original GitHub issueFrom @kinergy on October 17, 2016 2:56
- VSCode Version: 1.6.1
- OS Version: macOS 10.12
Using Format Code on a js file:
var abcde = 'abcde',
def = {
a : 'aaa',
bb: 'b'
};
turns into:
var abcde = 'abcde',
def = {
a: 'aaa',
bb: 'b'
};
It would be really nice to have a setting to align the beginning of var names, align the equals, and align the colons in object literals like WebStorm. I tried looking for an extension, but wasn’t able to identify one.
Copied from original issue: Microsoft/vscode#13841
Issue Analytics
- State:
- Created 7 years ago
- Reactions:39
- Comments:18 (1 by maintainers)
Top Results From Across the Web
Code Style / Javascript / Other / Align object properties
Set the Align object properties to "on colon" value 3. Try to format the following code in editor (not in preview mode in...
Read more >how to align javascript's equals sign in webstorm
In Webstorm 10,. Go to Settings> Editor> Code Style > JavaScript. Go to the "Other" tab and check "Align multiple 'var' statements and ......
Read more >key-spacing - ESLint - Pluggable JavaScript Linter
"colon" enforces horizontal alignment of both colons and values in object literals. "align" with an object value allows for fine-grained spacing when values...
Read more >Airbnb JavaScript Style Guide()
3.1 Use the literal syntax for object creation. eslint: no-new-object ... Manipulating objects passed in as parameters can cause unwanted variable side ...
Read more >Groovy Language Documentation
Defining a closure; Closures as an object; Calling a closure ... Principles; Variables vs fields in type inference; Collection literal type inference ...
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
Really need this!
I have to agree with johnsba1. The code formatting is one of the key issues that makes it really hard to switch over from WebStorm. I know VSCode lets people write all these third party plugins that supposedly help with formatting, but I haven’t been able to find one that’s particularly good.