1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Tools: Apply rule github/array-foreach

This commit is contained in:
Laurent Cozic
2023-06-30 09:39:21 +01:00
parent c6a15b3186
commit 0c4ba592f6
32 changed files with 473 additions and 4 deletions

View File

@@ -138,6 +138,7 @@ describe('models/Folder', () => {
const folders = await Folder.all({ includeConflictFolder: false });
await Folder.addNoteCounts(folders);
const foldersById: any = {};
// eslint-disable-next-line github/array-foreach -- Old code before rule was applied
folders.forEach((f: FolderEntity) => { foldersById[f.id] = f; });
expect(folders.length).toBe(4);
@@ -151,6 +152,7 @@ describe('models/Folder', () => {
const folders = await Folder.all({ includeConflictFolder: true });
await Folder.addNoteCounts(folders);
const foldersById: any = {};
// eslint-disable-next-line github/array-foreach -- Old code before rule was applied
folders.forEach((f: FolderEntity) => { foldersById[f.id] = f; });
expect(folders.length).toBe(5);
@@ -176,6 +178,7 @@ describe('models/Folder', () => {
await Folder.addNoteCounts(folders, false);
const foldersById: any = {};
// eslint-disable-next-line github/array-foreach -- Old code before rule was applied
folders.forEach((f: FolderEntity) => { foldersById[f.id] = f; });
expect(folders.length).toBe(4);