-
Notifications
You must be signed in to change notification settings - Fork 14
/
.eslintrc
145 lines (144 loc) · 4.18 KB
/
.eslintrc
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
133
134
135
136
137
138
139
140
141
142
143
144
145
{
"extends": "eslint:recommended",
"parser": "@typescript-eslint/parser",
"plugins": ["import", "@typescript-eslint", "mocha"],
"parserOptions": {
"ecmaVersion": 8
},
"env": {
"es6": true
},
"overrides": [
{
"files": ["*.js"],
"env": {
"commonjs": true,
"node": true
}
},
{
"files": ["src/**/*.*spec.ts"],
"rules": {
"mocha/no-exclusive-tests": "error",
"no-invalid-this": "off",
"no-new": "off"
}
},
{
"files": [
"**/src/**/*.js",
"**/src/**/*.ts",
"**/test/**/*.ts",
"examples/**/*.ts",
"examples/_shared/**/*.js"],
"parserOptions": {
"sourceType": "module"
},
"rules": {
"new-cap": "off",
"no-dupe-class-members": "off",
"no-magic-numbers": [
"error",
{
"ignoreArrayIndexes": true,
"enforceConst": true,
"detectObjects": true,
"ignore": [0, 1, -1]
}
],
"no-undef": "off",
"no-unused-vars": "off"
}
},
{
"files": ["**/*.d.ts"],
"rules": {
"constructor-super": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/generic-type-naming": "off",
"@typescript-eslint/no-unused-vars": "off"
}
},
{
"files": ["**/*.ts"],
"rules": {
"@typescript-eslint/class-name-casing": ["error"],
"@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }],
"@typescript-eslint/generic-type-naming": ["error", "^T(?:[A-Z][a-zA-Z]+)*$"],
"@typescript-eslint/no-unused-vars": ["error"]
}
}
],
"rules": {
"array-bracket-newline": ["error", "consistent"],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs"],
"camelcase": ["error", { "properties": "always" }],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
}
],
"comma-spacing": ["error", { "before": false, "after": true }],
"curly": ["error", "all"],
"eqeqeq": ["error", "always"],
"eol-last": ["error", "always"],
"indent": ["error", 2],
"lines-around-comment": [
"error",
{
"beforeBlockComment": true
}
],
"lines-between-class-members": [
"error",
"always",
{
"exceptAfterSingleLine": true
}
],
"max-statements-per-line": ["error", { "max": 1 }],
"multiline-ternary": ["error", "always-multiline"],
"new-cap": ["error", { "newIsCap": true, "capIsNew": true, "properties": true }],
"new-parens": ["error"],
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 3 }],
"no-array-constructor": ["error"],
"no-console": ["off"],
"no-dupe-args": "off", // doesn't play nice with decorators in constructors
"no-else-return": ["error", { "allowElseIf": false }],
"no-invalid-this": ["error"],
"no-multi-spaces": [
"error",
{
"exceptions": {
"ImportDeclaration": true,
"VariableDeclarator": true
}
}
],
"no-new": ["error"],
"no-new-func": ["error"],
"no-lonely-if": ["error"],
"no-multi-assign": ["error"],
"no-redeclare": "off", // doesn't play nice with decorators in constructors
"no-unneeded-ternary": ["error"],
"no-var": ["error"],
"no-whitespace-before-property": ["error"],
"object-curly-newline": ["error", { "multiline": true, "consistent": true }],
"one-var-declaration-per-line": ["error", "initializations"],
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"rest-spread-spacing": ["error", "never"],
"semi": ["error", "never"],
"space-in-parens": ["error", "never"],
"spaced-comment": ["error", "always"],
"import/order": ["error", { "newlines-between": "always-and-inside-groups" }]
}
}