-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.js
74 lines (73 loc) · 2.6 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
module.exports = {
// So parent files don't get applied
root: true,
env: {
es6: true,
browser: true,
node: true,
},
extends: 'airbnb',
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
},
plugins: [
'babel',
'jsx-a11y',
'mocha',
],
rules: {
'array-bracket-spacing': 'off', // use babel plugin rule
'arrow-body-style': 'off',
'arrow-parens': ['error', 'always'], // airbnb use as-needed
'consistent-this': ['error', 'self'],
'max-len': ['error', 110], // airbnb use 100, wishlist, one day
'no-console': 'error', // airbnb is using warn
'no-param-reassign': 'off',
'no-prototype-builtins': 'off',
'object-curly-spacing': 'off', // use babel plugin rule
'operator-linebreak': ['error', 'after'], // aibnb is disabling this rule
'babel/object-curly-spacing': ['error', 'always'],
'babel/array-bracket-spacing': ['error', 'never'],
'import/no-unresolved': 'off',
'import/no-named-as-default': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
'react/jsx-handler-names': ['error', { // airbnb is disabling this rule
eventHandlerPrefix: 'handle',
eventHandlerPropPrefix: 'on',
}],
'react/forbid-prop-types': 'off', // airbnb use error
'react/jsx-filename-extension': ['error', {extensions: ['.js']}], // airbnb is using .jsx
'react/jsx-max-props-per-line': ['error', {maximum: 3}], // airbnb is disabling this rule
'react/no-danger': 'error', // airbnb is using warn
'react/no-direct-mutation-state': 'error', // airbnb is disabling this rule
'react/no-find-dom-node': 'warn', // wishlist, one day
'react/no-unused-prop-types': 'off', // Is still buggy
'react/sort-prop-types': 'error', // airbnb do nothing here.
'react/sort-comp': [2, {
order: [
'static-methods',
'lifecycle',
// 'properties', // not real -- NEEDS A PR!!!
// '/^handle.+$/', // wishlist -- needs above first
// '/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/', // wishlist -- needs above first
'everything-else',
'/^render.+$/',
'render'
],
}],
'jsx-a11y/label-has-for': 'warn', // wishlist, one day
'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',
// Overrides
'no-underscore-dangle': 'off',
'global-require': 'off',
'react/jsx-no-bind': 'warn',
},
};