From 85b1ab4f7aa4b2732761b5243b1106941195ebfe Mon Sep 17 00:00:00 2001 From: delucis Date: Sat, 27 Jul 2024 17:18:58 +0000 Subject: [PATCH] [ci] format --- packages/starlight/__tests__/basics/head.test.ts | 16 +++++++++------- packages/starlight/utils/head.ts | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/starlight/__tests__/basics/head.test.ts b/packages/starlight/__tests__/basics/head.test.ts index 999ccce2a94..3824d1ccfd9 100644 --- a/packages/starlight/__tests__/basics/head.test.ts +++ b/packages/starlight/__tests__/basics/head.test.ts @@ -14,21 +14,23 @@ describe('createHead', () => { test('merges two tags', () => { expect( createHead( - [{ tag: 'link', attrs: { rel: 'canonical', href: "https://example.com" }, }], - [{ tag: 'link', attrs: { rel: 'canonical', href: "https://astro.build" }, content: '' }], + [{ tag: 'link', attrs: { rel: 'canonical', href: 'https://example.com' } }], + [{ tag: 'link', attrs: { rel: 'canonical', href: 'https://astro.build' }, content: '' }] ) - ).toEqual([{ tag: 'link', attrs: { rel: 'canonical', href: "https://astro.build" }, content: '' }]); + ).toEqual([ + { tag: 'link', attrs: { rel: 'canonical', href: 'https://astro.build' }, content: '' }, + ]); }); test('does not merge same link tags', () => { expect( createHead( - [{ tag: 'link', attrs: { rel: 'stylesheet', href: "primary.css" }, content: '' }], - [{ tag: 'link', attrs: { rel: 'stylesheet', href: "secondary.css" }, content: '' }], + [{ tag: 'link', attrs: { rel: 'stylesheet', href: 'primary.css' }, content: '' }], + [{ tag: 'link', attrs: { rel: 'stylesheet', href: 'secondary.css' }, content: '' }] ) ).toEqual([ - { tag: 'link', attrs: { rel: 'stylesheet', href: "primary.css" }, content: '' }, - { tag: 'link', attrs: { rel: 'stylesheet', href: "secondary.css" }, content: '' } + { tag: 'link', attrs: { rel: 'stylesheet', href: 'primary.css' }, content: '' }, + { tag: 'link', attrs: { rel: 'stylesheet', href: 'secondary.css' }, content: '' }, ]); }); diff --git a/packages/starlight/utils/head.ts b/packages/starlight/utils/head.ts index c84537c6d48..05be81f2bae 100644 --- a/packages/starlight/utils/head.ts +++ b/packages/starlight/utils/head.ts @@ -26,7 +26,7 @@ function hasTag(head: HeadConfig, entry: HeadConfig[number]): boolean { case 'meta': return hasOneOf(head, entry, ['name', 'property', 'http-equiv']); case 'link': - return head.some(({ attrs }) => attrs.rel === 'canonical') + return head.some(({ attrs }) => attrs.rel === 'canonical'); default: return false; }