-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
75 lines (75 loc) · 1.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
module.exports = {
parser: 'babel-eslint',
parserOptions: {
allowImportExportEverywhere: true,
},
extends: [
'airbnb',
'plugin:jest/recommended',
'jest-enzyme',
'plugin:jsx-a11y/strict',
'prettier',
'prettier/react',
],
env: {
browser: true,
node: true,
},
settings: {
react: {
version: 'detect'
}
},
plugins: ['react', 'react-hooks', 'prettier'],
rules: {
'prettier/prettier': ['error'],
'react/jsx-wrap-multilines': [
'error',
{ declaration: false, assignment: false },
],
'react/jsx-filename-extension': 'off',
'react/jsx-fragments': 'error',
'require-jsdoc': [
'error',
{
require: {
MethodDefinition: true,
},
},
],
'no-underscore-dangle': 'off',
'import/no-named-as-default': 'off', // https://stackoverflow.com/questions/44437203/how-do-i-resolve-eslint-import-no-named-as-default
'react/jsx-curly-spacing': [
'error',
{
when: 'never',
children: true,
},
],
'no-magic-numbers': [
'error',
{
ignoreArrayIndexes: true,
ignore: [-1, 0, 1],
},
],
'import/prefer-default-export': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
overrides: [
{
files: ['*.test.js'],
rules: {
'react/prop-types': 'off',
'no-magic-numbers': 'off',
},
},
{
files: ['stories/**/*'],
rules: {
'no-magic-numbers': 'off',
},
},
],
};