EDIT: It is Beautify that is adding the new lines. Not sure which rule though.
Is there a way to stop parameter lists and import lists from adding new lines per each list item when formatting code with?
E.g stop this:
function view(state$) {
return state$.map(({weight,height,bmi}) =>
div([
renderWeightSlider(weight),
renderHeightSlider(height),
h2('BMI is ' + bmi)
])
);
}
from becoming this:
function view(state$) {
return state$.map(({
weight,
height,
bmi
}) =>
div([
renderWeightSlider(weight),
renderHeightSlider(height),
h2('BMI is ' + bmi)
])
);
}
When right-clicking and selecting "format document"?
It also does it with imports like so:
import {
makeDOMDriver,
h1,
a
} from '@cycle/dom';
However it is unwanted.
You can toggle word wrap for the VS Code session with Alt + Z (macOS: Option (or Alt) ⌥ + Z ) or select View > Word Wrap from Menu.
How can you prevent VS Code from breaking up long HTML lines into multiple lines? My solution: Select the SVG you want to convert to single line. Then press F1 and type Join Lines and hit enter.
create or edit .jsbeautifyrc
file in your root from you vscode project and put in to the file this json property
{
"brace_style": "collapse,preserve-inline"
}
this will also prevent to format all JavaScript object
Include "brace_style": "collapse,preserve-inline"
as Yitzchak said inside the .json settings file located here:
C:\Users\***\AppData\Roaming\Code\User\settings.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With