-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.eslintrc.js
76 lines (76 loc) · 1.96 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
module.exports = {
root: true,
plugins: ['react', 'import', 'jsx-a11y'],
settings: {
resolve: {
root: 'src',
},
react: {
pragma: 'React',
version: '15.0',
},
'import/resolver': {
webpack: {
config: 'webpack/webpack.dev.config.js',
'config-index': 0,
},
},
},
parser: 'babel-eslint',
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'airbnb',
'prettier', // Disable the rules prettier handles for us
],
env: {
es6: true,
browser: true,
jest: true,
node: true,
},
rules: {
// We want to re-enable no-alert when we have something to replace it with
'no-use-before-define': 'off',
'valid-jsdoc': [
'error',
{
prefer: {
arg: 'param',
argument: 'param',
class: 'constructor',
return: 'returns',
virtual: 'abstract',
},
preferType: {
Boolean: 'boolean',
Number: 'number',
object: 'Object',
String: 'string',
},
requireReturn: false,
requireReturnType: true,
requireReturnDescription: false,
requireParamDescription: false,
},
],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'react/no-multi-comp': 'off',
'class-methods-use-this': 'off',
'func-names': ['error', 'as-needed'],
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/anchor-is-valid': [
'error',
{ components: ['Link'], specialLink: ['to'] },
],
// Prettier handles this for us
'react/jsx-indent': 'off',
// Emil: We might contemplate adding in these rules later, some of them I'm disabling because
// I find them overly restrictive, others simply because I don't want to fix them right now
'import/first': 'off',
'import/prefer-default-export': 'off',
'import/extensions': [2, 'never'],
'no-underscore-dangle': 'off',
},
};