Reputation: 73
Is there any way to auto format code (in VS Code) in a way that forces horizontal alignment of parentheses, braces and square brackets?
For example:
let foo = {
a: 'a',
b: 'b',
c: 'c'
};
Must be formatted as either :
let foo = {
a: 'a',
b: 'b',
c: 'c'
};
or:
let foo = { a: 'a',
b: 'b',
c: 'c'
};
Another example :
function foo(a: string,
b: number,
c: string) {
}
Must become something like
function foo( a: string,
b: number,
c: string
)
{
}
I've already forced braces on new lines in the editor settings.
I've also looked for extensions but the closest I've found are extensions like Alignment, that sadly don't cover braces alignement. And I can't find a option to enable eslint to automatically format code.
Upvotes: 0
Views: 104