I have a React Native project. In Visual Studio Code, I use the react-beautify
add-in to beautify my code on the fly. The add-in uses a tool named prettydiff internally.
The only thing it does that I don't like is that it condenses
import { Componentname } from packagename
to
import {Componentname} from packagename
The correct prettydiff setting to change this behaviour is to set brace_style
to collapse-preserve-inline
.
However, I can't get prettydiff to accept the change.
I tried creating a .jsbeautifyrc file in my project's root directory, and added:
{
"brace_style": "collapse-preserve-inline"
}
but this doesn't seem to work: the behaviour I don't want is still happening.
How do I do this correctly?
I have VS Code in Mac v1.8.1 and if you open a Folder with a .jsbeautifyrc you could override the properties, in your example if you create a folder with 2 files:
index.js
import {code} from 'source';
import {otherCode} from 'source';
.jsbeautifyrc
{
"bracepadding": true
}
you will get the next result after run the beautifier:
import { code } from 'source';
import { otherCode } from 'source';
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