@@ -92,20 +92,62 @@ ruleTester.run('no-export-in-script-setup', rule, {
9292 export * from 'foo'
9393 export default {}
9494 export class A {}
95+ export const test = '123'
96+ export function foo() {}
97+ const a = 1
98+ export { a }
99+ export { fao } from 'bar'
95100 </script>
96101 ` ,
97102 errors : [
98103 {
99104 message : '`<script setup>` cannot contain ES module exports.' ,
100- line : 3
105+ line : 3 ,
106+ endLine : 3 ,
107+ column : 7 ,
108+ endColumn : 26
101109 } ,
102110 {
103111 message : '`<script setup>` cannot contain ES module exports.' ,
104- line : 4
112+ line : 4 ,
113+ endLine : 4 ,
114+ column : 7 ,
115+ endColumn : 24
105116 } ,
106117 {
107118 message : '`<script setup>` cannot contain ES module exports.' ,
108- line : 5
119+ line : 5 ,
120+ endLine : 5 ,
121+ column : 7 ,
122+ endColumn : 13
123+ } ,
124+ {
125+ message : '`<script setup>` cannot contain ES module exports.' ,
126+ line : 6 ,
127+ endLine : 6 ,
128+ column : 7 ,
129+ endColumn : 13
130+ } ,
131+ {
132+ message : '`<script setup>` cannot contain ES module exports.' ,
133+ line : 7 ,
134+ endLine : 7 ,
135+ column : 7 ,
136+ endColumn : 13
137+ } ,
138+ {
139+ message : '`<script setup>` cannot contain ES module exports.' ,
140+ line : 9 ,
141+ endLine : 9 ,
142+ column : 7 ,
143+ endColumn : 19
144+ } ,
145+ {
146+ message : '`<script setup>` cannot contain ES module exports.' ,
147+ line : 10 ,
148+ endLine : 10 ,
149+ column : 7 ,
150+ endColumn : 32
109151 }
110152 ]
111153 } ,
@@ -124,15 +166,24 @@ ruleTester.run('no-export-in-script-setup', rule, {
124166 errors : [
125167 {
126168 message : '`<script setup>` cannot contain ES module exports.' ,
127- line : 6
169+ line : 6 ,
170+ endLine : 6 ,
171+ column : 7 ,
172+ endColumn : 26
128173 } ,
129174 {
130175 message : '`<script setup>` cannot contain ES module exports.' ,
131- line : 7
176+ line : 7 ,
177+ endLine : 7 ,
178+ column : 7 ,
179+ endColumn : 24
132180 } ,
133181 {
134182 message : '`<script setup>` cannot contain ES module exports.' ,
135- line : 8
183+ line : 8 ,
184+ endLine : 8 ,
185+ column : 7 ,
186+ endColumn : 13
136187 }
137188 ]
138189 } ,
@@ -154,15 +205,24 @@ ruleTester.run('no-export-in-script-setup', rule, {
154205 errors : [
155206 {
156207 message : '`<script setup>` cannot contain ES module exports.' ,
157- line : 3
208+ line : 3 ,
209+ endLine : 3 ,
210+ column : 7 ,
211+ endColumn : 13
158212 } ,
159213 {
160214 message : '`<script setup>` cannot contain ES module exports.' ,
161- line : 4
215+ line : 4 ,
216+ endLine : 4 ,
217+ column : 7 ,
218+ endColumn : 13
162219 } ,
163220 {
164221 message : '`<script setup>` cannot contain ES module exports.' ,
165- line : 5
222+ line : 5 ,
223+ endLine : 5 ,
224+ column : 7 ,
225+ endColumn : 16
166226 }
167227 ]
168228 }
0 commit comments