-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
61 lines (59 loc) · 1.82 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
module.exports = {
parser: 'babel-eslint',
extends: ['airbnb-base', 'prettier'],
plugins: ['prettier', 'mocha'],
env: {
node: true,
mocha: true,
},
rules: {
// plugins rules
'prettier/prettier': 'error',
'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'error',
'mocha/no-global-tests': 'error',
'mocha/no-identical-title': 'error',
'mocha/no-nested-tests': 'error',
'mocha/no-pending-tests': 'error',
'mocha/no-return-and-callback': 'error',
'mocha/no-setup-in-describe': 'error',
'mocha/no-sibling-hooks': 'error',
'mocha/no-skipped-tests': 'error',
'mocha/no-synchronous-tests': 'error',
'mocha/no-top-level-hooks': 'error',
'mocha/valid-suite-description': ['warn', /^[A-Z#]/],
// valid cases:
// it('should bla')
// it('[prefix] should boo')
// prettier-ignore
'mocha/valid-test-description': ['warn', /^(\[.+\] )?should/],
'import/no-cycle': 'warn',
// we use named export in utils
'import/prefer-default-export': 'off',
'import/no-cycle': 'warn',
// disable comma-dangle in functions
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
functions: 'never',
},
],
// allow `console.error` & `console.warning`
'no-console': ['error', { allow: ['warn', 'error'] }],
// `_id` comes from Mongo
'no-underscore-dangle': ['error', { allow: ['_id'] }],
// we use '_' placeholder, for example in array desctruction: [_, second] = arr
'no-unused-vars': ['error', { varsIgnorePattern: '^_+', argsIgnorePattern: '^_+' }],
'func-names': 'off',
},
settings: {
'import/resolver': {
node: {
moduleDirectory: ['node_modules', './src'],
},
},
},
};