@alexlit/config-eslint 40.0.1 → 41.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +4 -10
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/plugins/sort-class-members.js +138 -3
- package/plugins/typescript.js +24 -3
package/.eslintrc.js
CHANGED
|
@@ -21,6 +21,7 @@ module.exports = defineConfig({
|
|
|
21
21
|
'./plugins/compat',
|
|
22
22
|
// './plugins/decorator-position', // wait for eslint@8 support
|
|
23
23
|
'./plugins/eslint-comments',
|
|
24
|
+
'./plugins/etc',
|
|
24
25
|
'./plugins/ext',
|
|
25
26
|
'./plugins/filenames',
|
|
26
27
|
'./plugins/import',
|
|
@@ -41,7 +42,7 @@ module.exports = defineConfig({
|
|
|
41
42
|
'./plugins/security',
|
|
42
43
|
'./plugins/simple-import-sort',
|
|
43
44
|
'./plugins/sonar',
|
|
44
|
-
|
|
45
|
+
'./plugins/sort-class-members',
|
|
45
46
|
'./plugins/sort-destructure-keys',
|
|
46
47
|
'./plugins/sort-keys-fix',
|
|
47
48
|
'./plugins/spellcheck',
|
|
@@ -93,20 +94,13 @@ module.exports = defineConfig({
|
|
|
93
94
|
'global-require': 'off',
|
|
94
95
|
},
|
|
95
96
|
},
|
|
96
|
-
|
|
97
|
-
{
|
|
98
|
-
extends: [require.resolve('./plugins/etc')],
|
|
99
|
-
files: ['*.ts', '*.tsx'],
|
|
100
|
-
|
|
101
|
-
parserOptions: {
|
|
102
|
-
project: './tsconfig.json',
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
97
|
],
|
|
106
98
|
|
|
107
99
|
parserOptions: {
|
|
108
100
|
ecmaFeatures: { jsx: true },
|
|
101
|
+
extraFileExtensions: ['.vue'],
|
|
109
102
|
parser: '@typescript-eslint/parser',
|
|
103
|
+
project: './tsconfig.json',
|
|
110
104
|
},
|
|
111
105
|
|
|
112
106
|
root: true,
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [41.0.0](https://github.com/alex-lit/config-eslint/compare/v40.0.1...v41.0.0) (2022-01-13)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- **plugin:** add sort-class-members plugin
|
|
6
|
+
([32bce88](https://github.com/alex-lit/config-eslint/commit/32bce88e10cd3d4c26a9560a7fb13b6f2eb10d50))
|
|
7
|
+
|
|
1
8
|
## [40.0.1](https://github.com/alex-lit/config-eslint/compare/v40.0.0...v40.0.1) (2022-01-12)
|
|
2
9
|
|
|
3
10
|
# [40.0.0](https://github.com/alex-lit/config-eslint/compare/v39.0.0...v40.0.0) (2022-01-12)
|
package/package.json
CHANGED
|
@@ -20,6 +20,62 @@ module.exports = {
|
|
|
20
20
|
},
|
|
21
21
|
],
|
|
22
22
|
|
|
23
|
+
emits: [
|
|
24
|
+
{
|
|
25
|
+
name: '/emit[A-Z].*/',
|
|
26
|
+
sort: 'alphabetical',
|
|
27
|
+
type: 'method',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
injects: [
|
|
32
|
+
{
|
|
33
|
+
groupByDecorator: 'Inject',
|
|
34
|
+
sort: 'alphabetical',
|
|
35
|
+
type: 'property',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
groupByDecorator: 'InjectReactive',
|
|
39
|
+
sort: 'alphabetical',
|
|
40
|
+
type: 'property',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
|
|
44
|
+
props: [
|
|
45
|
+
{
|
|
46
|
+
groupByDecorator: 'Prop',
|
|
47
|
+
sort: 'alphabetical',
|
|
48
|
+
type: 'property',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
|
|
52
|
+
provides: [
|
|
53
|
+
{
|
|
54
|
+
groupByDecorator: 'Provide',
|
|
55
|
+
sort: 'alphabetical',
|
|
56
|
+
type: 'property',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
groupByDecorator: 'ProvideReactive',
|
|
60
|
+
sort: 'alphabetical',
|
|
61
|
+
type: 'property',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
|
|
65
|
+
'sorted-methods': [
|
|
66
|
+
{
|
|
67
|
+
sort: 'alphabetical',
|
|
68
|
+
type: 'method',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
|
|
72
|
+
'sorted-properties': [
|
|
73
|
+
{
|
|
74
|
+
sort: 'alphabetical',
|
|
75
|
+
type: 'property',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
|
|
23
79
|
'static-accessor-pairs': [
|
|
24
80
|
{
|
|
25
81
|
accessorPair: true,
|
|
@@ -88,6 +144,65 @@ module.exports = {
|
|
|
88
144
|
static: true,
|
|
89
145
|
},
|
|
90
146
|
],
|
|
147
|
+
|
|
148
|
+
'vue-activated': [{ name: 'activated', type: 'method' }],
|
|
149
|
+
|
|
150
|
+
'vue-before-create': [{ name: 'beforeCreate', type: 'method' }],
|
|
151
|
+
|
|
152
|
+
'vue-before-mount': [{ name: 'beforeMount', type: 'method' }],
|
|
153
|
+
|
|
154
|
+
'vue-before-unmount': [{ name: 'beforeUnmount', type: 'method' }],
|
|
155
|
+
|
|
156
|
+
'vue-before-update': [{ name: 'beforeUpdate', type: 'method' }],
|
|
157
|
+
|
|
158
|
+
'vue-created': [{ name: 'created', type: 'method' }],
|
|
159
|
+
|
|
160
|
+
'vue-deactivated': [{ name: 'deactivated', type: 'method' }],
|
|
161
|
+
|
|
162
|
+
'vue-error-captured': [{ name: 'errorCaptured', type: 'method' }],
|
|
163
|
+
|
|
164
|
+
'vue-mounted': [{ name: 'mounted', type: 'method' }],
|
|
165
|
+
|
|
166
|
+
'vue-render-tracked': [{ name: 'renderTracked', type: 'method' }],
|
|
167
|
+
|
|
168
|
+
'vue-render-triggered': [{ name: 'renderTriggered', type: 'method' }],
|
|
169
|
+
|
|
170
|
+
'vue-unmounted': [{ name: 'unmounted', type: 'method' }],
|
|
171
|
+
|
|
172
|
+
'vue-updated': [{ name: 'updated', type: 'method' }],
|
|
173
|
+
|
|
174
|
+
vuex: [
|
|
175
|
+
{
|
|
176
|
+
groupByDecorator: 'namespace',
|
|
177
|
+
sort: 'alphabetical',
|
|
178
|
+
type: 'property',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
groupByDecorator: 'State',
|
|
182
|
+
sort: 'alphabetical',
|
|
183
|
+
type: 'property',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
groupByDecorator: 'Getter',
|
|
187
|
+
sort: 'alphabetical',
|
|
188
|
+
type: 'property',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
groupByDecorator: 'Mutation',
|
|
192
|
+
sort: 'alphabetical',
|
|
193
|
+
type: 'property',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
groupByDecorator: 'Action',
|
|
197
|
+
sort: 'alphabetical',
|
|
198
|
+
type: 'property',
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
|
|
202
|
+
watches: [
|
|
203
|
+
{ name: '/handle[A-Z].*/', sort: 'alphabetical', type: 'method' },
|
|
204
|
+
{ name: '/on[A-Z].*/', sort: 'alphabetical', type: 'method' },
|
|
205
|
+
],
|
|
91
206
|
},
|
|
92
207
|
|
|
93
208
|
order: [
|
|
@@ -101,7 +216,12 @@ module.exports = {
|
|
|
101
216
|
'[static-async-methods]',
|
|
102
217
|
|
|
103
218
|
// properties
|
|
104
|
-
'[
|
|
219
|
+
'[vuex]',
|
|
220
|
+
'[injects]',
|
|
221
|
+
'[provides]',
|
|
222
|
+
'[props]',
|
|
223
|
+
'[emits]',
|
|
224
|
+
'[sorted-properties]',
|
|
105
225
|
'[arrow-function-properties]',
|
|
106
226
|
|
|
107
227
|
// constructor
|
|
@@ -112,11 +232,26 @@ module.exports = {
|
|
|
112
232
|
'[getters]',
|
|
113
233
|
'[setters]',
|
|
114
234
|
|
|
235
|
+
// vue lifecycle hooks
|
|
236
|
+
'[vue-before-create]',
|
|
237
|
+
'[vue-created]',
|
|
238
|
+
'[vue-before-mount]',
|
|
239
|
+
'[vue-mounted]',
|
|
240
|
+
'[vue-before-update]',
|
|
241
|
+
'[vue-updated]',
|
|
242
|
+
'[vue-before-unmount]',
|
|
243
|
+
'[vue-unmounted]',
|
|
244
|
+
'[vue-error-captured]',
|
|
245
|
+
'[vue-render-tracked]',
|
|
246
|
+
'[vue-render-triggered]',
|
|
247
|
+
'[vue-activated]',
|
|
248
|
+
|
|
115
249
|
// methods
|
|
116
|
-
'[
|
|
250
|
+
'[watches]',
|
|
251
|
+
'[sorted-methods]',
|
|
117
252
|
'[async-methods]',
|
|
118
253
|
|
|
119
|
-
// static
|
|
254
|
+
// private static
|
|
120
255
|
'[static-conventional-private-properties]',
|
|
121
256
|
'[static-conventional-private-methods]',
|
|
122
257
|
'[static-async-conventional-private-methods]',
|
package/plugins/typescript.js
CHANGED
|
@@ -36,8 +36,9 @@ module.exports = {
|
|
|
36
36
|
|
|
37
37
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
38
38
|
|
|
39
|
+
// delegate to sort-class-members plugin
|
|
39
40
|
'@typescript-eslint/member-ordering': [
|
|
40
|
-
'
|
|
41
|
+
'off',
|
|
41
42
|
{
|
|
42
43
|
default: {
|
|
43
44
|
memberTypes: [
|
|
@@ -120,7 +121,7 @@ module.exports = {
|
|
|
120
121
|
'@typescript-eslint/naming-convention': [
|
|
121
122
|
'error',
|
|
122
123
|
|
|
123
|
-
// ESLint's
|
|
124
|
+
// ESLint's camelCase conventions
|
|
124
125
|
{
|
|
125
126
|
format: ['camelCase'],
|
|
126
127
|
selector: 'default',
|
|
@@ -171,7 +172,7 @@ module.exports = {
|
|
|
171
172
|
|
|
172
173
|
// parameter
|
|
173
174
|
{
|
|
174
|
-
format: ['camelCase', 'PascalCase'],
|
|
175
|
+
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
175
176
|
modifiers: ['destructured'],
|
|
176
177
|
selector: 'parameter',
|
|
177
178
|
},
|
|
@@ -188,6 +189,26 @@ module.exports = {
|
|
|
188
189
|
modifiers: ['destructured'],
|
|
189
190
|
selector: 'variable',
|
|
190
191
|
},
|
|
192
|
+
|
|
193
|
+
{
|
|
194
|
+
format: ['PascalCase'],
|
|
195
|
+
|
|
196
|
+
prefix: [
|
|
197
|
+
'are',
|
|
198
|
+
'can',
|
|
199
|
+
'did',
|
|
200
|
+
'does',
|
|
201
|
+
'has',
|
|
202
|
+
'is',
|
|
203
|
+
'may',
|
|
204
|
+
'must',
|
|
205
|
+
'should',
|
|
206
|
+
'will',
|
|
207
|
+
],
|
|
208
|
+
|
|
209
|
+
selector: ['variable', 'parameter', /* 'property', */ 'accessor'],
|
|
210
|
+
types: ['boolean'],
|
|
211
|
+
},
|
|
191
212
|
],
|
|
192
213
|
|
|
193
214
|
'@typescript-eslint/no-explicit-any': 'off',
|