-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.js
114 lines (114 loc) · 2.95 KB
/
react.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
module.exports = {
root: true,
env: {
jest: true,
browser: true,
},
settings: {
react: {
version: 'detect'
},
'import/resolver': {
alias: {
map: [['~', './src']],
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx']
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
}
},
version: 'detect'
},
parser: 'babel-eslint',
extends: [
'standard',
'standard-react',
'plugin:jsx-a11y/recommended',
'prettier'
],
plugins: [
'prettier',
'import',
'react',
'react-hooks'
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true
},
project: './jsconfig.json',
createDefaultProgram: true
},
rules: {
'prettier/prettier': 'error',
'space-infix-ops': 'off',
'brace-style': ['error', '1tbs'],
curly: ['error', 'all'],
'import/prefer-default-export': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
'js': 'never',
'jsx': 'never',
'ts': 'never',
'tsx': 'never'
}
],
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: false
},
groups: [
['builtin'],
['external', 'internal'],
['parent'],
['sibling', 'index']
],
'newlines-between': 'always',
pathGroups: [
{
pattern: '~/**',
group: 'parent',
},
],
}
],
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-quotes': ['error', 'prefer-double'],
'array-callback-return': ['error', { allowImplicit: true }],
'default-case': ['error', { commentPattern: '^no default$' }],
'default-case-last': 'off',
'dot-notation': ['error', { allowKeywords: true }],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-plusplus': 0,
'no-trailing-spaces': 'error',
'no-use-before-define': 'off',
'no-return-await': 'error',
'max-classes-per-file': ['error', 1],
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react/destructuring-assignment': 'error',
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx', '.tsx'] }],
'react/jsx-handler-names': 'off',
'react/jsx-indent': ['error', 2],
'react/jsx-indent-props': ['error', 2],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
'react/no-deprecated': ['error'],
'react/no-string-refs': 'error',
'react/self-closing-comp': 'error',
'node/handle-callback-err': 'warn',
semi: ["error", "always"],
'sort-imports': ['error', { ignoreDeclarationSort: true, ignoreCase: true }],
'sort-vars': ['error', { 'ignoreCase': true }]
}
}