-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
86 lines (82 loc) · 3.27 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
module.exports = {
// So parent files don't get applied
root: true,
globals: {
preval: false,
},
env: {
es6: true,
browser: true,
node: true,
jest: true,
},
extends: ['plugin:import/recommended', 'airbnb'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
},
plugins: ['babel', 'import', 'jsx-a11y', 'jest'],
rules: {
'arrow-body-style': 'off', // Incompatible with prettier
'arrow-parens': 'off', // Incompatible with prettier
'object-curly-newline': 'off', // Incompatible with prettier
'function-paren-newline': 'off', // Incompatible with prettier
indent: 'off', // Incompatible with prettier
'implicit-arrow-linebreak': 'off', // Incompatible with prettier
'space-before-function-paren': 'off', // Incompatible with prettier
'no-confusing-arrow': 'off', // Incompatible with prettier
'no-mixed-operators': 'off', // Incompatible with prettier
'consistent-this': ['error', 'self'],
'max-len': [
'error',
100,
2,
{
ignoreUrls: true,
},
], // airbnb is allowing some edge cases
'no-console': 'error', // airbnb is using warn
'prefer-destructuring': 'off', // airbnb is using error. destructuring harm grep potential.
'no-alert': 'error', // airbnb is using warn
'no-param-reassign': 'off', // airbnb use error
'no-prototype-builtins': 'off', // airbnb use error
'operator-linebreak': 'off', // airbnb use error
// It would be better to enable this rule, but it might slow us down.
'import/no-extraneous-dependencies': 'off',
'import/namespace': ['error', { allowComputed: true }],
'import/order': [
'error',
{
groups: [['index', 'sibling', 'parent', 'internal', 'external', 'builtin']],
'newlines-between': 'never',
},
],
// 'react/jsx-indent': 'off', // Incompatible with prettier
// 'react/jsx-closing-bracket-location': 'off', // Incompatible with prettier
// 'react/jsx-wrap-multilines': 'off', // Incompatible with prettier
// 'react/jsx-indent-props': 'off', // Incompatible with prettier
// 'react/jsx-one-expression-per-line': 'off', // Incompatible with prettier
// 'react/jsx-handler-names': [
// 'error',
// {
// // airbnb is disabling this rule
// eventHandlerPrefix: 'handle',
// eventHandlerPropPrefix: 'on',
// },
// ],
// 'react/jsx-curly-brace-presence': 'off', // airbnb use error, it's buggy
// 'react/forbid-prop-types': 'off', // airbnb use error
// 'react/require-default-props': 'off', // airbnb use error, it's buggy
// 'react/destructuring-assignment': 'off', // airbnb use error
// 'react/jsx-filename-extension': ['error', { extensions: ['.js'] }], // airbnb is using .jsx
// 'react/no-danger': 'error', // airbnb is using warn
// 'react/no-direct-mutation-state': 'error', // airbnb is using off
// 'react/no-find-dom-node': 'off', // airbnb use error
// 'react/sort-prop-types': 'error', // airbnb use off
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/no-autofocus': 'off', // We are a library, people do what they want.
'max-lines-per-function': ['error', { max: 50, skipComments: true }],
},
};