From df8f8446276b7fa7183a6425ab33908306d9d758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Z=C3=B6rb?= Date: Sat, 20 Jan 2024 00:31:33 +0100 Subject: [PATCH] fix(sonar): fix sonar issues --- packages/contentful-ssg/src/cli.ts | 14 ++++++++------ packages/contentful-ssg/src/lib/contentful.ts | 7 ------- packages/cssg-plugin-assets/src/helper/asset.ts | 1 - 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/packages/contentful-ssg/src/cli.ts b/packages/contentful-ssg/src/cli.ts index ea993e4..c80238f 100644 --- a/packages/contentful-ssg/src/cli.ts +++ b/packages/contentful-ssg/src/cli.ts @@ -257,13 +257,15 @@ program if (cmd.poll) { const poll = () => { setTimeout( - async () => { - prev = await run({ ...verified, sync: true }, prev); - if (useCache) { - await cache.setSyncState(prev); - } + () => { + (async () => { + prev = await run({ ...verified, sync: true }, prev); + if (useCache) { + await cache.setSyncState(prev); + } - poll(); + poll(); + })(); }, parseInt(cmd.pollIntervall, 10), ); diff --git a/packages/contentful-ssg/src/lib/contentful.ts b/packages/contentful-ssg/src/lib/contentful.ts index bb02c89..b41bf2f 100644 --- a/packages/contentful-ssg/src/lib/contentful.ts +++ b/packages/contentful-ssg/src/lib/contentful.ts @@ -375,14 +375,7 @@ export const pagedGet = async = ContentfulCo * @param apiClient Contentful API client * @returns Promise for the collection resulting of a sync operation */ - -// type SyncCollectionClean = Omit, 'entries' | 'assets'> & { -// entries: EntryRaw[]; -// assets: AssetRaw[]; -// }; - type SyncCollection = ContentfulSyncCollection; - const sync = async (apiClient: ClientApi, config: ContentfulConfig): Promise => { const cache = initializeCache(config); const options: SyncOptions = { initial: true }; diff --git a/packages/cssg-plugin-assets/src/helper/asset.ts b/packages/cssg-plugin-assets/src/helper/asset.ts index 1fd90af..7213eac 100644 --- a/packages/cssg-plugin-assets/src/helper/asset.ts +++ b/packages/cssg-plugin-assets/src/helper/asset.ts @@ -1,4 +1,3 @@ -import { type Asset } from '@jungvonmatt/contentful-ssg'; import { Presets, SingleBar } from 'cli-progress'; import { existsSync, promises } from 'fs'; import got from 'got';