-
Notifications
You must be signed in to change notification settings - Fork 1
/
maintainability.js
132 lines (118 loc) · 3.63 KB
/
maintainability.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
"use strict";
/**
* Rules that make code more maintainable over time and by multiple people.
*/
module.exports = {
rules: {
/**
* Enforces function overloads to be consecutive.
*
* @see https://palantir.github.io/tslint/rules/adjacent-overload-signatures/
*/
"adjacent-overload-signatures": true,
/**
* Enforces a threshold of cyclomatic complexity.
*
* @see https://palantir.github.io/tslint/rules/cyclomatic-complexity/
*/
"cyclomatic-complexity": {
severity: "default",
options: [30],
},
/**
* Warns when deprecated APIs are used.
*
* @see https://palantir.github.io/tslint/rules/deprecation/
*/
deprecation: {
severity: "warning",
},
/**
* A file may not contain more than the specified number of classes
*
* @see https://palantir.github.io/tslint/rules/max-classes-per-file/
*/
"max-classes-per-file": {
severity: "default",
options: [1, "exclude-class-expressions"],
},
/**
* Requires files to remain under a certain number of lines
*
* @see https://palantir.github.io/tslint/rules/max-file-line-count/
*/
"max-file-line-count": {
severity: "default",
options: [1000],
},
/**
* Disallows default exports in ES6-style modules.
*
* @see https://palantir.github.io/tslint/rules/no-default-export/
*/
"no-default-export": true,
/**
* Don't allow default imports from local modules (e.g. "./foo", "../foo").
* DO allow default imports from node_modules (e.g. "foo", "@scope/foo").
* DO allow default imports from specific files (e.g. "./data.json", "../styles.css")
*
* @see https://palantir.github.io/tslint/rules/no-default-import/
*/
"no-default-import": {
severity: "default",
options: [{
fromModules: "^\\..*\\/[^.]+$"
}]
},
/**
* Disallows multiple import statements from the same module.
*
* @see https://palantir.github.io/tslint/rules/no-duplicate-imports/
*/
"no-duplicate-imports": true,
/**
* Disallows the use constant number values outside of variable assignments.
* When no list of allowed values is specified, -1, 0 and 1 are allowed by default.
*
* @see https://palantir.github.io/tslint/rules/no-magic-numbers/
*
* This rule is disabled because there are too many exception cases where it's clearer
* to use constant number values rather than creating variables.
*/
"no-magic-numbers": false,
/**
* Disallows mergeable namespaces in the same file.
*
* @see https://palantir.github.io/tslint/rules/no-mergeable-namespace/
*/
"no-mergeable-namespace": true,
/**
* Disallows reassigning parameters.
*
* @see https://palantir.github.io/tslint/rules/no-parameter-reassignment/
*
* This rule is disabled because it's often necessary to normalize multi-type parameters.
*/
"no-parameter-reassignment": false,
/**
* Disallows importing any submodule.
*
* @see https://palantir.github.io/tslint/rules/no-submodule-imports/
*/
"no-submodule-imports": {
severity: "default",
options: [
"source-map-support/register"
]
},
/**
* Requires that private variables are marked as `readonly` if they`re never modified outside of the constructor.
*
* @see https://palantir.github.io/tslint/rules/prefer-readonly/
*
* This rule is currently disabled due to false positives
* @see https://github.com/palantir/tslint/issues/3803
*/
"prefer-readonly": false,
}
};