@@ -40,16 +40,12 @@ tester.run('no-import-compiler-macros', rule, {
4040 filename : 'test.vue' ,
4141 code : `
4242 <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'
4644 </script>
4745 ` ,
4846 output : `
4947 <script setup>
50- import { computed } from 'vue'
51- import { ref } from '@vue/runtime-core'
52- import { watch } from '@vue/runtime-dom'
48+
5349 </script>
5450 ` ,
5551 errors : [
@@ -59,7 +55,34 @@ tester.run('no-import-compiler-macros', rule, {
5955 name : 'defineProps'
6056 } ,
6157 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
6386 } ,
6487 {
6588 messageId : 'noImportCompilerMacros' ,
@@ -72,46 +95,46 @@ tester.run('no-import-compiler-macros', rule, {
7295 {
7396 messageId : 'noImportCompilerMacros' ,
7497 data : {
75- name : 'withDefaults '
98+ name : 'defineExpose '
7699 } ,
77- line : 4 ,
78- column : 34
100+ line : 5 ,
101+ column : 16
79102 } ,
80103 {
81104 messageId : 'noImportCompilerMacros' ,
82105 data : {
83- name : 'defineExpose '
106+ name : 'withDefaults '
84107 } ,
85108 line : 5 ,
86- column : 16
109+ column : 37
87110 }
88111 ]
89112 } ,
90113 {
91114 filename : 'test.vue' ,
92115 code : `
93116 <script setup>
94- import { defineProps, withDefaults, ref } from 'vue'
117+ import { defineModel, defineOptions } from 'vue'
95118 </script>
96119 ` ,
97120 output : `
98121 <script setup>
99- import { withDefaults, ref } from 'vue'
122+ import { defineOptions } from 'vue'
100123 </script>
101124 ` ,
102125 errors : [
103126 {
104127 messageId : 'noImportCompilerMacros' ,
105128 data : {
106- name : 'defineProps '
129+ name : 'defineModel '
107130 } ,
108131 line : 3 ,
109132 column : 16
110133 } ,
111134 {
112135 messageId : 'noImportCompilerMacros' ,
113136 data : {
114- name : 'withDefaults '
137+ name : 'defineOptions '
115138 } ,
116139 line : 3 ,
117140 column : 29
@@ -122,12 +145,12 @@ tester.run('no-import-compiler-macros', rule, {
122145 filename : 'test.vue' ,
123146 code : `
124147 <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'
126149 </script>
127150 ` ,
128151 output : `
129152 <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'
131154 </script>
132155 ` ,
133156 languageOptions : {
@@ -139,7 +162,7 @@ tester.run('no-import-compiler-macros', rule, {
139162 {
140163 messageId : 'noImportCompilerMacros' ,
141164 data : {
142- name : 'defineProps '
165+ name : 'defineSlots '
143166 } ,
144167 line : 3 ,
145168 column : 31
0 commit comments