refactor(lint): enable map spread rule

This commit is contained in:
Peter Steinberger
2026-04-18 19:53:02 +01:00
parent 0c245c35c5
commit 4fa961d4f1
73 changed files with 352 additions and 344 deletions

View File

@@ -211,13 +211,7 @@ function expandTextContent(text: string): {
const content = mergeAdjacentTextItems(
parts.map((item) => {
if (item.type === "attachment" && item.attachment.kind === "audio" && audioAsVoice) {
return {
...item,
attachment: {
...item.attachment,
isVoiceNote: true,
},
};
return Object.assign({}, item, { attachment: { ...item.attachment, isVoiceNote: true } });
}
return item;
}),

View File

@@ -276,12 +276,7 @@ function patchSessionThinkingLevel(
state.sessionsResult = {
...current,
sessions: current.sessions.map((row) =>
row.key === sessionKey
? {
...row,
thinkingLevel,
}
: row,
row.key === sessionKey ? Object.assign({}, row, { thinkingLevel }) : row,
),
};
}

View File

@@ -724,12 +724,13 @@ export function renderConfig(props: ConfigProps) {
const schemaProps = analysis.schema?.properties ?? {};
const VIRTUAL_SECTIONS = new Set(["__appearance__"]);
const visibleCategories = SECTION_CATEGORIES.map((cat) => ({
...cat,
sections: cat.sections.filter(
(s) => (includeVirtualSections && VIRTUAL_SECTIONS.has(s.key)) || s.key in schemaProps,
),
})).filter((cat) => cat.sections.length > 0);
const visibleCategories = SECTION_CATEGORIES.map((cat) =>
Object.assign({}, cat, {
sections: cat.sections.filter(
(s) => (includeVirtualSections && VIRTUAL_SECTIONS.has(s.key)) || s.key in schemaProps,
),
}),
).filter((cat) => cat.sections.length > 0);
// Catch any schema keys not in our categories
const extraSections = Object.keys(schemaProps)

View File

@@ -80,10 +80,7 @@ function formatDiaryChipLabel(date: string): string {
function buildDiaryNavigation(entries: DiaryEntry[]): DiaryEntryNav[] {
const reversed = [...entries].toReversed();
return reversed.map((entry, page) => ({
...entry,
page,
}));
return reversed.map((entry, page) => Object.assign({}, entry, { page }));
}
type DreamingPhaseInfo = {