/
.eslintrc.js
98 lines (98 loc) · 2.32 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
module.exports = {
plugins: [
"react",
"jest",
"prettier"
],
env: {
"jest/globals": true
},
extends: [
"airbnb",
"standard",
"standard-react",
"plugin:prettier/recommended",
"prettier/react",
"prettier/standard"
],
parser: "babel-eslint",
parserOptions: {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
globals: {
"__DEV__" : false,
"__PROD__" : false,
"__DEBUG__" : false,
"fetch": true,
"webpack": true,
"React": true,
// for enzyme tests
"shallow": true,
"render": true,
"mount": true,
"relPath": true,
"localStorage": true,
"FileReader": true,
"DOMParser": true,
},
settings: {
"import/resolver": {
"babel-module": {},
"node": {}
},
"module-resolver": {},
"import/core-modules": ["styled-jsx/css"]
},
rules: {
"arrow-parens": [0, "as-needed"],
// because of all of our rails API snake_case variables
"camelcase": 0,
"func-names": 0,
"import/no-absolute-path": 0,
"import/extensions": 0,
"no-param-reassign": ["error", { "props": false }],
"no-underscore-dangle": 0,
"prettier/prettier": "error",
"prefer-destructuring": ["error", {
"VariableDeclarator": {
"array": false,
"object": true
},
// this is the part we changed... annoying when it wants:
// ;({ variable } = object) -- instead of:
// variable = object.variable
"AssignmentExpression": {
"array": false,
"object": false
}
}, {
"enforceForRenamedProperties": false
}],
"radix": ["error", "as-needed"],
"space-before-function-paren": 0,
"jsx-a11y/anchor-is-valid": [ "error", {
"components": [ "Link" ],
"specialLink": [ "to", "hrefLeft", "hrefRight" ],
"aspects": [ "noHref", "invalidHref", "preferButton" ]
}],
"react-in-jsx-scope": 0,
"react/jsx-filename-extension": 0,
"react/prefer-stateless-function": 0,
"react/jsx-curly-brace-presence": 0,
"react/jsx-closing-tag-location": 0,
"react/no-did-mount-set-state": 0,
"react/sort-comp": [1, {
order: [
'static-methods',
'instance-variables',
'lifecycle',
'everything-else',
'render',
]
}],
}
}