vscode格式化配置 .prettierrc配置文件
1、首先安装插件2、.prettierrc推荐配置module.exports = {trailingComma: 'none',tabWidth: 2,semi: true,singleQuote: true,printWidth: 120,arrowParens: 'avoid'};.prettierrc常用配置{// tab缩进大小,默认为2"tabWidth": 4,// 使用tab缩进,
·
1、首先安装插件
2、.prettierrc推荐配置
module.exports = {
trailingComma: 'none',
tabWidth: 2,
semi: true,
singleQuote: true,
printWidth: 120,
arrowParens: 'avoid'
};
.prettierrc常用配置
{
// tab缩进大小,默认为2
"tabWidth": 4,
// 使用tab缩进,默认false
"useTabs": false,
// 使用分号, 默认true
"semi": false,
// 使用单引号, 默认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"
}
更多推荐
已为社区贡献3条内容
所有评论(0)