-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
65 lines (61 loc) · 1.86 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
module.exports = {
root: true, // So parent files don't get applied
env: {
es6: true,
browser: true,
node: true,
},
extends: ['plugin:import/recommended', 'airbnb', 'prettier', 'prettier/react'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
},
plugins: ['babel', 'react-hooks'],
rules: {
'no-alert': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-constant-condition': 'error',
'no-param-reassign': 'off',
'no-prototype-builtins': 'off',
'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/no-autofocus': 'off',
'react/no-array-index-key': 'off',
'react/destructuring-assignment': 'off',
// Off for now.
'react/prop-types': 'off',
'react/forbid-prop-types': 'off',
'react/jsx-curly-brace-presence': 'off',
'react/jsx-handler-names': [
'error',
{
// airbnb is disabling this rule
eventHandlerPrefix: 'handle',
eventHandlerPropPrefix: 'on',
},
],
'react/no-danger': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-find-dom-node': 'off',
'react/require-default-props': 'off',
'react/sort-prop-types': 'error',
'react/jsx-props-no-spreading': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: ['scripts/*.js', 'resolveAlias.js'] },
],
'import/namespace': ['error', { allowComputed: true }],
'import/order': [
'error',
{
groups: [['index', 'sibling', 'parent', 'internal', 'external', 'builtin']],
'newlines-between': 'never',
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
},
};