@@ -40,16 +40,12 @@ tester.run('no-import-compiler-macros', rule, {
40
40
filename : 'test.vue' ,
41
41
code : `
42
42
<script setup>
43
- import { computed, defineProps } from 'vue'
44
- import { defineEmits, ref, withDefaults } from '@vue/runtime-core'
45
- import { defineExpose, watch } from '@vue/runtime-dom'
43
+ import { defineProps } from 'vue'
46
44
</script>
47
45
` ,
48
46
output : `
49
47
<script setup>
50
- import { computed } from 'vue'
51
- import { ref } from '@vue/runtime-core'
52
- import { watch } from '@vue/runtime-dom'
48
+
53
49
</script>
54
50
` ,
55
51
errors : [
@@ -59,7 +55,34 @@ tester.run('no-import-compiler-macros', rule, {
59
55
name : 'defineProps'
60
56
} ,
61
57
line : 3 ,
62
- column : 26
58
+ column : 16
59
+ }
60
+ ]
61
+ } ,
62
+ {
63
+ filename : 'test.vue' ,
64
+ code : `
65
+ <script setup>
66
+ import { ref, defineProps } from 'vue'
67
+ import { defineEmits, computed } from '@vue/runtime-core'
68
+ import { defineExpose, watch, withDefaults } from '@vue/runtime-dom'
69
+ </script>
70
+ ` ,
71
+ output : `
72
+ <script setup>
73
+ import { ref } from 'vue'
74
+ import { computed } from '@vue/runtime-core'
75
+ import { watch } from '@vue/runtime-dom'
76
+ </script>
77
+ ` ,
78
+ errors : [
79
+ {
80
+ messageId : 'noImportCompilerMacros' ,
81
+ data : {
82
+ name : 'defineProps'
83
+ } ,
84
+ line : 3 ,
85
+ column : 21
63
86
} ,
64
87
{
65
88
messageId : 'noImportCompilerMacros' ,
@@ -72,46 +95,46 @@ tester.run('no-import-compiler-macros', rule, {
72
95
{
73
96
messageId : 'noImportCompilerMacros' ,
74
97
data : {
75
- name : 'withDefaults '
98
+ name : 'defineExpose '
76
99
} ,
77
- line : 4 ,
78
- column : 34
100
+ line : 5 ,
101
+ column : 16
79
102
} ,
80
103
{
81
104
messageId : 'noImportCompilerMacros' ,
82
105
data : {
83
- name : 'defineExpose '
106
+ name : 'withDefaults '
84
107
} ,
85
108
line : 5 ,
86
- column : 16
109
+ column : 37
87
110
}
88
111
]
89
112
} ,
90
113
{
91
114
filename : 'test.vue' ,
92
115
code : `
93
116
<script setup>
94
- import { defineProps, withDefaults, ref } from 'vue'
117
+ import { defineModel, defineOptions } from 'vue'
95
118
</script>
96
119
` ,
97
120
output : `
98
121
<script setup>
99
- import { withDefaults, ref } from 'vue'
122
+ import { defineOptions } from 'vue'
100
123
</script>
101
124
` ,
102
125
errors : [
103
126
{
104
127
messageId : 'noImportCompilerMacros' ,
105
128
data : {
106
- name : 'defineProps '
129
+ name : 'defineModel '
107
130
} ,
108
131
line : 3 ,
109
132
column : 16
110
133
} ,
111
134
{
112
135
messageId : 'noImportCompilerMacros' ,
113
136
data : {
114
- name : 'withDefaults '
137
+ name : 'defineOptions '
115
138
} ,
116
139
line : 3 ,
117
140
column : 29
@@ -122,12 +145,12 @@ tester.run('no-import-compiler-macros', rule, {
122
145
filename : 'test.vue' ,
123
146
code : `
124
147
<script setup lang="ts">
125
- import { ref as refFoo, defineProps as definePropsFoo , type computed } from '@vue/runtime-core'
148
+ import { ref as refFoo, defineSlots as defineSlotsFoo , type computed } from '@vue/runtime-core'
126
149
</script>
127
150
` ,
128
151
output : `
129
152
<script setup lang="ts">
130
- import { ref as refFoo, type computed } from '@vue/runtime-core'
153
+ import { ref as refFoo, type computed } from '@vue/runtime-core'
131
154
</script>
132
155
` ,
133
156
languageOptions : {
@@ -139,7 +162,7 @@ tester.run('no-import-compiler-macros', rule, {
139
162
{
140
163
messageId : 'noImportCompilerMacros' ,
141
164
data : {
142
- name : 'defineProps '
165
+ name : 'defineSlots '
143
166
} ,
144
167
line : 3 ,
145
168
column : 31
0 commit comments