eslint-plugin-vuetify 2.1.0 → 2.2.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/README.md +4 -0
- package/lib/configs/base.js +2 -1
- package/lib/rules/no-deprecated-components.js +8 -8
- package/lib/rules/no-deprecated-events.js +2 -6
- package/lib/rules/no-deprecated-imports.js +29 -0
- package/lib/rules/no-deprecated-props.js +33 -44
- package/lib/rules/no-deprecated-slots.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# eslint-plugin-vuetify
|
|
2
2
|
|
|
3
|
+
This package is for migrating from Vuetify v2 to v3, use [eslint-plugin-vuetify@vuetify-2](https://www.npmjs.com/package/eslint-plugin-vuetify/v/vuetify-2) for v1 to v2.
|
|
4
|
+
|
|
3
5
|
<br>
|
|
4
6
|
|
|
5
7
|
<p align="center">Support the maintainer of this plugin:</p>
|
|
@@ -45,6 +47,7 @@ These rules will help you avoid deprecated components, props, and classes. They
|
|
|
45
47
|
- Prevent the use of events that have been removed from Vuetify ([`no-deprecated-events`])
|
|
46
48
|
- Prevent the use of classes that have been removed from Vuetify ([`no-deprecated-classes`])
|
|
47
49
|
- Prevent the use of the old theme class syntax ([`no-deprecated-colors`])
|
|
50
|
+
- Prevent the use of deprecated import paths ([`no-deprecated-imports`])
|
|
48
51
|
|
|
49
52
|
### Grid system
|
|
50
53
|
|
|
@@ -59,6 +62,7 @@ These rules are designed to help migrate to the new grid system in Vuetify v2. T
|
|
|
59
62
|
[`no-deprecated-events`]: ./docs/rules/no-deprecated-events.md
|
|
60
63
|
[`no-deprecated-classes`]: ./docs/rules/no-deprecated-classes.md
|
|
61
64
|
[`no-deprecated-colors`]: ./docs/rules/no-deprecated-colors.md
|
|
65
|
+
[`no-deprecated-imports`]: ./docs/rules/no-deprecated-imports.md
|
|
62
66
|
|
|
63
67
|
|
|
64
68
|
## 💪 Supporting Vuetify
|
package/lib/configs/base.js
CHANGED
|
@@ -11,6 +11,7 @@ module.exports = {
|
|
|
11
11
|
'vuetify/no-deprecated-components': 'error',
|
|
12
12
|
'vuetify/no-deprecated-events': 'error',
|
|
13
13
|
'vuetify/no-deprecated-props': 'error',
|
|
14
|
-
'vuetify/no-deprecated-slots': 'error'
|
|
14
|
+
'vuetify/no-deprecated-slots': 'error',
|
|
15
|
+
'vuetify/no-deprecated-imports': 'error'
|
|
15
16
|
}
|
|
16
17
|
};
|
|
@@ -20,26 +20,26 @@ const replacements = {
|
|
|
20
20
|
VListItemSubTitle: 'v-list-item-subtitle',
|
|
21
21
|
VListTileSubtitle: 'v-list-item-subtitle',
|
|
22
22
|
VContent: 'v-main',
|
|
23
|
-
VCalendar: false,
|
|
24
23
|
VData: false,
|
|
25
24
|
VListItemGroup: false,
|
|
26
|
-
VListItemAvatar:
|
|
25
|
+
VListItemAvatar: {
|
|
26
|
+
custom: '`v-list-item` with `avatar` props, or `v-avatar` in the list item append or prepend slot'
|
|
27
|
+
},
|
|
27
28
|
VListItemContent: false,
|
|
28
|
-
VListItemIcon:
|
|
29
|
+
VListItemIcon: {
|
|
30
|
+
custom: '`v-list-item` with `icon` props, or `v-icon` in the list item append or prepend slot'
|
|
31
|
+
},
|
|
29
32
|
VOverflowBtn: false,
|
|
30
33
|
VPicker: false,
|
|
31
34
|
VSimpleCheckbox: 'v-checkbox-btn',
|
|
32
|
-
VSparkline: false,
|
|
33
|
-
VSpeedDial: false,
|
|
34
35
|
VSubheader: {
|
|
35
|
-
custom: 'v-list-subheader or class="text-
|
|
36
|
+
custom: 'v-list-subheader or class="text-subtitle-2"'
|
|
36
37
|
},
|
|
37
38
|
VSimpleTable: 'v-table',
|
|
38
39
|
VTabsSlider: false,
|
|
39
40
|
VTabsItems: false,
|
|
40
41
|
VTabItem: false,
|
|
41
|
-
VTimePicker: false
|
|
42
|
-
VTreeview: false
|
|
42
|
+
VTimePicker: false
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
// ------------------------------------------------------------------------------
|
|
@@ -115,17 +115,13 @@ const replacements = {
|
|
|
115
115
|
VRangeSlider: {
|
|
116
116
|
...model,
|
|
117
117
|
change: false,
|
|
118
|
-
'update:error': false
|
|
119
|
-
start: false,
|
|
120
|
-
end: false
|
|
118
|
+
'update:error': false
|
|
121
119
|
},
|
|
122
120
|
VRating: model,
|
|
123
121
|
VSlider: {
|
|
124
122
|
...model,
|
|
125
123
|
change: false,
|
|
126
|
-
'update:error': false
|
|
127
|
-
start: false,
|
|
128
|
-
end: false
|
|
124
|
+
'update:error': false
|
|
129
125
|
},
|
|
130
126
|
VSlideGroup: {
|
|
131
127
|
change: 'update:modelValue',
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
meta: {
|
|
5
|
+
type: 'problem',
|
|
6
|
+
docs: {
|
|
7
|
+
description: 'disallow import from "vuetify/lib/util/colors", suggest "vuetify/util/colors" instead',
|
|
8
|
+
category: 'Best Practices',
|
|
9
|
+
recommended: false
|
|
10
|
+
},
|
|
11
|
+
fixable: 'code',
|
|
12
|
+
schema: []
|
|
13
|
+
},
|
|
14
|
+
create(context) {
|
|
15
|
+
return {
|
|
16
|
+
ImportDeclaration(node) {
|
|
17
|
+
if (node.source.value === 'vuetify/lib/util/colors') {
|
|
18
|
+
context.report({
|
|
19
|
+
node,
|
|
20
|
+
message: 'Import from "vuetify/lib/util/colors" is deprecated. Use "vuetify/util/colors" instead.',
|
|
21
|
+
fix(fixer) {
|
|
22
|
+
return fixer.replaceText(node.source, node.source.raw.replace('vuetify/lib/util/colors', 'vuetify/util/colors'));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -54,7 +54,6 @@ const inputs = {
|
|
|
54
54
|
},
|
|
55
55
|
fullWidth: false,
|
|
56
56
|
height: false,
|
|
57
|
-
hideSpinButtons: false,
|
|
58
57
|
loaderHeight: false,
|
|
59
58
|
outline: {
|
|
60
59
|
name: 'variant',
|
|
@@ -99,10 +98,8 @@ const select = {
|
|
|
99
98
|
itemText: 'item-title',
|
|
100
99
|
searchInput: 'search',
|
|
101
100
|
smallChips: false,
|
|
102
|
-
valueComparator: false,
|
|
103
101
|
filter: 'customFilter',
|
|
104
|
-
...inputs
|
|
105
|
-
dense: false
|
|
102
|
+
...inputs
|
|
106
103
|
};
|
|
107
104
|
const link = {
|
|
108
105
|
append: false,
|
|
@@ -127,21 +124,33 @@ const replacements = {
|
|
|
127
124
|
app: false,
|
|
128
125
|
clippedLeft: false,
|
|
129
126
|
clippedRight: false,
|
|
130
|
-
collapseOnScroll:
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
collapseOnScroll: {
|
|
128
|
+
name: 'scroll-behavior',
|
|
129
|
+
value: 'collapse'
|
|
130
|
+
},
|
|
131
|
+
elevateOnScroll: {
|
|
132
|
+
name: 'scroll-behavior',
|
|
133
|
+
value: 'elevate'
|
|
134
|
+
},
|
|
135
|
+
fadeImgOnScroll: {
|
|
136
|
+
name: 'scroll-behavior',
|
|
137
|
+
value: 'fade-image'
|
|
138
|
+
},
|
|
133
139
|
fixed: false,
|
|
134
|
-
hideOnScroll:
|
|
135
|
-
|
|
140
|
+
hideOnScroll: {
|
|
141
|
+
name: 'scroll-behavior',
|
|
142
|
+
value: 'hide'
|
|
143
|
+
},
|
|
144
|
+
invertedScroll: {
|
|
145
|
+
name: 'scroll-behavior',
|
|
146
|
+
value: 'inverted'
|
|
147
|
+
},
|
|
136
148
|
outlined: 'border',
|
|
137
149
|
prominent: false,
|
|
138
150
|
scrollOffScreen: false,
|
|
139
|
-
scrollTarget: false,
|
|
140
|
-
scrollThreshold: false,
|
|
141
151
|
shaped: false,
|
|
142
152
|
short: false,
|
|
143
153
|
shrinkOnScroll: false,
|
|
144
|
-
tile: false,
|
|
145
154
|
width: false,
|
|
146
155
|
...theme,
|
|
147
156
|
...size
|
|
@@ -173,10 +182,6 @@ const replacements = {
|
|
|
173
182
|
value: 'outlined'
|
|
174
183
|
},
|
|
175
184
|
shaped: false,
|
|
176
|
-
tile: {
|
|
177
|
-
name: 'rounded',
|
|
178
|
-
value: 0
|
|
179
|
-
},
|
|
180
185
|
transition: false,
|
|
181
186
|
...theme
|
|
182
187
|
},
|
|
@@ -217,7 +222,7 @@ const replacements = {
|
|
|
217
222
|
app: false,
|
|
218
223
|
iconColor: false,
|
|
219
224
|
mobileBreakPoint: false,
|
|
220
|
-
outlined:
|
|
225
|
+
outlined: 'border',
|
|
221
226
|
shaped: false,
|
|
222
227
|
value: false
|
|
223
228
|
},
|
|
@@ -286,7 +291,6 @@ const replacements = {
|
|
|
286
291
|
name: 'variant',
|
|
287
292
|
value: 'text'
|
|
288
293
|
},
|
|
289
|
-
tile: false,
|
|
290
294
|
top: {
|
|
291
295
|
name: 'location',
|
|
292
296
|
value: 'top'
|
|
@@ -304,10 +308,6 @@ const replacements = {
|
|
|
304
308
|
value: 'compact'
|
|
305
309
|
},
|
|
306
310
|
shaped: false,
|
|
307
|
-
tile: {
|
|
308
|
-
name: 'rounded',
|
|
309
|
-
value: 0
|
|
310
|
-
},
|
|
311
311
|
value: 'model-value',
|
|
312
312
|
valueComparator: false,
|
|
313
313
|
...theme
|
|
@@ -324,10 +324,6 @@ const replacements = {
|
|
|
324
324
|
value: 8
|
|
325
325
|
},
|
|
326
326
|
shaped: false,
|
|
327
|
-
tile: {
|
|
328
|
-
name: 'rounded',
|
|
329
|
-
value: 0
|
|
330
|
-
},
|
|
331
327
|
...link
|
|
332
328
|
},
|
|
333
329
|
VCarousel: {
|
|
@@ -457,10 +453,8 @@ const replacements = {
|
|
|
457
453
|
value: 'popout'
|
|
458
454
|
},
|
|
459
455
|
activeClass: 'selected-class',
|
|
460
|
-
flat: false,
|
|
461
456
|
focusable: false,
|
|
462
457
|
hover: false,
|
|
463
|
-
tile: false,
|
|
464
458
|
value: 'model-value',
|
|
465
459
|
valueComparator: false
|
|
466
460
|
},
|
|
@@ -528,7 +522,9 @@ const replacements = {
|
|
|
528
522
|
value: 'right'
|
|
529
523
|
},
|
|
530
524
|
rounded: false,
|
|
531
|
-
tile:
|
|
525
|
+
tile: {
|
|
526
|
+
custom: 'apply border-radius changes to the root element of the `v-menu`\'s content'
|
|
527
|
+
},
|
|
532
528
|
top: {
|
|
533
529
|
name: 'location',
|
|
534
530
|
value: 'top'
|
|
@@ -538,10 +534,9 @@ const replacements = {
|
|
|
538
534
|
},
|
|
539
535
|
VFooter: {
|
|
540
536
|
fixed: false,
|
|
541
|
-
outlined:
|
|
537
|
+
outlined: 'border',
|
|
542
538
|
padless: false,
|
|
543
539
|
shaped: false,
|
|
544
|
-
tile: false,
|
|
545
540
|
width: false,
|
|
546
541
|
...size
|
|
547
542
|
},
|
|
@@ -559,14 +554,13 @@ const replacements = {
|
|
|
559
554
|
disabled: false,
|
|
560
555
|
left: 'start',
|
|
561
556
|
right: 'end',
|
|
562
|
-
...sizes
|
|
557
|
+
...sizes,
|
|
558
|
+
...theme
|
|
563
559
|
},
|
|
564
560
|
VImg: {
|
|
565
561
|
contain: {
|
|
566
562
|
custom: 'cover'
|
|
567
563
|
},
|
|
568
|
-
contentClass: false,
|
|
569
|
-
position: false,
|
|
570
564
|
...theme
|
|
571
565
|
},
|
|
572
566
|
VItemGroup: {
|
|
@@ -587,7 +581,7 @@ const replacements = {
|
|
|
587
581
|
},
|
|
588
582
|
expand: false,
|
|
589
583
|
flat: false,
|
|
590
|
-
outlined:
|
|
584
|
+
outlined: 'border',
|
|
591
585
|
subheader: false,
|
|
592
586
|
threeLine: {
|
|
593
587
|
name: 'lines',
|
|
@@ -596,8 +590,7 @@ const replacements = {
|
|
|
596
590
|
twoLine: {
|
|
597
591
|
name: 'lines',
|
|
598
592
|
value: 'two'
|
|
599
|
-
}
|
|
600
|
-
tile: false
|
|
593
|
+
}
|
|
601
594
|
},
|
|
602
595
|
VListGroup: {
|
|
603
596
|
activeClass: false,
|
|
@@ -660,7 +653,6 @@ const replacements = {
|
|
|
660
653
|
},
|
|
661
654
|
VOverlay: {
|
|
662
655
|
color: 'scrim',
|
|
663
|
-
opacity: false,
|
|
664
656
|
value: 'model-value'
|
|
665
657
|
},
|
|
666
658
|
VPagination: {
|
|
@@ -742,9 +734,8 @@ const replacements = {
|
|
|
742
734
|
...sizes
|
|
743
735
|
},
|
|
744
736
|
VSheet: {
|
|
745
|
-
outlined:
|
|
746
|
-
shaped: false
|
|
747
|
-
tile: false
|
|
737
|
+
outlined: 'border',
|
|
738
|
+
shaped: false
|
|
748
739
|
},
|
|
749
740
|
VSlideGroup: {
|
|
750
741
|
activeClass: 'selected-class',
|
|
@@ -795,7 +786,6 @@ const replacements = {
|
|
|
795
786
|
},
|
|
796
787
|
shaped: false,
|
|
797
788
|
text: false,
|
|
798
|
-
tile: false,
|
|
799
789
|
top: {
|
|
800
790
|
name: 'location',
|
|
801
791
|
value: 'top'
|
|
@@ -864,12 +854,11 @@ const replacements = {
|
|
|
864
854
|
},
|
|
865
855
|
VToolbar: {
|
|
866
856
|
bottom: false,
|
|
867
|
-
outlined:
|
|
857
|
+
outlined: 'border',
|
|
868
858
|
prominent: false,
|
|
869
859
|
shaped: false,
|
|
870
860
|
short: false,
|
|
871
861
|
src: 'image',
|
|
872
|
-
tile: false,
|
|
873
862
|
width: false,
|
|
874
863
|
...size
|
|
875
864
|
},
|
|
@@ -104,18 +104,18 @@ const groups = [{
|
|
|
104
104
|
filter: token => token.value === ','
|
|
105
105
|
});
|
|
106
106
|
if (comma) {
|
|
107
|
-
yield fixer.removeRange([comma.
|
|
107
|
+
yield fixer.removeRange([comma.range[0], ref.prop.range[1]]);
|
|
108
108
|
} else {
|
|
109
|
-
yield fixer.removeRange([ref.prop.
|
|
109
|
+
yield fixer.removeRange([ref.prop.range[0] - 1, ref.prop.range[1]]);
|
|
110
110
|
}
|
|
111
111
|
} else {
|
|
112
112
|
const comma = template.getTokenAfter(ref.prop, {
|
|
113
113
|
filter: token => token.value === ','
|
|
114
114
|
});
|
|
115
115
|
if (comma) {
|
|
116
|
-
yield fixer.removeRange([ref.prop.
|
|
116
|
+
yield fixer.removeRange([ref.prop.range[0] - 1, comma.range[1]]);
|
|
117
117
|
} else {
|
|
118
|
-
yield fixer.removeRange([ref.prop.
|
|
118
|
+
yield fixer.removeRange([ref.prop.range[0] - 1, ref.prop.range[1]]);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
yield fixer.removeRange([ref.id.parent.parent.range[0] - 1, ref.id.parent.parent.range[1]]);
|