Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: enable noAccumulatingSpread lint rule #9996

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
},
"nursery": {
"noUnusedImports": "error"
},
"performance": {
"noAccumulatingSpread": "error"
}
},
"ignore": [".vscode/*", "**/*.json"]
Expand Down
5 changes: 4 additions & 1 deletion packages/integrations/scripts/buildBundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ async function buildBundle(integration: string, jsVersion: string): Promise<void
if (runParallel) {
// We're building a bundle for each integration and each JavaScript version.
const tasks = getIntegrations().reduce(
(tasks, integration) => [...tasks, buildBundle(integration, 'es5'), buildBundle(integration, 'es6')],
(tasks, integration) => {
tasks.push(buildBundle(integration, 'es5'), buildBundle(integration, 'es6'));
return tasks;
},
[] as Promise<void>[],
);

Expand Down
8 changes: 4 additions & 4 deletions packages/utils/src/baggage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export function baggageHeaderToDynamicSamplingContext(
// Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it
baggageObject = baggageHeader.reduce<Record<string, string>>((acc, curr) => {
const currBaggageObject = baggageHeaderToObject(curr);
return {
...acc,
...currBaggageObject,
};
for (const key of Object.keys(currBaggageObject)) {
acc[key] = currBaggageObject[key];
}
return acc;
}, {});
} else {
// Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but
Expand Down
15 changes: 8 additions & 7 deletions scripts/prepack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ if (newPkgJson[EXPORT_MAP_ENTRY_POINT]) {

if (newPkgJson[TYPES_VERSIONS_ENTRY_POINT]) {
Object.entries(newPkgJson[TYPES_VERSIONS_ENTRY_POINT]).forEach(([key, val]) => {
newPkgJson[TYPES_VERSIONS_ENTRY_POINT][key] = Object.entries(val).reduce((acc, [key, val]) => {
const newKey = key.replace(`${buildDir}/`, '');
return {
...acc,
[newKey]: val.map(v => v.replace(`${buildDir}/`, '')),
};
}, {});
newPkgJson[TYPES_VERSIONS_ENTRY_POINT][key] = Object.entries(val).reduce(
(acc, [key, val]) => {
const newKey = key.replace(`${buildDir}/`, '');
acc[newKey] = val.map(v => v.replace(`${buildDir}/`, ''));
return acc;
},
{} as Record<string, string[]>,
);
});
}

Expand Down
Loading