printWidth
编辑器每行的长度,默认80tabWidth
制表符tab的宽度,默认值是2useTabs
代码缩进是否用制表符tab,默认falsesemi
是否使用分号,默认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
其他还有一些配置项,我感觉一般用默认的就可以了,暂时没有列出来。