@@ -92,20 +92,62 @@ ruleTester.run('no-export-in-script-setup', rule, {
92
92
export * from 'foo'
93
93
export default {}
94
94
export class A {}
95
+ export const test = '123'
96
+ export function foo() {}
97
+ const a = 1
98
+ export { a }
99
+ export { fao } from 'bar'
95
100
</script>
96
101
` ,
97
102
errors : [
98
103
{
99
104
message : '`<script setup>` cannot contain ES module exports.' ,
100
- line : 3
105
+ line : 3 ,
106
+ endLine : 3 ,
107
+ column : 7 ,
108
+ endColumn : 26
101
109
} ,
102
110
{
103
111
message : '`<script setup>` cannot contain ES module exports.' ,
104
- line : 4
112
+ line : 4 ,
113
+ endLine : 4 ,
114
+ column : 7 ,
115
+ endColumn : 24
105
116
} ,
106
117
{
107
118
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
109
151
}
110
152
]
111
153
} ,
@@ -124,15 +166,24 @@ ruleTester.run('no-export-in-script-setup', rule, {
124
166
errors : [
125
167
{
126
168
message : '`<script setup>` cannot contain ES module exports.' ,
127
- line : 6
169
+ line : 6 ,
170
+ endLine : 6 ,
171
+ column : 7 ,
172
+ endColumn : 26
128
173
} ,
129
174
{
130
175
message : '`<script setup>` cannot contain ES module exports.' ,
131
- line : 7
176
+ line : 7 ,
177
+ endLine : 7 ,
178
+ column : 7 ,
179
+ endColumn : 24
132
180
} ,
133
181
{
134
182
message : '`<script setup>` cannot contain ES module exports.' ,
135
- line : 8
183
+ line : 8 ,
184
+ endLine : 8 ,
185
+ column : 7 ,
186
+ endColumn : 13
136
187
}
137
188
]
138
189
} ,
@@ -154,15 +205,24 @@ ruleTester.run('no-export-in-script-setup', rule, {
154
205
errors : [
155
206
{
156
207
message : '`<script setup>` cannot contain ES module exports.' ,
157
- line : 3
208
+ line : 3 ,
209
+ endLine : 3 ,
210
+ column : 7 ,
211
+ endColumn : 13
158
212
} ,
159
213
{
160
214
message : '`<script setup>` cannot contain ES module exports.' ,
161
- line : 4
215
+ line : 4 ,
216
+ endLine : 4 ,
217
+ column : 7 ,
218
+ endColumn : 13
162
219
} ,
163
220
{
164
221
message : '`<script setup>` cannot contain ES module exports.' ,
165
- line : 5
222
+ line : 5 ,
223
+ endLine : 5 ,
224
+ column : 7 ,
225
+ endColumn : 16
166
226
}
167
227
]
168
228
}
0 commit comments