Skip to content

Commit

Permalink
fix: enable noAccumulatingSpread in biome
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes committed Aug 15, 2024
1 parent bed9283 commit feb0950
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
3 changes: 0 additions & 3 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@
"suspicious": {
"noArrayIndexKey": "off",
"noDoubleEquals": "off" // TODO: Enable this rule
},
"performance": {
"noAccumulatingSpread": "off" // TODO: Enable this rule
}
},
"ignore": []
Expand Down
14 changes: 6 additions & 8 deletions packages/cli/src/tokens/formats/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,10 @@ export const typography: Format = {
font-weight: ${getValue<string>(token)};
}`;

return {
...acc,
return Object.assign({}, acc, {
variables: [...acc.variables, format(token)],
classes: [...acc.classes, className],
};
});
}

if (typeEquals('lineheight', token)) {
Expand All @@ -161,11 +160,10 @@ export const typography: Format = {
line-height: ${getValue<string>(token)};
}`;

return {
...acc,
return Object.assign({}, acc, {
variables: [...acc.variables, format(token)],
classes: [...acc.classes, className],
};
});
}

if (typeEquals('typography', token)) {
Expand Down Expand Up @@ -194,10 +192,10 @@ export const typography: Format = {
${letterSpacingVar ? `letter-spacing: ${letterSpacingVar};` : ''}
}`;

return { ...acc, classes: [className, ...acc.classes] };
return Object.assign({}, acc, { classes: [className, ...acc.classes] });
}

return { ...acc, variables: [...acc.variables, format(token)] };
return Object.assign({}, acc, { variables: acc.variables.concat(format(token)) });
},
{ variables: [], classes: [] },
),
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/components/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ export const WithFormElements: Story = (args) => {
setHeaderChecked(event.target.checked);
setCheckedItems(
rows.reduce(
(acc: CheckedItems, row) => ({ ...acc, [row]: event.target.checked }),
(acc: CheckedItems, row) =>
Object.assign(acc, { [row]: event.target.checked }),
{},
),
);
Expand Down

0 comments on commit feb0950

Please sign in to comment.