美文网首页
vue .prettierrc文件常见配置

vue .prettierrc文件常见配置

作者: 一人创客 | 来源:发表于2021-10-28 11:34 被阅读0次
module.exports = {
  // 一行的字符数,如果超过会进行换行,默认为80
  "printWidth": 100,
  // tab缩进大小,默认为2
  "tabWidth": 2,
  // 使用tab缩进,默认false
  "useTabs": true,
  // 使用分号, 默认true
  "semi": true,
  // 使用单引号, 默认false(在jsx中配置无效, 默认都是双引号)
  "singleQuote": false,
  // 行尾逗号,默认none,可选 none|es5|all
  // es5 包括es5中的数组、对象
  // all 包括函数对象等所有可选
  "TrailingCooma": "all",
  // 对象中的空格 默认true
  // true: { foo: bar }
  // false: {foo: bar}
  "bracketSpacing": true,
  // JSX标签闭合位置 默认false
  // false: <div
  //          className=""
  //          style={{}}
  //       >
  // true: <div
  //          className=""
  //          style={{}} >
  "jsxBracketSameLine": false,
  // 箭头函数参数括号 默认avoid 可选 avoid| always
  // avoid 能省略括号的时候就省略 例如x => x
  // always 总是有括号
  "arrowParens": "avoid",
};

相关文章

网友评论

      本文标题:vue .prettierrc文件常见配置

      本文链接:https://www.haomeiwen.com/subject/ppfvaltx.html