Open see311 opened 6 years ago
You can use either "brace_style": "none,preserve-inline"
or "brace_style": "expand,preserve-inline"
to get that result, but it will obviously affect other parts of your code.
@HookyQR after I use "brace_style": "none,preserve-inline" or "brace_style": "expand,preserve-inline", it change to:
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
},
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
}]
there is no indent before the brace and the last brace get together
That's because the code itself is invalid. It should have either routes =
or the whole thing should be surrounded by a curly brace pair.
The parser simply thinks it's still at the top level at that point, cos, it kind of is. ;)
@HookyQR sorry, my fault. the routes is in the object, it's a property of an object. likes:
{
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
},
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
}]
}
I still don't see what the problem is. Can you please provide snippets for before, actual after, and expected after.
I think the expected after is :
{
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
},
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
}
]
}
(and I support that too)
The last curly and square brace keep stacking on one line:
}]
The opening brackets are fine but the ending arent following the same.
Provide the settings you use: (VS Code workspace and user settings, .jsbeautifyrc, .editorconfig) eg.: VS Code:
Action performed
Format javascript file with
HookyQR.beautifyFile
command provide example codeExpected results
Expected ... to ... provide example (expected) output
Actual results
Details of what happened ... provide example (actual) output