-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
114 lines (110 loc) · 2.34 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
const [OFF, WARN, ERROR] = [0, 1, 2];
module.exports = {
extends: [
'react-app',
'plugin:jsx-a11y/recommended',
'plugin:jest/recommended',
'airbnb',
'plugin:import/recommended',
],
plugins: ['react', 'jest', 'react-hooks', 'jsx-a11y', 'import'],
parser: 'babel-eslint',
ignorePatterns: ['!.eslintrc.js'],
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
modules: true,
},
},
env: {
es6: true,
browser: true,
jest: true,
},
rules: {
// import
'import/no-extraneous-dependencies': OFF,
// react
'react/jsx-filename-extension': [ERROR, { extensions: ['.js'] }],
'react/jsx-one-expression-per-line': OFF,
'react/prop-types': [
ERROR,
{
skipUndeclared: true,
},
],
'react/jsx-props-no-spreading': OFF,
// react-hooks
'react-hooks/exhaustive-deps': WARN,
'react-hooks/rules-of-hooks': ERROR,
// base
'arrow-parens': [ERROR, 'always'],
'class-methods-use-this': OFF,
'comma-dangle': [
ERROR,
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
},
],
'function-paren-newline': [OFF, 'consistent'],
'implicit-arrow-linebreak': OFF,
'lines-between-class-members': [
ERROR,
'always',
{
exceptAfterSingleLine: true,
},
],
'max-len': [
ERROR,
{
code: 120,
ignoreComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'no-console': [
WARN,
{
allow: ['warn', 'error'],
},
],
'no-plusplus': OFF,
'no-use-before-define': [
ERROR,
{
functions: false,
classes: false,
variables: false,
},
],
'object-curly-newline': [ERROR, { consistent: true }],
'operator-linebreak': [
ERROR,
'before',
{
overrides: {
'=': 'after',
},
},
],
radix: [ERROR, 'as-needed'],
'space-before-function-paren': [
ERROR,
{
anonymous: 'ignore',
named: 'never',
asyncArrow: 'always',
},
],
},
};