-
Notifications
You must be signed in to change notification settings - Fork 196
/
.eslintrc.js
140 lines (139 loc) · 3.55 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
require('@rushstack/eslint-patch/modern-module-resolution');
module.exports = {
root: true,
extends: [
'airbnb-base/legacy',
'prettier',
'plugin:jest/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:import/typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-essential',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier',
],
env: {
es6: true,
node: true,
browser: true,
jest: true,
'vue/setup-compiler-macros': true,
},
parser: '@typescript-eslint/parser',
plugins: ['prettier', '@typescript-eslint', 'import', 'vue'],
settings: {
jest: {
version: 26,
},
react: {
version: '17',
},
},
rules: {
'prettier/prettier': [
2,
{
endOfLine: 'lf',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
printWidth: 80,
proseWrap: 'never',
overrides: [{ files: '.prettierrc', options: { parser: 'json' } }],
},
],
'import/order': 2,
'import/no-default-export': 0,
'no-restricted-syntax': 0,
semi: 0,
'no-console': 2,
'consistent-return': 0,
'import/no-extraneous-dependencies': 2,
'import/prefer-default-export': 0,
'no-underscore-dangle': [
2,
{
allowAfterThis: true,
},
],
'no-plusplus': 0,
'class-methods-use-this': 0,
'no-param-reassign': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'import/no-named-default': 0,
'react-hooks/exhaustive-deps': 0,
'react-hooks/rules-of-hooks': 0,
'react/jsx-filename-extension': [
1,
{
extensions: ['.ts', '.tsx', '.js', '.jsx'],
},
],
'react/sort-comp': 2,
'react/display-name': 0,
'react/prop-types': 0,
'react/state-in-constructor': 0,
'react/jsx-props-no-spreading': 0,
'react/no-array-index-key': 0,
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/no-noninteractive-element-interactions': 0,
'jsx-a11y/no-static-element-interactions': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'no-use-before-define': 0,
'@typescript-eslint/no-use-before-define': [2],
'no-shadow': 0,
'@typescript-eslint/no-shadow': [1],
'no-alert': 2,
'no-caller': 2,
'no-else-return': 2,
'no-useless-return': 2,
'no-extra-bind': 2,
'no-magic-numbers': 0,
'no-self-compare': 2,
'no-multi-spaces': 2,
'require-await': 2,
'no-multi-assign': 2,
'no-var': 2,
'no-useless-rename': 2,
'object-shorthand': 2,
'prefer-arrow-callback': 2,
'prefer-const': 2,
'max-statements-per-line': [2, { max: 1 }],
'max-params': [1, 4],
'no-unreachable': 2,
'no-useless-computed-key': 2,
'block-spacing': [2, 'always'],
'lines-between-class-members': [2, 'always'],
eqeqeq: [
2,
'always',
{
null: 'ignore',
},
],
curly: [2, 'all'],
'guard-for-in': 0,
'vue/multi-word-component-names': 0,
},
overrides: [
{
files: ['*.vue'],
parser: 'vue-eslint-parser',
},
{
files: ['*.tsx'],
rules: {
'react-hooks/exhaustive-deps': 1,
'react-hooks/rules-of-hooks': 2,
},
},
],
};