1
1
module . exports = {
2
2
env : {
3
3
browser : true ,
4
- node : true ,
5
4
} ,
6
5
extends : [
7
6
'airbnb-base' ,
8
7
'eslint:recommended' ,
9
- 'plugin:vue/essential' ,
10
- ] ,
11
- globals : {
12
- socket : true ,
13
- PDFObject : true ,
14
- } ,
15
- overrides : [
16
- {
17
- files : [
18
- '**/*.spec.{j,t}s?(x)' ,
19
- ] ,
20
- env : {
21
- jest : true ,
22
- } ,
23
- } ,
8
+ 'plugin:vue/recommended' ,
24
9
] ,
25
10
parser : 'vue-eslint-parser' ,
26
11
parserOptions : {
27
- parser : '@babel/eslint-parser' ,
12
+ ecmaFeatures : {
13
+ jsx : true ,
14
+ } ,
28
15
ecmaVersion : 12 ,
16
+ parser : '@babel/eslint-parser' ,
17
+ requireConfigFile : false ,
29
18
sourceType : 'module' ,
30
19
} ,
31
20
plugins : [
@@ -39,43 +28,54 @@ module.exports = {
39
28
} ,
40
29
} ,
41
30
rules : {
31
+ 'arrow-spacing' : [ 'error' , { after : true , before : true } ] ,
42
32
'brace-style' : [ 'error' , 'stroustrup' ] ,
33
+ 'comma-dangle' : [ 'error' , 'always-multiline' ] ,
43
34
'default-case' : [
44
35
'error' , {
45
36
commentPattern : '^skip\\sdefault' ,
46
37
} ,
47
38
] ,
48
39
'func-names' : [ 'error' , 'never' ] ,
49
40
'function-paren-newline' : 0 ,
50
- 'import/no-self-import' : 0 ,
51
- 'import/no-extraneous-dependencies' : 0 ,
52
41
'implicit-arrow-linebreak' : [ 'warn' , 'beside' ] ,
42
+ 'import/no-extraneous-dependencies' : [
43
+ 'error' ,
44
+ {
45
+ devDependencies : [
46
+ '**/vite.*.js' ,
47
+ ] ,
48
+ } ,
49
+ ] ,
50
+ 'import/no-self-import' : 0 ,
51
+ 'import/prefer-default-export' : 0 ,
53
52
indent : [ 2 , 'tab' , { SwitchCase : 1 } ] ,
54
- 'no-tabs' : [ 0 , { allowIndentationTabs : true } ] ,
55
53
'linebreak-style' : 0 ,
56
54
'max-len' : 0 ,
57
- 'no-else-return' : [ 'error' , { allowElseIf : true } ] ,
58
- 'no-console' : [ 'warn' , { allow : [ 'warn' , 'error' , 'info' ] } ] ,
55
+
56
+ 'no-console' : [ 'warn' , { allow : [ 'warn' , 'error' ] } ] ,
59
57
'no-debugger' : 0 ,
58
+ 'no-else-return' : [ 'error' , { allowElseIf : true } ] ,
59
+ 'no-multiple-empty-lines' : [ 'error' , { max : 2 , maxEOF : 0 } ] ,
60
60
'no-new' : 0 ,
61
- 'no-unused-vars' : 1 ,
62
- 'no-use-before-define' : 0 ,
63
- 'no-useless-escape' : 0 ,
64
61
'no-param-reassign' : [
65
62
'error' , {
63
+ ignorePropertyModificationsFor : [ 'Vue' , 'field' , 'model' , 'el' , 'item' , 'state' ] ,
66
64
props : true ,
67
- ignorePropertyModificationsFor : [ 'field' , 'model' , 'el' , 'item' , 'state' , 'Vue' , 'vue' ] ,
68
65
} ,
69
66
] ,
67
+ 'no-plusplus' : [
68
+ 'error' , { allowForLoopAfterthoughts : true } ,
69
+ ] ,
70
+ 'no-tabs' : [ 0 , { allowIndentationTabs : true } ] ,
70
71
'no-underscore-dangle' : [
71
72
'error' , {
72
- allow : [ '_data' ] ,
73
+ allow : [ '_data' , '__dirname' , '__filename' ] ,
73
74
allowAfterThis : true ,
74
75
} ,
75
76
] ,
76
- 'no-plusplus' : [
77
- 'error' , { allowForLoopAfterthoughts : true } ,
78
- ] ,
77
+ 'no-unused-vars' : 1 ,
78
+ 'no-useless-escape' : 0 ,
79
79
'object-curly-newline' : [ 'error' , {
80
80
ObjectPattern : { multiline : false } ,
81
81
} ] ,
@@ -89,17 +89,99 @@ module.exports = {
89
89
enforceForRenamedProperties : false ,
90
90
} ,
91
91
] ,
92
+ quotes : [ 'error' , 'single' , { avoidEscape : true } ] ,
93
+ semi : [ 'error' , 'always' ] ,
94
+ 'sort-imports' : [ 'error' , {
95
+ allowSeparatedGroups : false ,
96
+ ignoreCase : true ,
97
+ ignoreDeclarationSort : true ,
98
+ ignoreMemberSort : false ,
99
+ memberSyntaxSortOrder : [ 'none' , 'single' , 'all' , 'multiple' ] ,
100
+ } ] ,
92
101
'space-before-function-paren' : [ 'error' , {
93
102
anonymous : 'never' ,
94
- named : 'never' ,
95
103
asyncArrow : 'never' ,
104
+ named : 'never' ,
105
+ } ] ,
106
+ 'vue/attributes-order' : [ 'error' , {
107
+ alphabetical : true ,
108
+ order : [
109
+ 'DEFINITION' ,
110
+ 'LIST_RENDERING' ,
111
+ 'CONDITIONALS' ,
112
+ 'RENDER_MODIFIERS' ,
113
+ 'GLOBAL' ,
114
+ [ 'UNIQUE' , 'SLOT' ] ,
115
+ 'TWO_WAY_BINDING' ,
116
+ 'OTHER_DIRECTIVES' ,
117
+ 'OTHER_ATTR' ,
118
+ 'EVENTS' ,
119
+ 'CONTENT' ,
120
+ ] ,
121
+ } ] ,
122
+ 'vue/component-tags-order' : [ 'error' , {
123
+ order : [ 'template' , 'script' , 'style' ] ,
96
124
} ] ,
97
125
'vue/html-closing-bracket-newline' : 0 ,
126
+ 'vue/html-comment-content-spacing' : [ 'error' ,
127
+ 'always' ,
128
+ ] ,
98
129
'vue/html-indent' : 0 ,
99
130
'vue/html-self-closing' : 0 ,
100
131
'vue/max-attributes-per-line' : 0 ,
132
+ 'vue/multi-word-component-names' : 0 ,
101
133
'vue/no-template-shadow' : 0 ,
102
134
'vue/no-v-html' : 0 ,
135
+ 'vue/no-v-text-v-html-on-component' : 0 ,
136
+ 'vue/order-in-components' : [ 'error' , {
137
+ order : [
138
+ 'el' ,
139
+ 'name' ,
140
+ 'key' ,
141
+ 'parent' ,
142
+ 'functional' ,
143
+ [ 'delimiters' , 'comments' ] ,
144
+ [ 'components' , 'directives' , 'filters' ] ,
145
+ 'extends' ,
146
+ 'mixins' ,
147
+ [ 'provide' , 'inject' ] ,
148
+ 'ROUTER_GUARDS' ,
149
+ 'layout' ,
150
+ 'middleware' ,
151
+ 'validate' ,
152
+ 'scrollToTop' ,
153
+ 'transition' ,
154
+ 'loading' ,
155
+ 'inheritAttrs' ,
156
+ 'model' ,
157
+ [ 'props' , 'propsData' ] ,
158
+ 'emits' ,
159
+ 'setup' ,
160
+ 'asyncData' ,
161
+ 'data' ,
162
+ 'fetch' ,
163
+ 'head' ,
164
+ 'computed' ,
165
+ 'watch' ,
166
+ 'watchQuery' ,
167
+ 'beforeCreate' ,
168
+ 'created' ,
169
+ 'beforeMount' ,
170
+ 'mounted' ,
171
+ 'beforeUpdate' ,
172
+ 'updated' ,
173
+ 'activated' ,
174
+ 'deactivated' ,
175
+ 'beforeDestroy' ,
176
+ 'destroyed' ,
177
+ 'errorCaptured' , // for Vue.js 2.5.0+
178
+ 'methods' ,
179
+ [ 'template' , 'render' ] ,
180
+ 'renderError' ,
181
+ ] ,
182
+ } ] ,
183
+ 'vue/padding-line-between-blocks' : 1 ,
184
+ 'vue/require-name-property' : 1 ,
103
185
'vue/singleline-html-element-content-newline' : 0 ,
104
186
} ,
105
187
} ;
0 commit comments