-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
122 lines (121 loc) · 4.7 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root : true,
// File parser
parser : 'vue-eslint-parser',
parserOptions : {
parser : 'babel-eslint',
'ecmaVersion' : 2017,
// With import/export syntax
'sourceType' : 'module',
},
env : {
browser : true,
es6 : true,
'jest/globals' : true,
node : true,
},
extends : [
// https://github.com/jest-community/eslint-plugin-jest/blob/master/src/index.js?#L19-#L37
'plugin:jest/recommended',
// https://github.com/jest-community/eslint-plugin-jest/blob/master/src/index.js?#L38-#L46
'plugin:jest/style',
// https://github.com/standard/eslint-config-standard/blob/ddd325066548a9e94b31fe2c8fa968ae5a49edfb/eslintrc.json
'@vue/standard',
// https://github.com/vuejs/eslint-plugin-vue/blob/9fdf8e030c880e99f9bfa63fe10c3408961ee256/lib/configs/recommended.js
'plugin:vue/recommended',
],
// required to lint *.vue files
plugins : [
'jest',
'vue',
],
// add your custom rules here
rules : {
'comma-dangle' : [ 'error', 'always-multiline' ],
// allow async-await
'generator-star-spacing' : 'off',
'indent' : [ 'warn', 4 ],
'key-spacing' : [
'error',
{
'beforeColon' : true,
'afterColon' : true,
'mode' : 'minimum',
'align' : {
'beforeColon' : true,
'afterColon' : true,
'on' : 'colon',
'mode' : 'minimum',
},
},
],
'keyword-spacing' : [
'error',
{
'overrides' : {
'catch' : { 'after' : false },
},
},
],
'no-console' : process.env.NODE_ENV === 'production' ? 'error' : 'off',
// allow debugger during development
'no-debugger' : process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-multi-spaces' : 'off',
// https://github.com/babel/babel-eslint/issues/517
'no-use-before-define' : 'off',
'one-var' : [ 'error', { var : 'always' } ],
// Always terminate statements with semi-colons
'semi' : [ 'error', 'always' ],
'space-before-function-paren' : [
'error',
{
'anonymous' : 'always',
'named' : 'never',
'asyncArrow' : 'always',
},
],
'space-in-parens' : [ 'error', 'always' ],
'space-unary-ops' : [
'error',
{
'words' : true,
'nonwords' : false,
'overrides' : {
'!' : true,
},
},
],
'standard/computed-property-even-spacing' : [ 'error', 'always' ],
'template-curly-spacing' : [ 'error', 'always' ],
'vue/attributes-order' : 'error',
'vue/html-end-tags' : 'error',
'vue/html-indent' : [
'error', 4, {
'attribute' : 1,
'closeBracket' : 0,
'alignAttributesVertically' : true,
'ignores' : [],
}
],
'vue/html-self-closing' : [
'error', {
'html' : {
'void' : 'never',
'normal' : 'never',
'component' : 'always',
},
'svg' : 'always',
'math' : 'always',
}
],
'vue/html-quotes' : 'error',
'vue/max-attributes-per-line' : 'error',
'vue/mustache-interpolation-spacing' : 'error',
'vue/name-property-casing' : 'error',
'vue/require-default-prop' : 'error',
'vue/require-prop-types' : 'error',
'vue/v-bind-style' : 'error',
'vue/v-on-style' : 'error',
},
};