Visual Studio Code align function parameters on multiple lines
Asked Answered
I

1

6

If a Javascript (or Typescript) function signature has multiple lines of arguments (can happen easily in Typescript, with longer type names), Visual Studio Code indents like this after I hit return:

enter image description here

I would prefer it line up the arguments, like this:

enter image description here enter image description here

Is there a setting somewhere to do this automatically, so I don't have to manually indent the code?

(I also want to do this for function calls.)

Intestine answered 28/4, 2019 at 9:54 Comment(2)
+1 Seems like such a trivial and popular feature that VS Code Team missed? VS 2015/2017 retain the alignment preference from first line.Eriha
What approach did you take? Coming here after 3 years... :)Glissando
A
0

Probably check out some linters if they can do it for you. Search in Extensions for plugins such as eslint or tslint.

Ancilin answered 28/4, 2019 at 10:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.