配置Prettier扩展以使用本地安装的Prettier?

huangapple go评论56阅读模式
英文:

configure the Prettier extension to use the locally installed Prettier?

问题

当我按下 ctrl+s 时,文件会被 VS Code 中的 Prettier 扩展格式化。然而,与使用 npm install -g prettier 安装的本地 Prettier 相比,速度似乎较慢。如果我错了,请纠正我。我如何配置 Prettier 扩展以使用本地安装的 Prettier?

英文:

When I press ctrl+s, the file gets formatted by the Prettier extension in VS Code. However, it seems to be slower when compared to the locally installed Prettier using npm install -g prettier. Please correct me if I am wrong. How can I configure the Prettier extension to use the locally installed Prettier?

答案1

得分: 0

使用prettier.prettierPath设置。它的描述:“prettier模块的路径”。您可能需要根据您的Prettier位置在值中使用${userHome}变量或其他VS Code变量

我不知道您自己安装的Prettier是否比Prettier更快。您观察到的减速可能只是Prettier扩展的一部分,而不是Prettier。

英文:

Use the prettier.prettierPath setting. Its description: "Path to the prettier module". You may need to use the ${userHome} variable or other VS Code variables in the value depending on where your Prettier is.

I don't know if your own installed one will be faster than the Prettier one. The slowdown you're observing may just be part of the Prettier extension and not Prettier.

huangapple
  • 本文由 发表于 2023年4月6日 23:52:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75951455.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定