-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc
More file actions
67 lines (49 loc) · 2.41 KB
/
Copy path.eslintrc
File metadata and controls
67 lines (49 loc) · 2.41 KB
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
{
"extends": "airbnb",
"globals": {
"expect": true
},
"env": {
"browser": true,
"node": true,
"mocha": true
},
"rules": {
// Can be automatically transformed everywhere with `eslint --fix`
"space-before-function-paren": [2, "never"],
// in contrast to the old lint configuration, enforce the absence of dangling commas
"comma-dangle": [2, "never"],
// allow unnamed anonymous functions
"func-names": 0,
// the airbnb toolchain presupposes concatenation and prepending "use strict"
"strict": 0,
// deactivate enforced indentation, activate at own peril
"indent": [0, 2, {"SwitchCase": 1}],
// allows for placeholder/unused variables that look like: _, __, ___
"no-unused-vars": [2, { "vars": "local", "varsIgnorePattern": "^_{1,3}$", "args": "after-used" }],
// allows us to sort functions and classes in a logical order, rather than the inverse inclusion order
"no-use-before-define": 1,
// allows to assign to argument properties, but not to arguments
"no-param-reassign": [2, {"props": false}],
// allow function values, because some objects don't have methods, they are a collection of functions
"object-shorthand": 0,
// would require fat-arrow function definitions even if there is no result -> e.g. in tests `it`
"prefer-arrow-callback": 0,
// deactivate, because we want to allow for () => { return {}; } in favour of () => ({})
"arrow-body-style": 0,
// for a simple string + value, some of us prefer non-template strings. So enforce on a project-by-project basis
"prefer-template": 0,
// Go for a max-len, but set the default higher. Teams may switch the default at their own peril
"max-len": [2, 120],
// Enforces single parenthesis around arrow-function parameter lists, independent of parameter count
"arrow-parens": [2, "always"],
// Enforce stateless React Components to be written as a pure function
"react/prefer-stateless-function": "off",
// Prevent missing props validation in a React component definition
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
"react/prop-types": ["error", { "ignore": ["key"], "customValidators": [] }],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"no-unused-expressions": 0
}
}