--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.jsonc --- # Input ```cjs foo.reduce((acc, bar) => [...acc, bar], []) ``` # Diagnostics ``` invalid.jsonc:1:27 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduce((acc, bar) => [...acc, bar], []) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduceRight((acc, bar) => [...acc, bar], []) ``` # Diagnostics ``` invalid.jsonc:1:32 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduceRight((acc, bar) => [...acc, bar], []) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduce((acc, bar) => {return [...acc, bar];}, []) ``` # Diagnostics ``` invalid.jsonc:1:35 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduce((acc, bar) => {return [...acc, bar];}, []) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduceRight((acc, bar) => {return [...acc, bar];}, []) ``` # Diagnostics ``` invalid.jsonc:1:40 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduceRight((acc, bar) => {return [...acc, bar];}, []) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduce((acc, bar) => [...acc, ...bar], []) ``` # Diagnostics ``` invalid.jsonc:1:27 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduce((acc, bar) => [...acc, ...bar], []) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduceRight((acc, bar) => [...acc, ...bar], []) ``` # Diagnostics ``` invalid.jsonc:1:32 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduceRight((acc, bar) => [...acc, ...bar], []) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduce((acc, bar) => {return [...acc, ...bar];}, []) ``` # Diagnostics ``` invalid.jsonc:1:35 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduce((acc, bar) => {return [...acc, ...bar];}, []) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduceRight((acc, bar) => {return [...acc, ...bar];}, []) ``` # Diagnostics ``` invalid.jsonc:1:40 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduceRight((acc, bar) => {return [...acc, ...bar];}, []) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduce((acc, bar) => ({...acc, [bar.key]: bar.value}), {}) ``` # Diagnostics ``` invalid.jsonc:1:28 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduce((acc, bar) => ({...acc, [bar.key]: bar.value}), {}) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduceRight((acc, bar) => ({...acc, [bar.key]: bar.value}), {}) ``` # Diagnostics ``` invalid.jsonc:1:33 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduceRight((acc, bar) => ({...acc, [bar.key]: bar.value}), {}) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduce((acc, bar) => {return {...acc, [bar.key]: bar.value};}, {}) ``` # Diagnostics ``` invalid.jsonc:1:35 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduce((acc, bar) => {return {...acc, [bar.key]: bar.value};}, {}) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduceRight((acc, bar) => {return {...acc, [bar.key]: bar.value};}, {}) ``` # Diagnostics ``` invalid.jsonc:1:40 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduceRight((acc, bar) => {return {...acc, [bar.key]: bar.value};}, {}) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduce((acc, bar) => ({...acc, ...bar}), {}) ``` # Diagnostics ``` invalid.jsonc:1:28 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduce((acc, bar) => ({...acc, ...bar}), {}) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduceRight((acc, bar) => ({...acc, ...bar}), {}) ``` # Diagnostics ``` invalid.jsonc:1:33 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduceRight((acc, bar) => ({...acc, ...bar}), {}) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduce((acc, bar) => {return {...acc, ...bar};}, {}) ``` # Diagnostics ``` invalid.jsonc:1:35 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduce((acc, bar) => {return {...acc, ...bar};}, {}) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ``` # Input ```cjs foo.reduceRight((acc, bar) => {return {...acc, ...bar};}, {}) ``` # Diagnostics ``` invalid.jsonc:1:40 lint/performance/noAccumulatingSpread ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Avoid the use of spread (`...`) syntax on accumulators. > 1 │ foo.reduceRight((acc, bar) => {return {...acc, ...bar};}, {}) │ ^^^^^^ i Spread syntax should be avoided on accumulators (like those in `.reduce`) because it causes a time complexity of `O(n^2)`. i Consider methods such as .splice or .push instead. ```