How can I change the prettier settings?
I want to change the prettier settings but I haven't managed to get this done so far.
Where can I change them? I want to use single quotes and indent by 4 spaces.
I've asked the question here as well:
https://stackoverflow.com/questions/49586279/making-webstorm-use-single-quotes-for-prettier
I am lost and it annoys me. The code looks less like what I want it to be.
Thanks a lot!
Please sign in to leave a comment.
Thank you!
What is a result of running
prettier . --writein command line? Does it change quotes to single in.tsxfiles? According to documentation, the"singleQuote"option doesn't affect JSX files, you need using--jsx-single-quoteinstead.prettier . --write --jsx-single-quote
[warn] Ignored unknown option { "prettier.singleQuote": true }.
prettier . --write --jsx-single-quote
That changes all JSX and TSX files. However, in a .tsx IDEA editor, Ctrl+Alt+L changes them all back to double quotes.
Did you try specifying this option in the
.prettierrc.jsoninstead of passing it in CLI?That's the solution! Setting "jsxSingleQuote": true in .prettierrc.json fixes the Ctrl+Alt+L behavior,
and restarting the IDE.
Example .prettierrc.json: