问题描述
那是一个文件夹.我尝试将其更改为 npm\prettier.cmd
并添加开关,但这不起作用(它只是变成红色).
如何设置 WebStorm 以在 Prettier 中使用标签?
由于 https://github.com/prettier/prettier/pull/2434 修复,Prettier(甚至全局!)在格式化时使用最接近当前文件(在目录树上)的配置文件.
因此,您可以通过在项目 package 中添加相应的
..prettierrc
文件或 "prettier"
部分来全局安装并在您的项目中配置它.json
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?
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
.
这篇关于WebStorm:配置 Prettier 以使用选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!