Prettier尖括号自动换行问题

前端开发用的比较多的语法格式化无非ESLint和Prettier,但是Prettier在vue中适配只能说一般吧,就比如vue中的>括号一直有bug,记录下修复

Prettier 修复尖括号换行

添加这个属性就行

{
  "htmlWhitespaceSensitivity": "ignore"
}

例子

module.exports = {
  bracketSpacing: true,
  singleQuote: true,
  jsxSingleQuote: true,
  tabWidth: 2,
  semi: true,
  // 标签闭合位置 默认false
  bracketSameLine: true,
  jsxBracketSameLine: true,
  //指定换行长度
  printWidth: 120,
  // avoid 能省略括号的时候就省略 例如x => x
  arrowParens: 'avoid',
  vueIndentScriptAndStyle: true,
  trailingComma: 'all',
  proseWrap: 'never',
  htmlWhitespaceSensitivity: 'ignore',
  endOfLine: 'auto',
}
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容