適用于vue腳手架開發(fā)習(xí)慣 直接復(fù)制即可
{
? "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"] // 箭頭函數(shù)單個參數(shù)不加括號警告
"trailing-comma": [false, {"multiline": "always", "singleline": "never"}] // 限制對象、數(shù)組、解構(gòu)賦值等的最后一項末尾是否需要逗號
"semicolon": [false, "always"] // 行尾必須有分號
"indent": [true, "spaces", 2] // 縮進 兩個
"space-before-function-paren": true // 函數(shù)名前必須要有空格
詳細配置 tslint配置 | 易學(xué)教程