-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
100 lines (97 loc) · 3.05 KB
/
index.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
module.exports = {
extends: [
'eslint:recommended',
],
rules: {
'strict': [2, 'never'],
// Best Practices
'block-scoped-var': 'error',
'callback-return': 'warn',
'comma-dangle': ['error', 'always-multiline'],
'curly': 'error',
'dot-location': ['error', 'property'],
'dot-notation': ['error', { allowPattern: '^[a-z]+(_[a-z]+)+$' }],
'eqeqeq': 'error',
'no-alert': 'error',
'no-caller': 'error',
'no-case-declarations': 'error',
'no-class-assign': 0,
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-debugger': 'warn',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-implicit-coercion': 'warn',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-loop-func': 'warn',
'no-multi-spaces': ['warn', { exceptions: { ImportDeclaration: true } }],
'no-multi-str': 'error',
'no-native-reassign': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-proto': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-unused-vars': 'error',
'no-useless-call': 'error',
'no-useless-escape': 'error',
// Stylistic Issues
'block-spacing': 'warn',
'brace-style': ['warn', '1tbs', { allowSingleLine: true }],
'camelcase': 'warn',
'comma-spacing': 'warn',
'comma-style': 'warn',
'computed-property-spacing': 'warn',
'eol-last': 'warn',
'indent': ['error', 2, {
'SwitchCase': 1,
'ignoredNodes': ['JSXElement', 'JSXAttribute', 'JSXSpreadAttribute']
}],
'jsx-quotes': ['error', 'prefer-double'],
'key-spacing': 'error',
'keyword-spacing': 'error',
'linebreak-style': 'error',
'lines-around-comment': ['warn', { allowBlockStart: true }],
'max-depth': ['warn', 4],
'max-len': ['warn', 120],
'max-nested-callbacks': ['error', 3],
'max-statements': ['warn', 200],
'no-lonely-if': 'warn',
'no-multiple-empty-lines': 'warn',
'no-spaced-func': 'warn',
'no-trailing-spaces': 'warn',
'no-unneeded-ternary': 'warn',
'no-whitespace-before-property': 'error',
'object-curly-spacing': ['warn', 'always'],
'one-var-declaration-per-line': 'warn',
'quotes': [2, 'single'],
'semi': ['error', 'always'],
'semi-spacing': 'warn',
'space-before-blocks': 'error',
'space-before-function-paren': ['warn', {
anonymous: 'always',
named: 'never'
}],
'space-in-parens': 'warn',
'space-infix-ops': 'warn',
'spaced-comment': 'warn',
// ECMAScript 6
'arrow-body-style': 'warn',
'arrow-spacing': 'warn',
'arrow-parens': ['warn', 'as-needed'],
'no-duplicate-imports': 'error',
'no-var': 'error',
'prefer-arrow-callback': 'warn',
'prefer-const': 'warn',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'warn',
'template-curly-spacing': 'warn',
},
};