{
"defaultSeverity": "warning",
"extends": [
"tslint:recommended"
],
"linterOptions": {
"exclude": [
"node_modules/**"
]
},
"rules": {
// 禁止自动检测末尾行必须使用逗号,always总是检测,never从不检测,ignore忽略检测
"trailing-comma": [true, {
"singleline": "never",
"multiline": {
"objects": "ignore",
"arrays": "ignore",
"functions": "ignore",
"typeLiterals": "ignore"
}
}],
// "no-string-literal": false,
// 禁止出现空代码块,允许 catch 是空代码块
"no-empty":false,
// 类型断言必须使用 as Type,禁止使用 <Type>
// <Type> 容易被理解为 jsx
"no-angle-bracket-type-assertion": false,
// 禁止行尾有空格
"no-trailing-whitespace": true,
// 强制单行注释格式:'//' 后必跟空格
"comment-format": [true, "check-space"],
// 任何情况下,if / for / do / while 后必须通过 {} 包裹代码块
"curly": true,
// 使用制表符或空格强制缩进。
"indent": false,
// 要求将import语句按字母顺序排列并进行分组。
"ordered-imports": false,
// 不允许使用console
"no-console": false,
// 不允许使用debugger
"no-debugger": false,
// 箭头函数定义的参数需要括号
"arrow-parens": false,
// 接口名要求大写开头
"interface-name": false,
//不允许使用null关键字
"no-null-keyword": false,
// 不允许连续出现一个或多个空行。
"no-consecutive-blank-lines": false,
// 检查对象文字中键的排序。
"object-literal-sort-keys": false,
// // 字符串文字需要单引号或双引号。
"quotemark": false,
// 行尾必须有分号
"semicolon": false
}
}
vue + ts tslint.json配置
最新推荐文章于 2024-08-08 10:50:24 发布