-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
70 lines (70 loc) · 2.42 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
module.exports = {
extends: [
'plugin:json/recommended',
'plugin:eslint-comments/recommended',
'plugin:node/recommended',
'plugin:security/recommended',
'prettier',
'plugin:prettier/recommended',
],
parserOptions: {
sourceType: 'module',
},
plugins: ['promise', 'eslint-comments', 'json', 'async-await', 'security', 'prettier'],
rules: {
'no-var': 'error',
'async-await/space-after-async': 2,
'async-await/space-after-await': 2,
'block-spacing': ['error', 'always'],
'lines-around-comment': [0],
'lines-between-class-members': ['error', 'always'],
'max-lines': ['error', { max: 300, skipBlankLines: true, skipComments: true }],
'max-nested-callbacks': [2, 3],
'max-params': ['error', 4],
'newline-per-chained-call': ['off'],
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-mixed-spaces-and-tabs': ['error'],
'no-multi-spaces': ['error'],
'no-multiple-empty-lines': ['error'],
'no-spaced-func': ['error'],
'no-whitespace-before-property': ['error'],
'prettier/prettier': 'error',
'space-before-blocks': ['error', 'always'],
'spaced-comment': ['error', 'always', { markers: ['/'] }],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: 'const', next: 'return' },
// { blankLine: 'always', prev: '*', next: 'const' },
{ blankLine: 'always', prev: 'function', next: '*' },
{ blankLine: 'always', prev: '*', next: 'function' },
{ blankLine: 'always', prev: 'if', next: '*' },
{ blankLine: 'always', prev: '*', next: 'if' },
{ blankLine: 'always', prev: 'for', next: '*' },
{ blankLine: 'always', prev: '*', next: 'for' },
{ blankLine: 'always', prev: 'switch', next: '*' },
{ blankLine: 'always', prev: '*', next: 'switch' },
{ blankLine: 'always', prev: 'try', next: '*' },
{ blankLine: 'always', prev: '*', next: 'try' },
{ blankLine: 'always', prev: 'export', next: '*' },
{ blankLine: 'always', prev: '*', next: 'export' },
],
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'styled-components',
message: 'Please import from styled-components/macro.',
},
],
patterns: ['!styled-components/macro'],
},
],
'eslint-comments/disable-enable-pair': [
'error',
{
allowWholeFile: true,
},
],
},
};