-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtslint.json
65 lines (65 loc) · 3.9 KB
/
tslint.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
"defaultSeverity": "warning",
"extends": [
"tslint:recommended"
],
"linterOptions": {
"exclude": [
"node_modules/**"
]
},
"rules": {
"quotemark": [true, "single"], // 字符串文字需要单引号或双引号。
"indent": [true, "spaces", 2], // 使用制表符或空格强制缩进。
"member-access": false, // 需要类成员的显式可见性声明。
"interface-name": false, // 接口名要求大写开头
"ordered-imports": false, // 要求将import语句按字母顺序排列并进行分组。
"object-literal-sort-keys": false, // 检查对象文字中键的排序。
"no-consecutive-blank-lines": false, // 不允许连续出现一个或多个空行。
"no-shadowed-variable": false, // 不允许隐藏变量声明。
"no-trailing-whitespace": false, // 不允许在行尾添加尾随空格。
"semicolon": false, // 是否分号结尾
"trailing-comma": false, // 是否强象添加逗号
"prefer-conditional-expression": false, // for (... in ...)语句必须用if语句过滤
"curly": true, // for if do while 要有括号
"forin": false, // 用for in 必须用if进行过滤
"import-blacklist": true, // 允许使用import require导入具体的模块
"no-arg": true, // 不允许使用 argument.callee
"no-bitwise": true, // 不允许使用按位运算符
"no-console": false, // 不能使用console
"no-construct": true, // 不允许使用 String/Number/Boolean的构造函数
"no-debugger": true, // 不允许使用debugger
"no-duplicate-super": true, // 构造函数两次用super会发出警告
"no-empty": true, // 不允许空的块
"no-eval": true, // 不允许使用eval
"no-floating-promises": false, // 必须正确处理promise的返回函数
"no-for-in-array": false, // 不允许使用for in 遍历数组
"no-implicit-dependencies": false, // 不允许在项目的package.json中导入未列为依赖项的模块
"no-inferred-empty-object-type": false, // 不允许在函数和构造函数中使用{}的类型推断
"no-invalid-template-strings": true, // 警告在非模板字符中使用${
"no-invalid-this": true, // 不允许在非class中使用 this关键字
"no-misused-new": true, // 禁止定义构造函数或new class
"no-null-keyword": false, // 不允许使用null关键字
"no-object-literal-type-assertion": false, // 禁止object出现在类型断言表达式中
"no-return-await": true, // 不允许return await
"arrow-parens": false, // 箭头函数定义的参数需要括号
"adjacent-overload-signatures": false, // Enforces function overloads to be consecutive.
"ban-comma-operator": true, // 禁止逗号运算符。
"no-any": false, // 不需使用any类型
"no-empty-interface": true, // 禁止空接口 {}
"no-internal-module": true, // 不允许内部模块
"no-magic-numbers": false, // 不允许在变量赋值之外使用常量数值。当没有指定允许值列表时,默认允许-1,0和1
"no-namespace": [true, "allpw-declarations"], // 不允许使用内部modules和命名空间
"no-non-null-assertion": true, // 不允许使用!后缀操作符的非空断言。
"no-parameter-reassignment": true, // 不允许重新分配参数
"no-reference": true, // 禁止使用// /<reference path=> 导入 ,使用import代替
"no-unnecessary-type-assertion": false, // 如果类型断言没有改变表达式的类型就发出警告
"no-var-requires": false, // 不允许使用var module = require("module"),用 import foo = require('foo')导入
"prefer-for-of": true, // 建议使用for(..of)
"promise-function-async": false, // 要求异步函数返回promise
"max-classes-per-file": [true, 2], // 一个脚本最多几个申明类
"variable-name": false,
"prefer-const": false, // 提示可以用const的地方
"no-spaced-func": false //函数调用时 函数名与()之间不能有空格
}
}