适用于vue脚手架开发习惯 直接复制即可
{
"defaultSeverity": "warning",
"extends": [
"tslint:recommended"
],
"linterOptions": {
"exclude": [
"node_modules/**"
]
},
"rules": {
"indent": [true, "spaces", 2],
"interface-name": false,
"no-consecutive-blank-lines": false,
"object-literal-sort-keys": false,
"ordered-imports": false,
"quotemark": [true, "single"],
"semicolon": [false, "always"],
"trailing-comma": [false, {"multiline": "always", "singleline": "never"}],
"arrow-parens": [false, "ban-single-arg-parens"],
"no-console": false,
"space-before-function-paren": true
}
}
"no-console": false // console.log 警告
"arrow-parens": [false, "ban-single-arg-parens"] // 箭头函数单个参数不加括号警告
"trailing-comma": [false, {"multiline": "always", "singleline": "never"}] // 限制对象、数组、解构赋值等的最后一项末尾是否需要逗号
"semicolon": [false, "always"] // 行尾必须有分号
"indent": [true, "spaces", 2] // 缩进 两个
"space-before-function-paren": true // 函数名前必须要有空格
详细配置 tslint配置 | 易学教程