-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
116 lines (115 loc) · 2.72 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
const shareConfig = {
rules: {
semi: 1,
// camelcase: ['error', { ignoreImports: true }],
'no-use-before-define': 0,
'no-param-reassign': 1,
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/label-has-associated-control': 0,
'jsx-a11y/no-noninteractive-tabindex': 1,
'react/jsx-filename-extension': [
2,
{
extensions: ['.jsx'],
},
],
'react/jsx-props-no-spreading': 0,
'prettier/prettier': ['error'],
// overide airbnb
'consistent-return/prefer-default-export': 0,
'max-classes-per-file': 0,
'no-plusplus': 0,
'consistent-return': 0,
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'import/prefer-default-export': 0,
'react/jsx-uses-react': 0,
'react/react-in-jsx-scope': 0,
'react/prop-types': 0,
'react/require-default-props': 0,
},
settings: {
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
};
module.exports = {
extends: [
'airbnb',
'plugin:jsx-a11y/recommended',
'prettier',
'plugin:react-hooks/recommended',
'plugin:jest/recommended',
],
parser: '@babel/eslint-parser',
plugins: ['jsx-a11y', 'prettier', 'only-warn', 'jest'],
rules: shareConfig.rules,
settings: shareConfig.settings,
globals: {
JSX: 'readonly',
page: true,
browser: true,
jestPuppeteer: true,
},
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'airbnb',
'plugin:jsx-a11y/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'jsx-a11y', 'prettier'],
rules: {
...shareConfig.rules,
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: '_' },
],
'no-shadow': 0,
'@typescript-eslint/no-shadow': ['error'],
'react/jsx-filename-extension': [
1,
{
extensions: ['.tsx'],
},
],
},
settings: {
...shareConfig.settings,
},
env: {
browser: true,
'jest/globals': true,
},
},
],
};