-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
112 lines (112 loc) · 3.85 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
module.exports = {
env: {
node: true,
'jest/globals': true
},
'extends': ['plugin:@typescript-eslint/recommended', 'plugin:jest/recommended', 'plugin:import/recommended'],
parser: '@typescript-eslint/parser',
overrides: [
{
files: ['*.ts'],
parserOptions: {
project: './tsconfig.eslint.json',
sourceType: 'module',
tsconfigRootDir: __dirname,
},
}
],
plugins: ['@typescript-eslint', 'filenames', 'jest'],
settings: {
'import/extensions': ['.js', '.ts'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts']
},
'import/resolver': {
node: {
extensions: ['.js', '.ts']
}
}
},
rules: {
'filenames/match-regex': ['error', '^[a-z0-9-.]+$'],
'no-bitwise': 'error',
curly: ['error', 'all'],
eqeqeq: 'error',
'wrap-iife': ['error', 'any'],
indent: ['error', 4, {SwitchCase: 1}],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: ['const', 'let', 'var'],
next: '*'
},
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var']
},
{
blankLine: 'always',
prev: 'multiline-expression',
next: 'multiline-expression'
},
],
'new-cap': 'error',
'no-caller': 'error',
'no-empty': ['error', {allowEmptyCatch: true}],
'no-new': 'error',
'no-plusplus': 'error',
quotes: ['error', 'single', {avoidEscape: true, allowTemplateLiterals: true}],
'no-undef': 'error',
'no-unused-vars': 'error',
strict: ['error', 'safe'],
'no-unused-expressions': 'error',
'no-mixed-spaces-and-tabs': 'error',
'max-len': ['error', 120],
'space-infix-ops': 'error',
'space-unary-ops': ['error', {words: true, nonwords: false}],
'space-before-blocks': ['error', 'always'],
semi: ['error', 'always'],
'keyword-spacing': ['error', {}],
'quote-props': ['error', 'as-needed', {keywords: true}],
'dot-notation': 'error',
'space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always'
}],
'comma-spacing': ['error', {before: false, after: true}],
'array-bracket-spacing': ['error', 'never'],
'array-bracket-newline': 'off',
'object-curly-newline': ['error', {multiline: true, consistent: true}],
'object-property-newline': ['error', {allowMultiplePropertiesPerLine: true}],
'key-spacing': ['error', {afterColon: true, beforeColon: false}],
'no-trailing-spaces': ['error'],
'object-curly-spacing': ['error', 'never'],
'max-depth': ['warn', 3],
'max-lines': ['warn', 300],
complexity: ['warn', 20],
'max-statements': ['warn', 25],
'one-var-declaration-per-line': ['error', 'initializations'],
'eol-last': ['warn'],
'import/no-named-as-default': 'off',
'import/order': ['error', {
'newlines-between': 'never',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
}],
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
'ts-check': 'allow-with-description',
}
],
'@typescript-eslint/no-explicit-any': 'off'
}
};