Skip to content

Commit 82d8fdb

Browse files
anonrigAbhiPrasad
andauthored
perf: enable noAccumulatingSpread lint rule (#9996)
Co-authored-by: Abhijeet Prasad <[email protected]>
1 parent 2272c28 commit 82d8fdb

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

biome.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
},
2424
"nursery": {
2525
"noUnusedImports": "error"
26+
},
27+
"performance": {
28+
"noAccumulatingSpread": "error"
2629
}
2730
},
2831
"ignore": [".vscode/*", "**/*.json"]

packages/integrations/scripts/buildBundles.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ async function buildBundle(integration: string, jsVersion: string): Promise<void
3333
if (runParallel) {
3434
// We're building a bundle for each integration and each JavaScript version.
3535
const tasks = getIntegrations().reduce(
36-
(tasks, integration) => [...tasks, buildBundle(integration, 'es5'), buildBundle(integration, 'es6')],
36+
(tasks, integration) => {
37+
tasks.push(buildBundle(integration, 'es5'), buildBundle(integration, 'es6'));
38+
return tasks;
39+
},
3740
[] as Promise<void>[],
3841
);
3942

packages/utils/src/baggage.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ export function baggageHeaderToDynamicSamplingContext(
4040
// Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it
4141
baggageObject = baggageHeader.reduce<Record<string, string>>((acc, curr) => {
4242
const currBaggageObject = baggageHeaderToObject(curr);
43-
return {
44-
...acc,
45-
...currBaggageObject,
46-
};
43+
for (const key of Object.keys(currBaggageObject)) {
44+
acc[key] = currBaggageObject[key];
45+
}
46+
return acc;
4747
}, {});
4848
} else {
4949
// Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but

scripts/prepack.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,14 @@ if (newPkgJson[EXPORT_MAP_ENTRY_POINT]) {
9595

9696
if (newPkgJson[TYPES_VERSIONS_ENTRY_POINT]) {
9797
Object.entries(newPkgJson[TYPES_VERSIONS_ENTRY_POINT]).forEach(([key, val]) => {
98-
newPkgJson[TYPES_VERSIONS_ENTRY_POINT][key] = Object.entries(val).reduce((acc, [key, val]) => {
99-
const newKey = key.replace(`${buildDir}/`, '');
100-
return {
101-
...acc,
102-
[newKey]: val.map(v => v.replace(`${buildDir}/`, '')),
103-
};
104-
}, {});
98+
newPkgJson[TYPES_VERSIONS_ENTRY_POINT][key] = Object.entries(val).reduce(
99+
(acc, [key, val]) => {
100+
const newKey = key.replace(`${buildDir}/`, '');
101+
acc[newKey] = val.map(v => v.replace(`${buildDir}/`, ''));
102+
return acc;
103+
},
104+
{} as Record<string, string[]>,
105+
);
105106
});
106107
}
107108

0 commit comments

Comments
 (0)