VS Code prettierr配置文件

背景

vscode 有时候设置了.prettierr.js文件,但是保存的时候依旧使用的默认的配置文件。

通过点击窗口下方的prettierr查看当前使用的配置文件

解决

  1. 在项目根目录下创建,配置格式化文件.prettierr.js
yaml 复制代码
module.exports = {
  printWidth: 160,
  singleQuote: true,
  tabWidth: 2,
  semi: false,
}
  1. 打开设置,快捷键: comman+shift+p(windows: ctrl+shift+p),点开扩展,找到prettierr
  1. 输入项目文件夹下配置的prettierr配置文件,其他就不用设置了
  1. 这里用的是重载窗口,重新加载一下配置文件
相关推荐
程序员Supers2 天前
VSCode 好用插件推荐
visual studio code
慢功夫3 天前
💡第五篇:VSCode插件是如何与主进程通信的?
前端·visual studio code
凉凉的知识库3 天前
用 GPT-5.6 SOL 写了个 VS Code 插件,效果出乎意料
api·测试·visual studio code
土土哥tutuge5 天前
开源项目 Claude Code Notifier Plus:让 Claude Code 真正需要你时再提醒你
ai编程·visual studio code
慢功夫6 天前
💡第四篇:编辑器内核, Monaco model、URI、dirty 状态和 tabs 是怎么协作的?
前端·visual studio code
annekqiu7 天前
VS code 部署agent
github·visual studio code
RequieMa7 天前
再见了,所有的 VS Code 预览窗
visual studio code
mCell9 天前
从 VS Code 学系统架构:回到当时,理解它为什么这样演进
架构·源码阅读·visual studio code
你脑门上的脚印10 天前
VSCode 更新后 Cmd(Ctrl)+点击终端地址在编辑器内部打开?一个设置帮你搞定
visual studio code
慢功夫12 天前
开篇:VS Code 为什么不是一个普通 React App
前端·visual studio code