-
Notifications
You must be signed in to change notification settings - Fork 25
/
.eslintrc.yml
144 lines (144 loc) · 4.93 KB
/
.eslintrc.yml
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
env:
browser: true
es6: true
extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/eslint-recommended'
- 'plugin:@typescript-eslint/recommended'
globals:
Atomics: readonly
SharedArrayBuffer: readonly
parser: '@typescript-eslint/parser'
parserOptions:
ecmaVersion: 2018
sourceType: module
project: './tsconfig.json'
plugins:
- '@typescript-eslint'
rules:
#typescript-eslint rules
'no-unused-vars': 'off'
'@typescript-eslint/no-unused-vars': 'error'
'@typescript-eslint/no-explicit-any': 'warn'
'brace-style': 'off'
'@typescript-eslint/brace-style': ['error']
'func-call-spacing': 'off'
'@typescript-eslint/func-call-spacing': ['error', 'never']
'indent': 'off'
'@typescript-eslint/indent': ['error', 4]
'no-extra-parens': 'off'
'@typescript-eslint/no-extra-parens': ['error']
'@typescript-eslint/no-floating-promises': 'warn'
'@typescript-eslint/no-for-in-array': 'error'
'@typescript-eslint/no-inferrable-types': 'error'
'no-magic-numbers': 'off'
'@typescript-eslint/no-magic-numbers': ['error', { 'ignoreNumericLiteralTypes': true, 'ignoreEnums': true, 'ignoreReadonlyClassProperties': true, 'ignore': [0] }]
'@typescript-eslint/no-misused-new': 'error'
'@typescript-eslint/no-misused-promises': 'error'
'@typescript-eslint/no-non-null-assertion': 'error'
'@typescript-eslint/no-require-imports': 'error'
'@typescript-eslint/no-this-alias': 'error'
'no-use-before-define': 'off'
'@typescript-eslint/no-use-before-define': 'error'
'@typescript-eslint/no-useless-constructor': 'error'
'@typescript-eslint/prefer-for-of': 'error'
'@typescript-eslint/prefer-string-starts-ends-with': 'error'
'quotes': 'off'
'@typescript-eslint/quotes': ['error', 'single']
'@typescript-eslint/restrict-plus-operands': 'error'
'semi': 'off'
'@typescript-eslint/semi': ['error']
'@typescript-eslint/type-annotation-spacing': 'error'
'@typescript-eslint/unbound-method': 'error'
"@typescript-eslint/no-shadow": "error"
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "classProperty",
"format": ["UPPER_CASE", "camelCase", "PascalCase"]
},
{
"selector": ["enumMember", "variable"],
"format": ["UPPER_CASE", "PascalCase", "camelCase"]
},
{
"selector": ["variable", "parameter"],
"format": null,
"filter": {
"regex": "^_.*$",
"match": true
}
},
{
"selector": "variable",
"format": ["UPPER_CASE", "PascalCase", "camelCase"],
"filter": {
"regex": "^__Zone_enable_cross_context_check$",
"match": false
}
},
{
"selector": "parameter",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "objectLiteralProperty",
"format": ["camelCase", "PascalCase", "snake_case"]
},
{
"selector": "objectLiteralProperty",
"format": null,
"filter": {
"regex": "^[A-Z][a-z]+_[A-Z][a-z]+$|^[A-Z][a-z]+_ID$|^[a-z]+-[a-z]+$|^[A-Z][a-z]+ [A-Z][a-z]+$",
"match": true
}
}
]
# eslint rules
'curly': ['error', 'multi-line']
'default-case': 'error'
'default-param-last': ['error']
'dot-location': ['error', 'property']
'eqeqeq': ['error', 'always']
'guard-for-in': 'error'
'no-div-regex': 'error'
'no-else-return': ['error', { 'allowElseIf': false }]
'no-eq-null': 'error'
'no-eval': 'error'
'no-extra-bind': 'error'
'no-implicit-globals': 'error'
'no-invalid-this': 'error'
'no-multi-spaces': 'error'
'no-unused-expressions': 'error'
'no-useless-call': 'error'
'no-useless-concat': 'error'
'no-useless-return': 'error'
'no-shadow': 'off'
#codestyle eslint rules
'array-bracket-spacing': ['error', 'never']
'comma-dangle': ['error', 'never']
'comma-spacing': ['error', { 'before': false, 'after': true }]
'comma-style': ['error', 'last']
'computed-property-spacing': ['error', 'never']
'eol-last': ['error', 'always']
'implicit-arrow-linebreak': ['error', 'beside']
'key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }]
'keyword-spacing': ['error', { 'overrides': { 'if': { 'after': false }, 'for': { 'after': false }, 'while': { 'after': false }} }]
'no-multiple-empty-lines': ['error', { 'max': 2, 'maxEOF': 1 }]
'no-trailing-spaces': 'error'
'no-unneeded-ternary': 'error'
'no-whitespace-before-property': 'error'
'semi-spacing': 'error'
'semi-style': ['error', 'last']
'space-before-function-paren': ['error', 'never']
'space-in-parens': 'error'
'arrow-parens': ['error', 'always']
'arrow-spacing': 'error'
'no-var': 'error'
'prefer-arrow-callback': 'error'
'prefer-const': 'error'
'prefer-spread': 'error'