-
Notifications
You must be signed in to change notification settings - Fork 30
/
.eslintrc.js
108 lines (104 loc) · 3.73 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
const path = require('path');
module.exports = {
root: true,
globals: {
preval: false,
},
env: {
es6: true,
browser: true,
node: true,
mocha: true,
},
extends: ['airbnb'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
},
plugins: ['babel', 'import', 'jsx-a11y', 'mocha'],
settings: {
'import/resolver': {
alias: [
['@kuveytturk/boa-base', './packages/base/src'],
['@kuveytturk/boa-components', './packages/components/src'],
['@kuveytturk/boa-utils', './packages/utils/src'],
['@kuveytturk/boa-test/utils', './test/utils'],
],
},
},
rules: {
'linebreak-style': 'off', // Don't play nicely with Windows
'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,
ignoreComments: 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-curly-brace-presence': 'off', // airbnb use error, it's buggy
'react/forbid-prop-types': 'off', // airbnb use error
'react/forbid-foreign-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
'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'error',
'mocha/no-global-tests': 'error',
'mocha/no-pending-tests': 'error',
'mocha/no-skipped-tests': 'error',
'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.
'no-plusplus': 'off',
'no-return-assign': 'off',
'react/no-string-refs': 'off',
},
};