From bb57ba8dd2d74485ae6c76b7d161427736db0c9c Mon Sep 17 00:00:00 2001 From: StudioCMS Date: Sun, 8 Dec 2024 09:25:31 +0000 Subject: [PATCH] [ci] lint --- docs/scripts/lib/utils.ts | 24 +- docs/src/components/Youtube.astro | 16 +- docs/src/components/icons/GitHubIcon.astro | 4 +- docs/src/components/landing/HeroSection.astro | 24 +- docs/src/components/landing/PageHeader.astro | 8 +- .../components/landing/SocialProofCard.astro | 18 +- .../landing/SocialProofSection.astro | 4 +- docs/src/components/landing/styles.css | 10 +- .../src/components/Checkbox.astro | 2 +- .../studiocms_ui/src/components/Divider.astro | 4 +- .../src/components/Dropdown/Dropdown.astro | 21 +- .../src/components/Dropdown/dropdown.ts | 2 +- .../studiocms_ui/src/components/Footer.astro | 16 +- .../studiocms_ui/src/components/Input.astro | 2 +- .../src/components/Modal/Modal.astro | 15 +- .../src/components/Modal/modal.ts | 5 +- .../src/components/RadioGroup.astro | 4 +- .../studiocms_ui/src/components/Row.astro | 2 +- .../src/components/SearchSelect.astro | 8 +- .../studiocms_ui/src/components/Select.astro | 6 +- .../src/components/Sidebar/Single.astro | 4 +- .../src/components/Sidebar/helpers.ts | 2 +- .../src/components/Textarea.astro | 6 +- .../src/components/ThemeToggle.astro | 6 +- .../src/components/Toast/Toaster.astro | 2 +- .../studiocms_ui/src/components/Toggle.astro | 2 +- .../studiocms_ui/src/components/User.astro | 4 +- packages/studiocms_ui/src/components/index.ts | 44 ++-- .../studiocms_ui/src/layouts/RootLayout.astro | 2 +- packages/studiocms_ui/src/types/index.ts | 2 +- .../studiocms_ui/src/utils/ThemeHelper.ts | 248 +++++++++--------- playground/astro.config.mts | 4 +- scripts/filter-warnings.cjs | 15 +- 33 files changed, 278 insertions(+), 258 deletions(-) diff --git a/docs/scripts/lib/utils.ts b/docs/scripts/lib/utils.ts index e1ab91a..3fd6ef3 100644 --- a/docs/scripts/lib/utils.ts +++ b/docs/scripts/lib/utils.ts @@ -1,21 +1,21 @@ -import fs from 'node:fs' -import { EOL } from 'node:os' +import fs from 'node:fs'; +import { EOL } from 'node:os'; export function normalizeLineEndings(contents: string) { - return contents.replace(/\r\n/g, '\n') + return contents.replace(/\r\n/g, '\n'); } export function splitLines(contents: string) { - return normalizeLineEndings(contents).split(/\n/) + return normalizeLineEndings(contents).split(/\n/); } export function readFileLines(filePath: string) { - return splitLines(fs.readFileSync(filePath, 'utf8')) + return splitLines(fs.readFileSync(filePath, 'utf8')); } export function writeFileLines(filePath: string, lines: string | string[]) { - const normalizedLines = splitLines(Array.isArray(lines) ? lines.join('\n') : lines) - fs.writeFileSync(filePath, normalizedLines.join(EOL)) + const normalizedLines = splitLines(Array.isArray(lines) ? lines.join('\n') : lines); + fs.writeFileSync(filePath, normalizedLines.join(EOL)); } /** @@ -29,10 +29,10 @@ export function serializeStringWithSingleQuotes(input: string): string { '\n': '\\n', '\r': '\\r', '\t': '\\t', - } + }; - return escapeMap[match] || match - }) + return escapeMap[match] || match; + }); - return `'${escapedString}'` -} \ No newline at end of file + return `'${escapedString}'`; +} diff --git a/docs/src/components/Youtube.astro b/docs/src/components/Youtube.astro index ea35f96..6e16aac 100644 --- a/docs/src/components/Youtube.astro +++ b/docs/src/components/Youtube.astro @@ -1,12 +1,12 @@ --- -import { YouTube } from 'astro-embed'; - -interface Props { - id: string; - title?: string; -} - -const { id, title } = Astro.props; +import { YouTube } from 'astro-embed'; + +interface Props { + id: string; + title?: string; +} + +const { id, title } = Astro.props; --- diff --git a/docs/src/components/icons/GitHubIcon.astro b/docs/src/components/icons/GitHubIcon.astro index 7406d9a..1a73477 100644 --- a/docs/src/components/icons/GitHubIcon.astro +++ b/docs/src/components/icons/GitHubIcon.astro @@ -2,8 +2,8 @@ import type { HTMLAttributes } from 'astro/types'; interface Props extends HTMLAttributes<'svg'> { - width?: number; - height?: number; + width?: number; + height?: number; } const { width = 98, height = 96, ...props } = Astro.props; diff --git a/docs/src/components/landing/HeroSection.astro b/docs/src/components/landing/HeroSection.astro index 3343ca0..d3dd85c 100644 --- a/docs/src/components/landing/HeroSection.astro +++ b/docs/src/components/landing/HeroSection.astro @@ -1,17 +1,17 @@ --- import { - Button, - Checkbox, - Divider, - Dropdown, - Input, - RadioGroup, - SearchSelect, - Select, - Textarea, - ThemeToggle, - Toggle, - User + Button, + Checkbox, + Divider, + Dropdown, + Input, + RadioGroup, + SearchSelect, + Select, + Textarea, + ThemeToggle, + Toggle, + User, } from '@studiocms/ui/components'; import Icon from '@studiocms/ui/utils/Icon.astro'; diff --git a/docs/src/components/landing/PageHeader.astro b/docs/src/components/landing/PageHeader.astro index 5f80f6d..867282d 100644 --- a/docs/src/components/landing/PageHeader.astro +++ b/docs/src/components/landing/PageHeader.astro @@ -1,11 +1,11 @@ --- import Icon from '@studiocms/ui/utils/Icon.astro'; -import type { HeroIconName } from '@studiocms/ui/utils/iconType.js' +import type { HeroIconName } from '@studiocms/ui/utils/iconType.js'; interface Props { - icon: HeroIconName; - title: string; - subtitle?: string; + icon: HeroIconName; + title: string; + subtitle?: string; } const { icon, title, subtitle } = Astro.props; diff --git a/docs/src/components/landing/SocialProofCard.astro b/docs/src/components/landing/SocialProofCard.astro index 6c92f58..cbd2501 100644 --- a/docs/src/components/landing/SocialProofCard.astro +++ b/docs/src/components/landing/SocialProofCard.astro @@ -2,15 +2,15 @@ import { Image } from 'astro:assets'; interface Props { - avatar: string; - name: string; - handle: string; - message: string; - image?: { - path: string; - width: number; - height: number; - }; + avatar: string; + name: string; + handle: string; + message: string; + image?: { + path: string; + width: number; + height: number; + }; } const { avatar, name, handle, message, image } = Astro.props; diff --git a/docs/src/components/landing/SocialProofSection.astro b/docs/src/components/landing/SocialProofSection.astro index 4e1a734..9487a46 100644 --- a/docs/src/components/landing/SocialProofSection.astro +++ b/docs/src/components/landing/SocialProofSection.astro @@ -10,8 +10,8 @@ const chunkSize = socialProofEntries.length / 3; const chunkedSocialProofEntries = []; for (let i = 0; i < socialProofEntries.length; i += chunkSize) { - const chunk = socialProofEntries.slice(i, i + chunkSize); - chunkedSocialProofEntries.push(chunk); + const chunk = socialProofEntries.slice(i, i + chunkSize); + chunkedSocialProofEntries.push(chunk); } ---