-
Notifications
You must be signed in to change notification settings - Fork 27
/
.eslintrc.js
127 lines (126 loc) · 2.91 KB
/
.eslintrc.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
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
webextensions: true,
},
extends: ['eslint:recommended', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
settings: {
'import/resolver': {
typescript: {},
},
},
rules: {
// most overrides are based on airbnb rule with some change
camelcase: ['off'],
'import/prefer-default-export': ['off'],
'no-console': [
'error',
{
allow: ['warn', 'error'],
},
],
'no-continue': ['off'],
'no-else-return': ['off'],
'no-lonely-if': ['off'],
'no-mixed-operators': [
'error',
{
allowSamePrecedence: true,
groups: [
['%', '**'],
['%', '+'],
['%', '-'],
['%', '*'],
['%', '/'],
['/', '*'],
['&', '|', '<<', '>>', '>>>'],
['==', '!=', '===', '!=='],
['&&', '||'],
],
},
],
'no-multi-spaces': [
'error',
{
ignoreEOLComments: true,
},
],
'no-multiple-empty-lines': [
'error',
{
max: 2,
maxBOF: 0,
maxEOF: 0,
},
],
'no-plusplus': ['off'],
'no-restricted-syntax': [
'error',
{
message:
'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
selector: 'ForInStatement',
},
{
message:
'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
selector: 'LabeledStatement',
},
{
message:
'`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
selector: 'WithStatement',
},
],
'no-use-before-define': [
'error',
{
classes: true,
functions: false,
variables: true,
},
],
'nonblock-statement-body-position': ['off'],
'prefer-destructuring': [
'off',
{
array: false,
object: true,
},
],
'require-await': 'error',
// ESLint does not detects modules properly
// in particular, it treats check-coverage as a module
strict: 'off',
'lines-around-directive': 'off',
},
overrides: [
{
files: ['*.ts'],
rules: {
'consistent-return': ['off'],
'no-redeclare': ['off'],
'no-undef': ['off'],
'no-unused-vars': ['off'],
'no-useless-return': ['off'],
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': ['error'],
'lines-between-class-members': 'off',
},
},
{
files: ['./test/**'],
rules: {
'no-console': ['off'],
},
},
],
};