@@ -315,141 +315,155 @@ source: crates/oxc_linter/src/tester.rs
315
315
Using spreads within accumulators leads to ` O(n^2)` time complexity .
316
316
317
317
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
318
- ╭─[no_accumulating_spread .tsx :1 :15 ]
318
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
319
319
1 │ let foo = []; for (let i = 0 ; i < 10 ; i ++ ) { foo = [... foo , i ]; }
320
- · ─┬─ ───┬──
321
- · │ ╰── From this spread
322
- · ╰── For this loop
320
+ · ─┬─ ─┬─ ───┬──
321
+ · │ │ ╰── From this spread
322
+ · │ ╰── For this loop
323
+ · ╰── From this accumulator
323
324
╰────
324
325
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
325
326
Using spreads within accumulators leads to ` O(n^2)` time complexity .
326
327
327
328
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
328
- ╭─[no_accumulating_spread .tsx :1 :15 ]
329
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
329
330
1 │ let foo = []; for (const i = 0 ; i < 10 ; i ++ ) { foo = [... foo , i ]; }
330
- · ─┬─ ───┬──
331
- · │ ╰── From this spread
332
- · ╰── For this loop
331
+ · ─┬─ ─┬─ ───┬──
332
+ · │ │ ╰── From this spread
333
+ · │ ╰── For this loop
334
+ · ╰── From this accumulator
333
335
╰────
334
336
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
335
337
Using spreads within accumulators leads to ` O(n^2)` time complexity .
336
338
337
339
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
338
- ╭─[no_accumulating_spread .tsx :1 :15 ]
340
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
339
341
1 │ let foo = []; for (let i in [1 ,2 ,3 ]) { foo = [... foo , i ]; }
340
- · ─┬─ ───┬──
341
- · │ ╰── From this spread
342
- · ╰── For this loop
342
+ · ─┬─ ─┬─ ───┬──
343
+ · │ │ ╰── From this spread
344
+ · │ ╰── For this loop
345
+ · ╰── From this accumulator
343
346
╰────
344
347
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
345
348
Using spreads within accumulators leads to ` O(n^2)` time complexity .
346
349
347
350
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
348
- ╭─[no_accumulating_spread .tsx :1 :15 ]
351
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
349
352
1 │ let foo = []; for (const i in [1 ,2 ,3 ]) { foo = [... foo , i ]; }
350
- · ─┬─ ───┬──
351
- · │ ╰── From this spread
352
- · ╰── For this loop
353
+ · ─┬─ ─┬─ ───┬──
354
+ · │ │ ╰── From this spread
355
+ · │ ╰── For this loop
356
+ · ╰── From this accumulator
353
357
╰────
354
358
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
355
359
Using spreads within accumulators leads to ` O(n^2)` time complexity .
356
360
357
361
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
358
- ╭─[no_accumulating_spread .tsx :1 :15 ]
362
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
359
363
1 │ let foo = []; for (let i of [1 ,2 ,3 ]) { foo = [... foo , i ]; }
360
- · ─┬─ ───┬──
361
- · │ ╰── From this spread
362
- · ╰── For this loop
364
+ · ─┬─ ─┬─ ───┬──
365
+ · │ │ ╰── From this spread
366
+ · │ ╰── For this loop
367
+ · ╰── From this accumulator
363
368
╰────
364
369
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
365
370
Using spreads within accumulators leads to ` O(n^2)` time complexity .
366
371
367
372
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
368
- ╭─[no_accumulating_spread .tsx :1 :15 ]
373
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
369
374
1 │ let foo = []; for (const i of [1 ,2 ,3 ]) { foo = [... foo , i ]; }
370
- · ─┬─ ───┬──
371
- · │ ╰── From this spread
372
- · ╰── For this loop
375
+ · ─┬─ ─┬─ ───┬──
376
+ · │ │ ╰── From this spread
377
+ · │ ╰── For this loop
378
+ · ╰── From this accumulator
373
379
╰────
374
380
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
375
381
Using spreads within accumulators leads to ` O(n^2)` time complexity .
376
382
377
383
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
378
- ╭─[no_accumulating_spread .tsx :1 :15 ]
384
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
379
385
1 │ let foo = []; while (foo .length < 10 ) { foo = [... foo , foo .length ]; }
380
- · ──┬── ───┬──
381
- · │ ╰── From this spread
382
- · ╰── For this loop
386
+ · ─┬─ ──┬── ───┬──
387
+ · │ │ ╰── From this spread
388
+ · │ ╰── For this loop
389
+ · ╰── From this accumulator
383
390
╰────
384
391
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
385
392
Using spreads within accumulators leads to ` O(n^2)` time complexity .
386
393
387
394
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
388
- ╭─[no_accumulating_spread .tsx :1 :15 ]
395
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
389
396
1 │ let foo = {}; for (let i = 0 ; i < 10 ; i ++ ) { foo = { ... foo , [i ]: i }; }
390
- · ─┬─ ───┬──
391
- · │ ╰── From this spread
392
- · ╰── For this loop
397
+ · ─┬─ ─┬─ ───┬──
398
+ · │ │ ╰── From this spread
399
+ · │ ╰── For this loop
400
+ · ╰── From this accumulator
393
401
╰────
394
402
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
395
403
Using spreads within accumulators leads to ` O(n^2)` time complexity .
396
404
397
405
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
398
- ╭─[no_accumulating_spread .tsx :1 :15 ]
406
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
399
407
1 │ let foo = {}; for (const i = 0 ; i < 10 ; i ++ ) { foo = { ... foo , [i ]: i }; }
400
- · ─┬─ ───┬──
401
- · │ ╰── From this spread
402
- · ╰── For this loop
408
+ · ─┬─ ─┬─ ───┬──
409
+ · │ │ ╰── From this spread
410
+ · │ ╰── For this loop
411
+ · ╰── From this accumulator
403
412
╰────
404
413
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
405
414
Using spreads within accumulators leads to ` O(n^2)` time complexity .
406
415
407
416
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
408
- ╭─[no_accumulating_spread .tsx :1 :15 ]
417
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
409
418
1 │ let foo = {}; for (let i in [1 ,2 ,3 ]) { foo = { ... foo , [i ]: i }; }
410
- · ─┬─ ───┬──
411
- · │ ╰── From this spread
412
- · ╰── For this loop
419
+ · ─┬─ ─┬─ ───┬──
420
+ · │ │ ╰── From this spread
421
+ · │ ╰── For this loop
422
+ · ╰── From this accumulator
413
423
╰────
414
424
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
415
425
Using spreads within accumulators leads to ` O(n^2)` time complexity .
416
426
417
427
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
418
- ╭─[no_accumulating_spread .tsx :1 :15 ]
428
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
419
429
1 │ let foo = {}; for (const i in [1 ,2 ,3 ]) { foo = { ... foo , [i ]: i }; }
420
- · ─┬─ ───┬──
421
- · │ ╰── From this spread
422
- · ╰── For this loop
430
+ · ─┬─ ─┬─ ───┬──
431
+ · │ │ ╰── From this spread
432
+ · │ ╰── For this loop
433
+ · ╰── From this accumulator
423
434
╰────
424
435
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
425
436
Using spreads within accumulators leads to ` O(n^2)` time complexity .
426
437
427
438
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
428
- ╭─[no_accumulating_spread .tsx :1 :15 ]
439
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
429
440
1 │ let foo = {}; for (let i of [1 ,2 ,3 ]) { foo = { ... foo , [i ]: i }; }
430
- · ─┬─ ───┬──
431
- · │ ╰── From this spread
432
- · ╰── For this loop
441
+ · ─┬─ ─┬─ ───┬──
442
+ · │ │ ╰── From this spread
443
+ · │ ╰── For this loop
444
+ · ╰── From this accumulator
433
445
╰────
434
446
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
435
447
Using spreads within accumulators leads to ` O(n^2)` time complexity .
436
448
437
449
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
438
- ╭─[no_accumulating_spread .tsx :1 :15 ]
450
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
439
451
1 │ let foo = {}; for (const i of [1 ,2 ,3 ]) { foo = { ... foo , [i ]: i }; }
440
- · ─┬─ ───┬──
441
- · │ ╰── From this spread
442
- · ╰── For this loop
452
+ · ─┬─ ─┬─ ───┬──
453
+ · │ │ ╰── From this spread
454
+ · │ ╰── For this loop
455
+ · ╰── From this accumulator
443
456
╰────
444
457
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
445
458
Using spreads within accumulators leads to ` O(n^2)` time complexity .
446
459
447
460
⚠ oxc (no - accumulating - spread ): Do not spread accumulators in loops
448
- ╭─[no_accumulating_spread .tsx :1 :15 ]
461
+ ╭─[no_accumulating_spread .tsx :1 :5 ]
449
462
1 │ let foo = {}; while (Object .keys (foo ).length < 10 ) { foo = { ... foo , [Object .keys (foo ).length ]: Object .keys (foo ).length }; }
450
- · ──┬── ───┬──
451
- · │ ╰── From this spread
452
- · ╰── For this loop
463
+ · ─┬─ ──┬── ───┬──
464
+ · │ │ ╰── From this spread
465
+ · │ ╰── For this loop
466
+ · ╰── From this accumulator
453
467
╰────
454
468
help : Consider using ` Object.assign()` or ` Array.prototype.push()` to mutate the accumulator instead .
455
469
Using spreads within accumulators leads to ` O(n^2)` time complexity .
0 commit comments