-
Notifications
You must be signed in to change notification settings - Fork 0
/
tslint.js
93 lines (92 loc) · 3.19 KB
/
tslint.js
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
const path = require('path');
module.exports = {
rulesDirectory: [
path.join(
path.dirname(require.resolve('tslint-consistent-codestyle')),
'./',
),
path.join(
path.dirname(require.resolve('tslint-eslint-rules')),
'dist/rules',
),
path.join(path.dirname(require.resolve('tslint-microsoft-contrib')), './'),
],
rules: {
'prefer-const': true, // 2.1, 13.1
'no-var-keyword': true, // 2.2
'object-literal-shorthand': true, // 3.3, 3.4
'object-shorthand-properties-first': true, // 3.5
'object-literal-key-quotes': [true, 'as-needed'], // 3.6
'prefer-array-literal': true, // 4.1
quotemark: [true, 'single', 'avoid-escape', 'avoid-template', 'jsx-double'], // 6.1, 6.5
'prefer-template': true, // 6.3
'no-eval': true, // 6.4
'no-function-constructor-with-string-args': true, // 7.10
'space-before-function-paren': [
true,
{
anonymous: 'always', // 7.11
named: 'never', // 19.3
},
],
'no-parameter-reassignment': true, // 7.12
align: [true, 'arguments', 'parameters'], // 7.15
'ter-prefer-arrow-callback': [true], // 8.1
'arrow-parens': false, // 8.2
'ter-arrow-parens': [true, 'as-needed', { requireForBlockBody: true }], // 8.4
'no-duplicate-imports': true, // 10.4
'one-variable-per-declaration': [true, 'ignore-for-loop'], // 13.2
'no-increment-decrement': true, // 13.6
'triple-equals': [true, 'allow-null-check'], // 15.1
'no-boolean-literal-compare': true, // 15.3
curly: [true, 'ignore-same-line'], // 16.1
'brace-style': [true, '1tbs', { allowSingleLine: true }], // 16.2
'no-else-after-return': true, // 16.3
'comment-format': [true, 'check-space'], // 18.3
indent: [true, 'spaces'], // 19.1
'ter-indent': [true, 2, { SwitchCase: 1 }], // 19.1
whitespace: [
true,
'check-branch', // 19.3
'check-decl', // 19.4
'check-operator', // 19.4
'check-preblock', // 19.2
'check-separator', // 19.14
],
eofline: true, // 19.5
'space-in-parens': [true, 'never'], // 19.9
'array-bracket-spacing': [true, 'never'], // 19.10
'object-curly-spacing': [true, 'always'], // 19.11
'max-line-length': [true, 100], // 19.12
'block-spacing': true, // 19.13
'ter-computed-property-spacing': true, // 19.15
'ter-func-call-spacing': true, // 19.16
'no-trailing-whitespace': true, // 19.18
'no-consecutive-blank-lines': true, // 19.19
'trailing-comma': [
true,
{
multiline: 'always',
singleline: 'never',
esSpecCompliant: true,
},
], // 20.2
semicolon: [true, 'always'], // 21.1
'no-construct': true, // 22.2, 22.3, 22.6
radix: true, // 22.3
'function-name': [
true,
{
'function-regex': /^[a-z$][\w\d]+$/,
'method-regex': /^[a-z$][\w\d]+$/,
'private-method-regex': /^[a-z$][\w\d]+$/,
'protected-method-regex': /^[a-z$][\w\d]+$/,
'static-method-regex': /^[a-z$][\w\d]+$/,
}, // 23.1
],
'variable-name': [true, 'check-format'], // 23.2
'class-name': true, // 23.3
'no-this-assignment': [true, 'allow-destructuring'], // 23.5
'import-name': true, // 23.6
},
};