-
Notifications
You must be signed in to change notification settings - Fork 58
/
.eslintrc.js
101 lines (91 loc) · 3.43 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
module.exports = {
extends: 'eslint:recommended',
env: {
node: true,
es6: true
},
parserOptions: {
ecmaVersion: 6
},
rules: {
// General
'indent': ['error', 4, { SwitchCase: 1 }],
'no-mixed-spaces-and-tabs': 'error',
'no-multi-spaces': 'error',
'no-trailing-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'eol-last': 'error',
'max-len': ['error', { code: 120, tabWidth: 4, ignoreUrls: true }],
// Codestyle
'one-var': ['error', { initialized: 'never', uninitialized: 'always' }],
'semi': ['error', 'always'],
'quotes': ['error', 'single', { avoidEscape: true }],
'quote-props': ['error', 'consistent-as-needed'],
'comma-style': ['error', 'last'],
'comma-dangle': 'error',
'brace-style': ['error', '1tbs'],
'no-lonely-if': 'error',
'no-else-return': 'error',
'operator-assignment': ['error', 'always'],
'operator-linebreak': ['error', 'before'],
// Codestyle: spaces
'no-spaced-func': 'error',
'keyword-spacing': ['error', { before: true, after: true, overrides: {} }],
'comma-spacing': 'error',
'key-spacing': 'error',
'semi-spacing': ['error', { before: false, after: true }],
'block-spacing': ['error', 'always'],
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': ['error', 'never'],
'spaced-comment': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'space-before-blocks': 'error',
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'padded-blocks': ['error', 'never'],
// Codestyle: newlines
'newline-after-var': 'error',
'newline-before-return': 'error',
'lines-around-directive': 'error',
// Codestyle: naming
'camelcase': ['error', { properties: 'never' }],
'new-cap': ['error', { newIsCap: true, capIsNew: true, capIsNewExceptions: ['Q', 'Cmd'] }],
'valid-jsdoc': ['error', {
requireParamDescription: false,
requireReturnDescription: false,
prefer: {
return: 'returns'
}
}],
// Errors
'no-console': 1,
'complexity': ['error', 12],
'no-use-before-define': ['error', 'nofunc'],
'no-dupe-keys': 'error',
'no-cond-assign': ['error', 'except-parens'],
'no-shadow': 'error',
'yoda': 'error',
'no-extra-bind': 'error',
// Node
'no-mixed-requires': ['error', true],
'callback-return': 'error',
'no-restricted-properties': ['error', {
object: 'console',
property: 'assert',
message: 'use require("assert")'
}],
'prefer-arrow-callback': 'error',
'arrow-parens': ['error', 'always'],
'arrow-spacing': ['error', { before: true, after: true }],
'generator-star-spacing': ['error', 'neither'],
'no-var': 'error',
'prefer-const': 'error',
'prefer-template': 'error',
'no-template-curly-in-string': 'error',
'computed-property-spacing': ['error', 'never'],
'template-curly-spacing': ['error', 'never'],
'object-shorthand': ['error', 'always'],
'no-useless-escape': 0
}
};