@@ -2227,6 +2227,110 @@ Generated by [AVA](https://avajs.dev).
2227
2227
3 | export {bar} from './foo.json' assert { type: 'unknown' };␊
2228
2228
`
2229
2229
2230
+ ## invalid(1): import json from './foo.json' with { type: 'json' }; export default json;
2231
+
2232
+ > Input
2233
+
2234
+ `␊
2235
+ 1 | import json from './foo.json' with { type: 'json' };␊
2236
+ 2 | export default json;␊
2237
+ `
2238
+
2239
+ > Output
2240
+
2241
+ `␊
2242
+ 1 |␊
2243
+ 2 |␊
2244
+ 3 | export {default} from './foo.json' with { type: 'json' };␊
2245
+ `
2246
+
2247
+ > Error 1/1
2248
+
2249
+ `␊
2250
+ 1 | import json from './foo.json' with { type: 'json' };␊
2251
+ > 2 | export default json;␊
2252
+ | ^^^^^^^^^^^^^^^^^^^^ Use \`export…from\` to re-export \`default\`.␊
2253
+ `
2254
+
2255
+ ## invalid(2): import * as json from './foo.json' with { type: 'json' }; export {json};
2256
+
2257
+ > Input
2258
+
2259
+ `␊
2260
+ 1 | import * as json from './foo.json' with { type: 'json' };␊
2261
+ 2 | export {json};␊
2262
+ `
2263
+
2264
+ > Output
2265
+
2266
+ `␊
2267
+ 1 |␊
2268
+ 2 |␊
2269
+ 3 | export * as json from './foo.json' with { type: 'json' };␊
2270
+ `
2271
+
2272
+ > Error 1/1
2273
+
2274
+ `␊
2275
+ 1 | import * as json from './foo.json' with { type: 'json' };␊
2276
+ > 2 | export {json};␊
2277
+ | ^^^^ Use \`export…from\` to re-export \`json\`.␊
2278
+ `
2279
+
2280
+ ## invalid(3): import {foo} from './foo.json' with { type: 'unknown' }; export {foo}; export {bar} from './foo.json';
2281
+
2282
+ > Input
2283
+
2284
+ `␊
2285
+ 1 | import {foo} from './foo.json' with { type: 'unknown' };␊
2286
+ 2 | export {foo};␊
2287
+ 3 | export {bar} from './foo.json';␊
2288
+ `
2289
+
2290
+ > Output
2291
+
2292
+ `␊
2293
+ 1 |␊
2294
+ 2 |␊
2295
+ 3 | export {bar, foo} from './foo.json';␊
2296
+ `
2297
+
2298
+ > Error 1/1
2299
+
2300
+ `␊
2301
+ 1 | import {foo} from './foo.json' with { type: 'unknown' };␊
2302
+ > 2 | export {foo};␊
2303
+ | ^^^ Use \`export…from\` to re-export \`foo\`.␊
2304
+ 3 | export {bar} from './foo.json';␊
2305
+ `
2306
+
2307
+ ## invalid(4): import {foo} from './foo.json'; export {foo}; export {bar} from './foo.json' with { type: 'unknown' };
2308
+
2309
+ > Input
2310
+
2311
+ `␊
2312
+ 1 | import {foo} from './foo.json';␊
2313
+ 2 | export {foo};␊
2314
+ 3 | export {bar} from './foo.json' with { type: 'unknown' };␊
2315
+ `
2316
+
2317
+ > Output
2318
+
2319
+ `␊
2320
+ 1 |␊
2321
+ 2 |␊
2322
+ 3 | export {bar, foo} from './foo.json' with { type: 'unknown' };␊
2323
+ `
2324
+
2325
+ > Error 1/1
2326
+
2327
+ `␊
2328
+ 1 | import {foo} from './foo.json';␊
2329
+ > 2 | export {foo};␊
2330
+ | ^^^ Use \`export…from\` to re-export \`foo\`.␊
2331
+ 3 | export {bar} from './foo.json' with { type: 'unknown' };␊
2332
+ `
2333
+
2230
2334
## invalid(1): import defaultExport from 'foo'; export {defaultExport as default}; export {defaultExport as named};
2231
2335
2232
2336
> Input
0 commit comments