question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

auto align colons in object literals, variables, and equals like WebStorm

See original GitHub issue

From @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:open
  • Created 7 years ago
  • Reactions:39
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

14reactions
vhb56commented, Dec 24, 2017

Really need this!

6reactions
ARAtlascommented, Jan 29, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found