prettier配置项说明

  • printWidth 编辑器每行的长度,默认80
  • tabWidth 制表符tab的宽度,默认值是2
  • useTabs 代码缩进是否用制表符tab,默认false
  • semi 是否使用分号,默认true,使用分号
  • singleQuote 是否使用单引号,默认为false,不适用单引号,使用双引号
  • quoteProps 对象属性的引号使用
    • as-needed 仅在需要的时候使用
    • consistent 有一个属性需要引号,就都需要引号
    • preserve 保留用户输入的情况
  • trailingComma 末尾逗号
    • none 末尾没有逗号
    • es5 es5有效的地方保留
    • all 在可能的地方都加上逗号
  • bracketSpacing 字面量对象括号中的空格,默认true
    • true - Example: { foo: bar }.
    • false - Example: {foo: bar}.
  • arrowParens 箭头函数中的括号
    • “avoid” - 在有需要的时候使用. Example: x => x
    • “always” - 一直使用. Example: (x) => x
  • endOfLine 行末尾标识
    • “auto” - 默认使用Maintain existing line endings (mixed values within one file are normalised by looking at what’s used after the first line)
    • “lf” – Line Feed only (\n), common on Linux and macOS as well as inside git repos
    • “crlf” - Carriage Return + Line Feed characters (\r\n), common on Windows
    • “cr” - Carriage Return character only (\r), used very rarely

其他还有一些配置项,我感觉一般用默认的就可以了,暂时没有列出来。

  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值