问题
The Prettier docs say to use --use-tabs
to override the default behavior. WebStorm automatically populated the Prettier package:
That's a folder. I tried changing it to npm\prettier.cmd
and adding the switch, but that doesn't work (It just turns red).
How can I set WebStorm to use tabs with Prettier?
回答1:
Due to https://github.com/prettier/prettier/pull/2434 fix, Prettier (even global!) uses configuration file nearest to current file (up the directory tree) when formatting.
So, you can install it globally and configure it in your project, by adding the corresponding .prettierrc
file or "prettier"
section in project package.json
.
来源:https://stackoverflow.com/questions/49521161/webstorm-configure-prettier-to-use-tabs