英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论