This repository has been archived by the owner on Jan 11, 2018. It is now read-only.
/
.eslintrc.js
95 lines (83 loc) · 2.51 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
module.exports = {
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
plugins: [
'import',
'unicorn',
],
extends: ['airbnb-base', 'plugin:unicorn/recommended'],
rules: {
strict: 'off',
'no-unused-vars': ['warn', { ignoreRestSiblings: false }],
semi: ['error', 'never'],
'no-confusing-arrow': 'off',
'object-property-newline': 'off',
'object-curly-newline': 'off',
'object-curly-spacing': 'off',
'arrow-parens': ['warn', 'always'],
'id-match': ['error', '^(([A-Za-z0-9]+){2,})|([A-Z][A-Z_0-9]+)$', {
properties: false,
onlyDeclarations: true,
}],
'no-magic-numbers': ['warn', {
ignore: [1, 0, -1],
ignoreArrayIndexes: true,
enforceConst: true,
detectObjects: false,
}],
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
functions: 'ignore',
}],
'operator-linebreak': ['error', 'after', {
overrides: {
'?': 'before',
':': 'before',
'&&': 'before',
'+': 'before',
'||': 'before',
} },
],
'brace-style': ['error', 'stroustrup'],
'quote-props': ['error', 'as-needed'],
'no-plusplus': 'off',
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'implicit-arrow-linebreak': ['error', 'beside'],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
],
'no-await-in-loop': 'off',
'no-restricted-syntax': 'off',
'import/no-unresolved': 'off',
'import/extensions': ['error', 'never',
[
'json', 'json5',
'less', 'css', 'scss', 'sass', 'styl',
'jpeg', 'jpg', 'png', 'svg', 'bmp', 'gif',
].reduce((obj, ext) => Object.assign(obj, { [ext]: 'always' }), {}),
],
'import/order': ['warn', {
groups: [
['builtin', 'external'],
['internal', 'parent'],
['sibling', 'index'],
],
'newlines-between': 'ignore',
}],
'import/newline-after-import': ['warn', { count: 2 }],
'import/prefer-default-export': 'off',
'import/no-named-as-default': 'off',
'unicorn/catch-error-name': ['error', { name: 'error' }],
'unicorn/no-fn-reference-in-iterator': 'off',
'unicorn/import-index': 'off',
},
}