-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
67 lines (67 loc) · 2.28 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
module.exports = {
// So parent files don't get applied
root: true,
env: {
es6: true,
browser: true,
node: true,
},
extends: 'airbnb',
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 7,
sourceType: 'module',
},
plugins: [
'babel',
'mocha',
'flowtype',
'promise',
],
rules: {
'array-bracket-spacing': 'off', // use babel plugin rule
'arrow-body-style': 'off',
'arrow-parens': ['error', 'always'],
'consistent-this': ['error', 'self'],
'func-names': 'off',
'newline-per-chained-call': 'off',
'no-console': 'error', // airbnb have on warning
'no-nested-ternary': 'off',
'no-prototype-builtins': 'off',
'no-restricted-syntax': 'off',
'no-return-assign': 'off',
'no-underscore-dangle': ['error', { allow: ['__vrtest__'] }],
'no-use-before-define': ['error', { functions: false, classes: true }],
'object-curly-spacing': 'off', // use babel plugin rule
'operator-linebreak': ['error', 'after'],
'quotes': ['error', 'single', 'avoid-escape'],
'babel/object-curly-spacing': ['error', 'always'],
'babel/array-bracket-spacing': ['error', 'never'],
'import/no-unresolved': 'off',
'import/no-named-as-default': 'off',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'error',
'mocha/no-global-tests': 'error',
'mocha/no-pending-tests': 'error',
'mocha/no-skipped-tests': 'error',
'flowtype/define-flow-type': 1,
'flowtype/require-valid-file-annotation': ['error', 'always'],
'flowtype/require-parameter-type': ['warn', { excludeArrowFunctions: true }],
'flowtype/require-return-type': ['warn', 'always', { excludeArrowFunctions: true }],
'flowtype/semi': ['error', 'always'],
'flowtype/space-after-type-colon': 'error',
'flowtype/space-before-type-colon': 'error',
'promise/always-return': 'error',
'promise/no-return-wrap': 'error',
'promise/param-names': 'error',
'promise/catch-or-return': 'error',
'promise/no-native': 'off',
'promise/no-nesting': 'warn',
'promise/no-promise-in-callback': 'warn',
'promise/no-callback-in-promise': 'off',
'promise/avoid-new': 'off',
},
};