-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
80 lines (80 loc) · 2.35 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
module.exports = {
env: {
jest: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
root: true,
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': ['error', { ignoreRestArgs: true }],
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: '[iI]gnored' },
],
camelcase: 'error',
'capitalized-comments': 'error',
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': 'error',
complexity: 'error',
'consistent-return': 'error',
'default-case': 'error',
'eol-last': ['error', 'always'],
'id-blacklist': ['error', 'err', 'e', 'cb', 'callback'],
'implicit-arrow-linebreak': ['off'],
indent: ['error', 2, { SwitchCase: 1 }],
'line-comment-position': ['error', { position: 'above' }],
'linebreak-style': ['error', 'unix'],
'max-classes-per-file': ['error', 1],
'max-depth': 'error',
'max-len': ['error', 80],
'max-nested-callbacks': ['error', 5],
'max-params': ['error', 10],
'max-statements-per-line': ['error', { max: 1 }],
'multiline-comment-style': ['error', 'starred-block'],
'new-parens': 'error',
'no-alert': 'error',
'no-caller': 'error',
'no-console': 'error',
'no-extend-native': 'error',
'no-eval': 'error',
'no-tabs': 'error',
'no-underscore-dangle': 'off',
'no-warning-comments': [
'error',
{
terms: ['xxx', 'todo', 'fixme'],
},
],
'no-var': 'error',
'operator-linebreak': ['error', 'after'],
quotes: [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: true },
],
'sort-keys': ['error', 'asc', { natural: true }],
yoda: ['error', 'always'],
},
settings: {
'import/extensions': ['.ts'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
'import/resolver': {
node: {
extensions: ['.ts'],
},
},
},
};