WebStorm: configure Prettier to use tabs?

耗尽温柔 提交于 2019-12-11 10:12:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!