-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
71 lines (62 loc) · 1.99 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
const error = 'error';
const warn = 'warn';
const off = 'off';
const always = 'always';
module.exports = {
parserOptions: {
ecmaVersion: 'latest',
},
extends: [
'airbnb',
'airbnb/hooks',
'plugin:react/jsx-runtime',
],
env: {
browser: true,
},
rules: {
'arrow-parens': [error, 'as-needed'],
camelcase: [warn],
'no-param-reassign': [warn],
'object-curly-newline': [warn, { consistent: true }],
'implicit-arrow-linebreak': [off],
// 'prefer-template': [warn],
'space-before-function-paren': [error, always],
'import/extensions': [warn],
'import/no-extraneous-dependencies': [warn, { devDependencies: ['**/*.test.js', '**/*.spec.js', '**/*.stories.js'] }],
// 'import/no-named-as-default': [off],
// 'import/no-unresolved': [warn],
'jsx-a11y/anchor-is-valid': [error, { specialLink: ['to'] }],
'jsx-a11y/label-has-for': [error, { required: { some: ['nesting', 'id'] } }],
'react/jsx-filename-extension': [warn, { extensions: ['.js', '.jsx'] }],
'react/jsx-one-expression-per-line': [off],
'react/jsx-props-no-spreading': [off],
'react/no-unescaped-entities': [off],
'react/prefer-stateless-function': [warn],
'react/prop-types': [warn, { skipUndeclared: true }],
// 'react/state-in-constructor': [off],
'react/static-property-placement': [off],
// 'react-hooks/exhaustive-deps': [warn],
// 'react-hooks/rules-of-hooks': [warn],
'react/function-component-definition': [error, {
namedComponents: ['arrow-function'],
}],
'key-spacing': [error, {
singleLine: { mode: 'strict' },
multiLine: { mode: 'minimum' },
}],
// 'no-multi-spaces': [warn, {
// exceptions: {
// Property: true,
// VariableDeclarator: true,
// ImportDeclaration: true,
// BinaryExpression: true,
// },
// }],
'no-unused-expressions': [warn, {
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
}],
},
};