-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
125 lines (123 loc) · 3.38 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
module.exports = {
parser: "babel-eslint",
// extends: ['prettier', 'prettier/react'],
plugins: ["import", "react"], // alternative: https://github.com/prettier/prettier-eslint
env: {
browser: true,
es6: true,
jest: true,
mocha: true,
node: false
},
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
defaultParams: true,
spread: true
},
sourceType: "module"
},
globals: {
afterAll: true,
afterEach: true,
beforeAll: true,
beforeEach: true,
context: true,
describe: true,
expect: true,
global: true,
it: true,
jest: true,
module: true,
test: true,
window: true
},
rules: {
// Base eslint settings
allowAllPropertiesOnSameLine: false,
"array-bracket-newline": [
2,
{
multiline: true,
minItems: 2
}
],
"array-bracket-spacing": ["error", "never"],
"array-element-newline": [
2,
{
multiline: false,
minItems: 2
}
],
"brace-style": "error",
"class-methods-use-this": "off",
"comma-dangle": [
"error",
{
arrays: "always-multiline",
exports: "only-multiline",
functions: "never",
imports: "only-multiline",
objects: "always-multiline"
}
],
indent: ["error", 4, { 'SwitchCase': 1 }],
"lines-between-class-members": "error",
"newline-per-chained-call": [
"error",
{
ignoreChainWithDepth: 2
}
],
"no-unused-expressions": "off",
"object-curly-newline": [
"error",
{
ExportDeclaration: {
multiline: true,
minProperties: 1
},
ImportDeclaration: {
multiline: true,
minProperties: 1
},
ObjectExpression: {
multiline: true,
minProperties: 1
},
ObjectPattern: {
multiline: true,
minProperties: 1
}
}
],
"object-curly-spacing": ["error", "always"],
"object-property-newline": "error",
"operator-linebreak": ["error", "before"],
"padded-blocks": ["error", "always"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "never"],
"switch-colon-spacing": "error",
yoda: "error",
// eslint plugins
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
"import/prefer-default-export": 0,
// React-specific
"jsx-quotes": ["error", "prefer-double"],
"react/jsx-curly-brace-presence": 0,
"react/jsx-filename-extension": 0,
},
overrides: [
{
files: ["src/**/*.test.js"],
rules: {
"no-console": 0,
"global-require": 0
}
}
]
};