-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc.js
88 lines (88 loc) · 2.29 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
module.exports = {
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
generators: true,
experimentalObjectRestSpread: true,
},
sourceType: 'module',
allowImportExportEverywhere: false,
},
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:prettier/recommended',
'plugin:promise/recommended',
'plugin:security/recommended',
],
plugins: ['compat', 'promise', 'security'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.json', '.css'],
paths: './src',
},
},
polyfills: ['fetch', 'promises'],
},
env: {
node: true,
},
globals: {
__DEV__: true,
__dirname: true,
after: true,
afterAll: true,
afterEach: true,
artifacts: true,
before: true,
beforeAll: true,
beforeEach: true,
console: true,
contract: true,
describe: true,
expect: true,
fetch: true,
global: true,
it: true,
module: true,
process: true,
Promise: true,
require: true,
setTimeout: true,
test: true,
xdescribe: true,
xit: true,
web3: true,
},
rules: {
'compat/compat': 'error',
'import/first': 'error',
'import/no-anonymous-default-export': 'error',
'import/no-unassigned-import': 'error',
'import/prefer-default-export': 'error',
'import/no-named-as-default': 'off',
'import/no-unresolved': 'error',
'promise/avoid-new': 'off',
'security/detect-object-injection': 'off',
'arrow-body-style': 'off',
'lines-between-class-members': ['error', 'always'],
'no-console': ['error', { allow: ['assert'] }],
'no-shadow': 'error',
'no-var': 'error',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: 'class', next: '*' },
{ blankLine: 'always', prev: 'do', next: '*' },
{ blankLine: 'always', prev: '*', next: 'export' },
{ blankLine: 'always', prev: 'for', next: '*' },
{ blankLine: 'always', prev: 'if', next: '*' },
{ blankLine: 'always', prev: 'switch', next: '*' },
{ blankLine: 'always', prev: 'try', next: '*' },
{ blankLine: 'always', prev: 'while', next: '*' },
{ blankLine: 'always', prev: 'with', next: '*' },
],
'prefer-const': 'error',
},
}