diff --git a/packages/astro/src/content/loaders/glob.ts b/packages/astro/src/content/loaders/glob.ts index 56474b00ee..706fd9c0d4 100644 --- a/packages/astro/src/content/loaders/glob.ts +++ b/packages/astro/src/content/loaders/glob.ts @@ -93,7 +93,12 @@ export function glob(globOptions: GlobOptions): Loader { const isLegacy = (globOptions as any)._legacy; // If global legacy collection handling flag is *not* enabled then this loader is used to emulate them instead const emulateLegacyCollections = !config.legacy.collections; - async function syncData(entry: string, base: URL, entryType?: ContentEntryType, oldId?: string) { + async function syncData( + entry: string, + base: URL, + entryType?: ContentEntryType, + oldId?: string, + ) { if (!entryType) { logger.warn(`No entry type found for ${entry}`); return; @@ -116,7 +121,7 @@ export function glob(globOptions: GlobOptions): Loader { const id = generateId({ entry, base, data }); - if(oldId && oldId !== id) { + if (oldId && oldId !== id) { store.delete(oldId); } diff --git a/packages/astro/test/content-layer.test.js b/packages/astro/test/content-layer.test.js index 10d7790ff7..002c097fcd 100644 --- a/packages/astro/test/content-layer.test.js +++ b/packages/astro/test/content-layer.test.js @@ -486,16 +486,15 @@ describe('Content Layer', () => { await fixture.editFile('/src/content/space/exomars.md', (prev) => { return prev.replace('rosalind-franklin-rover', 'rosalind-franklin'); - }) + }); await fixture.onNextDataStoreChange(); const updatedJsonResponse2 = await fixture.fetch('/collections.json'); const updated2 = devalue.parse(await updatedJsonResponse2.text()); assert.ok(!updated2.spacecraft.includes('rosalind-franklin-rover')); assert.ok(updated2.spacecraft.includes('rosalind-franklin')); - - await fixture.resetAllFiles(); + await fixture.resetAllFiles(); }); it('returns an error if we render an undefined entry', async () => {