-
Notifications
You must be signed in to change notification settings - Fork 14
/
.eslintrc.js
170 lines (170 loc) · 6.45 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
module.exports = {
root: true,
ignorePatterns: ['**/*.js'],
parser: '@typescript-eslint/parser',
overrides: [
{
files: ['src/**/*.ts', 'src/**/*.tsx'],
parserOptions: {
project: './tsconfig.base.json',
tsconfigRootDir: __dirname,
createDefaultProgram: true
},
plugins: [
'@typescript-eslint',
'import',
'unused-imports'
],
extends: [
'airbnb-typescript/base',
'plugin:prettier/recommended',
'prettier'
],
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: "never",
jsx: "never",
ts: "never",
tsx: "never"
}
],
'@typescript-eslint/no-use-before-define': 'off',
'import/prefer-default-export': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
'no-plusplus': 'off',
'class-method-use-this': 'off',
'no-underscore-dangle': 'off',
'no-inferrable-types': 'off',
'@typescript-eslint/no-explicit-any': 2,
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'error',
{
vars: 'all',
args: 'all',
ignoreRestSiblings: false,
argsIgnorePattern: '^_'
}
],
'@typescript-eslint/no-inferrable-types': 'off',
'class-methods-use-this': 'off',
complexity: ['error', 21],
eqeqeq: ['error', 'smart'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'enumMember',
format: ['UPPER_CASE']
}
],
'no-empty': ['error', { 'allowEmptyCatch': true }],
// Styling.
'array-bracket-spacing': ['error', 'never'],
'object-curly-spacing': ['error', 'always'],
indent: 'off',
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': ['error', 'never'],
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/dot-notation': 'off',
'no-restricted-globals': 'off',
'@typescript-eslint/no-empty-function': 'off',
'no-param-reassign': 'off',
'max-classes-per-file': 'off',
radix: ['warn', 'as-needed'],
'no-prototype-builtins': 'off',
'no-return-assign': 'off',
'no-restricted-syntax': [
'error',
'LabeledStatement',
'WithStatement'
],
'no-console': [
'warn',
{
allow: ['debug', 'error', 'info']
}
],
'import/export': 0,
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/return-await': 'off'
}
},
{
files: ['tests/**/*.ts'],
parserOptions: {
project: './packages/*/tsconfig.test.json',
tsconfigRootDir: __dirname,
createDefaultProgram: true
},
plugins: [
'@typescript-eslint',
'unused-imports'
],
extends: [
'airbnb-typescript/base',
'plugin:prettier/recommended',
'prettier'
],
rules: {
'import/prefer-default-export': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
'no-plusplus': 'off',
'class-method-use-this': 'off',
'no-underscore-dangle': 'off',
'no-inferrable-types': 'off',
'@typescript-eslint/no-explicit-any': 2,
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'error',
{
vars: 'all',
args: 'all',
ignoreRestSiblings: false,
argsIgnorePattern: '^_'
}
],
'@typescript-eslint/no-inferrable-types': 'off',
'class-methods-use-this': 'off',
complexity: ['error', 20],
eqeqeq: ['error', 'smart'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'enumMember',
format: ['UPPER_CASE']
}
],
'no-empty': ['error', { 'allowEmptyCatch': true }],
// Styling.
'array-bracket-spacing': ['error', 'never'],
'object-curly-spacing': ['error', 'always'],
indent: 'off',
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': ['error', 'never'],
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/dot-notation': 'off',
'no-restricted-globals': 'off',
'@typescript-eslint/no-empty-function': 'off',
'no-param-reassign': 'off',
'max-classes-per-file': 'off',
radix: ['warn', 'as-needed'],
'no-prototype-builtins': 'off',
'no-return-assign': 'off',
'no-restricted-syntax': [
'error',
'LabeledStatement',
'WithStatement'
],
'no-console': 'off',
'import/export': 0,
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/return-await': 'off'
}
}
]
}