1
- /* eslint-disable quote-props */
2
-
3
- // eslint-disable-next-line @typescript-eslint/no-var-requires
4
- const path = require ( 'path' )
5
-
6
- // eslint-disable-next-line @typescript-eslint/no-var-requires
1
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
7
2
const INLINE_ELEMENTS = require ( 'eslint-plugin-vue/lib/utils/inline-non-void-elements.json' )
8
3
9
4
module . exports = {
10
5
root : true ,
11
6
12
7
parserOptions : {
13
- extraFileExtensions : [ '.vue' ] ,
8
+ extraFileExtensions : [ '.vue' , 'json' ] ,
14
9
parser : '@typescript-eslint/parser' ,
15
- project : path . resolve ( __dirname , './tsconfig.json' ) ,
10
+ project : './tsconfig.json' ,
16
11
tsconfigRootDir : __dirname ,
17
- ecmaVersion : 2020 , // Allows for the parsing of modern ECMAScript features
18
- sourceType : 'module' , // Allows for the use of imports
12
+ ecmaVersion : 'latest' ,
13
+ sourceType : 'module' ,
19
14
} ,
20
15
21
16
// Predefines global variables (e.g. browser env predefines 'window' variable)
@@ -25,89 +20,68 @@ module.exports = {
25
20
'vue/setup-compiler-macros' : true ,
26
21
} ,
27
22
28
- // Disable warnings for variables that are accessed but not defined in same file
29
- globals : {
30
- 'DEFINE' : 'readonly' ,
31
- } ,
32
-
33
- // Rules order is important, please avoid shuffling them
34
23
extends : [
35
24
'standard' ,
36
25
'eslint:recommended' ,
37
- 'plugin:@typescript-eslint/recommended' ,
38
- 'plugin:@typescript-eslint/recommended-requiring-type-checking' ,
26
+ 'plugin:@typescript-eslint/strict-type-checked' ,
39
27
'plugin:vue/vue3-recommended' ,
40
28
] ,
41
29
42
30
plugins : [
43
31
'@typescript-eslint' ,
32
+ 'import' ,
44
33
'vue' ,
45
34
] ,
46
35
47
- settings : {
48
- 'import/resolver' : {
49
- 'typescript' : {
50
- 'alwaysTryTypes' : true ,
51
- } ,
52
- } ,
53
- } ,
54
-
55
36
rules : {
56
- 'generator-star-spacing' : [ 'error' , 'before' ] ,
37
+ semi : 'off' ,
38
+ 'comma-dangle' : 'off' ,
39
+
57
40
'arrow-parens' : [ 'error' , 'always' ] ,
58
- 'one-var' : [ 'error' , 'never' ] ,
59
- 'no-void' : [ 'error' , {
60
- allowAsStatement : true ,
61
- } ] ,
41
+ 'eol-last' : [ 'error' , 'always' ] ,
42
+ 'generator-star-spacing' : [ 'error' , 'before' ] ,
43
+ 'no-trailing-spaces' : 'error' ,
62
44
'space-before-blocks' : [ 'error' , 'always' ] ,
63
-
64
- 'import/first' : 'off' ,
65
- 'import/named' : 'error' ,
66
- 'import/namespace' : 'error' ,
67
- 'import/default' : 'error' ,
68
- 'import/export' : 'error' ,
69
- 'import/extensions' : 'off' ,
70
- 'import/no-unresolved' : 'off' ,
71
- 'import/no-extraneous-dependencies' : 'off' ,
72
- 'import/order' : [ 'error' , {
73
- warnOnUnassignedImports : true ,
74
- alphabetize : {
75
- order : 'asc' ,
76
- caseInsensitive : false ,
45
+ 'space-before-function-paren' : [ 'error' , 'never' ] ,
46
+ indent : [ 'error' , 4 , {
47
+ SwitchCase : 1 ,
48
+ } ] ,
49
+ 'no-multi-spaces' : [ 'error' , {
50
+ exceptions : {
51
+ Property : true ,
52
+ VariableDeclarator : true ,
53
+ ImportDeclaration : false ,
77
54
} ,
78
- pathGroups : [
79
- {
80
- 'pattern' : '@/**' ,
81
- 'group' : 'parent' ,
82
- } ,
83
- ] ,
84
- groups : [
85
- 'builtin' , 'external' , 'parent' , 'sibling' , 'index' , 'object' , 'type' ,
86
- ] ,
55
+ ignoreEOLComments : true ,
87
56
} ] ,
88
-
89
- 'comma-dangle' : 'off' ,
90
- '@typescript-eslint/comma-dangle' : [ 'error' , 'always-multiline' ] ,
91
-
92
- 'space-before-function-paren' : [ 'error' , 'never' ] ,
93
- 'indent' : [ 'error' , 4 , {
94
- 'SwitchCase' : 1 ,
57
+ 'no-empty-pattern' : [ 'error' , {
58
+ allowObjectPatternsAsParameters : true ,
59
+ } ] ,
60
+ 'no-void' : [ 'error' , {
61
+ allowAsStatement : true ,
62
+ } ] ,
63
+ quotes : [ 'error' , 'single' , {
64
+ avoidEscape : true ,
65
+ allowTemplateLiterals : false ,
95
66
} ] ,
96
67
97
68
'vue/html-indent' : [ 'error' , 4 ] ,
98
69
'vue/max-attributes-per-line' : [ 'error' , {
99
70
singleline : 999 ,
100
71
multiline : 1 ,
101
72
} ] ,
102
-
103
- 'vue/singleline-html-element-content-newline' : [ 'error' , {
104
- 'ignores' : [ 'ExternalLink' , 'pre' , 'router-link' , ...INLINE_ELEMENTS ] ,
105
- } ] ,
106
-
107
73
'vue/component-tags-order' : [ 'error' , {
108
- 'order' : [ 'script' , 'template' , 'style' ] ,
74
+ order : [ 'script' , 'template' , 'style' ] ,
75
+ } ] ,
76
+ 'vue/singleline-html-element-content-newline' : [ 'error' , {
77
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
78
+ ignores : [ 'ExternalLink' , 'router-link' , ...INLINE_ELEMENTS ] ,
109
79
} ] ,
110
80
81
+ '@typescript-eslint/prefer-literal-enum-member' : 'off' ,
82
+ '@typescript-eslint/no-unnecessary-condition' : 'off' ,
83
+ '@typescript-eslint/semi' : [ 'error' , 'never' ] ,
84
+ '@typescript-eslint/comma-dangle' : [ 'error' , 'always-multiline' ] ,
111
85
'@typescript-eslint/type-annotation-spacing' : 'error' ,
112
86
'@typescript-eslint/restrict-template-expressions' : [ 'error' , {
113
87
allowNumber : true ,
@@ -119,14 +93,14 @@ module.exports = {
119
93
ignoreParameters : false ,
120
94
ignoreProperties : true ,
121
95
} ] ,
96
+ '@typescript-eslint/consistent-type-definitions' : [ 'error' , 'type' ] ,
122
97
'@typescript-eslint/consistent-type-assertions' : [ 'error' , {
123
98
assertionStyle : 'as' ,
124
99
objectLiteralTypeAssertions : 'never' ,
125
100
} ] ,
126
101
'@typescript-eslint/array-type' : [ 'error' , {
127
102
default : 'generic' ,
128
103
} ] ,
129
-
130
104
'@typescript-eslint/member-delimiter-style' : [ 'error' , {
131
105
multiline : {
132
106
delimiter : 'none' ,
@@ -137,52 +111,42 @@ module.exports = {
137
111
requireLast : false ,
138
112
} ,
139
113
} ] ,
140
-
141
- 'semi' : 'off' ,
142
- '@typescript-eslint/semi' : [ 'error' , 'never' ] ,
143
-
144
- 'no-debugger' : 'error' ,
145
-
146
- '@typescript-eslint/naming-convention' : [
147
- 'error' ,
114
+ '@typescript-eslint/strict-boolean-expressions' : [ 'error' , {
115
+ allowNullableBoolean : true ,
116
+ allowNullableString : true ,
117
+ } ] ,
118
+ '@typescript-eslint/naming-convention' : [ 'error' ,
148
119
{
149
- ' selector' : 'default' ,
150
- ' format' : null ,
151
- ' modifiers' : [ 'requiresQuotes' ] ,
120
+ selector : 'default' ,
121
+ format : null ,
122
+ modifiers : [ 'requiresQuotes' ] ,
152
123
} ,
153
124
{
154
- ' selector' : 'typeLike' ,
155
- ' format' : [ 'PascalCase' ] ,
125
+ selector : 'typeLike' ,
126
+ format : [ 'PascalCase' ] ,
156
127
} ,
157
128
{
158
- ' selector' : 'parameter' ,
159
- ' format' : [ 'strictCamelCase' ] ,
160
- ' leadingUnderscore' : 'allow' ,
129
+ selector : 'parameter' ,
130
+ format : [ 'strictCamelCase' ] ,
131
+ leadingUnderscore : 'allow' ,
161
132
} ,
162
133
{
163
- ' selector' : 'memberLike' ,
164
- ' modifiers' : [ 'private' ] ,
165
- ' format' : [ 'strictCamelCase' ] ,
166
- ' leadingUnderscore' : 'require' ,
134
+ selector : 'memberLike' ,
135
+ modifiers : [ 'private' ] ,
136
+ format : [ 'strictCamelCase' ] ,
137
+ leadingUnderscore : 'require' ,
167
138
} ,
168
139
{
169
- ' selector' : [
140
+ selector : [
170
141
'variableLike' ,
171
142
'method' ,
172
143
] ,
173
- ' filter' : {
174
- ' regex' : '^update:' ,
175
- ' match' : false ,
144
+ filter : {
145
+ regex : '^update:' ,
146
+ match : false ,
176
147
} ,
177
- ' format' : [ 'strictCamelCase' , 'UPPER_CASE' ] ,
148
+ format : [ 'strictCamelCase' , 'UPPER_CASE' ] ,
178
149
} ,
179
150
] ,
180
-
181
- '@typescript-eslint/strict-boolean-expressions' : [ 'error' , {
182
- allowNullableBoolean : true ,
183
- allowNullableString : true ,
184
- } ] ,
185
-
186
- '@typescript-eslint/consistent-type-definitions' : [ 'error' , 'type' ] ,
187
151
} ,
188
152
}
0 commit comments