-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
77 lines (71 loc) · 2.26 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
module.exports = {
'root': true,
'parser': '@typescript-eslint/parser',
'plugins': [
'@typescript-eslint',
'react-hooks',
],
'extends': [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
],
'settings': {
'import/resolver': {
'node': {
'moduleDirectory': ['node_modules', './'],
'extensions': ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
'rules': {
'no-multi-spaces': 'error',
'no-multiple-empty-lines': ['error', { 'max': 1 }],
'func-call-spacing': ['error', 'never'],
'no-unneeded-ternary': 'error',
'quotes': ['error', 'single'],
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'space-infix-ops': 'error',
'@typescript-eslint/type-annotation-spacing': ['error', {
'before': false,
'after': true,
'overrides': { 'arrow': { 'before': true, 'after': true } },
}],
'arrow-spacing': ['error', { 'before': true, 'after': true }],
'key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
'no-var': 'error',
'no-unused-vars': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn',
'indent': ['error', 2],
'@typescript-eslint/indent': ['error', 2],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// semi
// 'semi': ['error', 'always'],
'semi': 'off',
'@typescript-eslint/semi': ['error'],
'semi-spacing': ['error', { 'before': false, 'after': true }],
'semi-style': ['error', 'last'],
'no-extra-semi': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'error',
'max-len': ['warn', { 'code': 100 }],
'linebreak-style': ['error', 'unix'],
'eol-last': 'error',
'no-trailing-spaces': 'error',
'space-in-parens': ['error', 'never'],
'no-console': 'off',
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': 'error',
'computed-property-spacing': 'error',
'keyword-spacing': 'error',
'sort-imports': 'off',
'import/order': ['error', {
'newlines-between': 'always',
}],
},
};