diff --git a/eslint.config.js b/eslint.config.js index f69c1e8..3961a84 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -54,6 +54,6 @@ export default [ }, }, { - ignores: ['dist', 'node_modules', '.github', 'types.generated.d.ts'], + ignores: ['dist', 'node_modules', '.github', 'types.generated.d.ts', '.astro'], }, ]; diff --git a/src/components/blog/RelatedPosts.astro b/src/components/blog/RelatedPosts.astro index 04337a5..8d55ecd 100644 --- a/src/components/blog/RelatedPosts.astro +++ b/src/components/blog/RelatedPosts.astro @@ -1,10 +1,10 @@ --- -import { APP_BLOG } from "astrowind:config"; +import { APP_BLOG } from 'astrowind:config'; -import { fetchPosts, getRelatedPosts } from "~/utils/blog"; -import BlogHighlightedPosts from "../widgets/BlogHighlightedPosts.astro"; -import type { Post } from "~/types"; -import { getBlogPermalink } from "~/utils/permalinks"; +import { getRelatedPosts } from '~/utils/blog'; +import BlogHighlightedPosts from '../widgets/BlogHighlightedPosts.astro'; +import type { Post } from '~/types'; +import { getBlogPermalink } from '~/utils/permalinks'; export interface Props { post: Post; @@ -18,7 +18,7 @@ const relatedPosts = post.tags ? await getRelatedPosts(post, 4) : []; { APP_BLOG.isRelatedPostsEnabled ? ( diff --git a/src/components/widgets/Content.astro b/src/components/widgets/Content.astro index 9ce5421..533ba92 100644 --- a/src/components/widgets/Content.astro +++ b/src/components/widgets/Content.astro @@ -82,7 +82,7 @@ const { widths={[400, 768]} sizes="(max-width: 768px) 100vw, 432px" layout="responsive" - {...(image as any)} + {...image} /> )} diff --git a/src/components/widgets/Features.astro b/src/components/widgets/Features.astro index b1faa9c..8f42b62 100644 --- a/src/components/widgets/Features.astro +++ b/src/components/widgets/Features.astro @@ -1,13 +1,13 @@ --- -import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; -import ItemGrid from "~/components/ui/ItemGrid.astro"; -import Headline from "~/components/ui/Headline.astro"; -import type { Features as Props } from "~/types"; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import ItemGrid from '~/components/ui/ItemGrid.astro'; +import Headline from '~/components/ui/Headline.astro'; +import type { Features as Props } from '~/types'; const { - title = await Astro.slots.render("title"), - subtitle = await Astro.slots.render("subtitle"), - tagline = await Astro.slots.render("tagline"), + title = await Astro.slots.render('title'), + subtitle = await Astro.slots.render('subtitle'), + tagline = await Astro.slots.render('tagline'), items = [], columns = 2, @@ -16,31 +16,21 @@ const { id, isDark = false, classes = {}, - bg = await Astro.slots.render("bg"), + bg = await Astro.slots.render('bg'), } = Astro.props; --- - - } - /> + + } /> ) ?? {}), }} /> diff --git a/src/components/widgets/Features2.astro b/src/components/widgets/Features2.astro index 6ce5cf0..282337e 100644 --- a/src/components/widgets/Features2.astro +++ b/src/components/widgets/Features2.astro @@ -1,13 +1,13 @@ --- -import WidgetWrapper from "~/components/ui/WidgetWrapper.astro"; -import Headline from "~/components/ui/Headline.astro"; -import ItemGrid2 from "~/components/ui/ItemGrid2.astro"; -import type { Features as Props } from "~/types"; +import WidgetWrapper from '~/components/ui/WidgetWrapper.astro'; +import Headline from '~/components/ui/Headline.astro'; +import ItemGrid2 from '~/components/ui/ItemGrid2.astro'; +import type { Features as Props } from '~/types'; const { - title = await Astro.slots.render("title"), - subtitle = await Astro.slots.render("subtitle"), - tagline = await Astro.slots.render("tagline"), + title = await Astro.slots.render('title'), + subtitle = await Astro.slots.render('subtitle'), + tagline = await Astro.slots.render('tagline'), items = [], columns = 3, defaultIcon, @@ -15,34 +15,24 @@ const { id, isDark = false, classes = {}, - bg = await Astro.slots.render("bg"), + bg = await Astro.slots.render('bg'), } = Astro.props; --- - - } - /> + + } /> ) ?? {}), }} /> diff --git a/src/components/widgets/Features3.astro b/src/components/widgets/Features3.astro index 076518e..62ab475 100644 --- a/src/components/widgets/Features3.astro +++ b/src/components/widgets/Features3.astro @@ -46,7 +46,7 @@ const { height={320} widths={[400, 768]} layout="fullWidth" - {...(image as any)} + {...image} /> )} @@ -64,7 +64,7 @@ const { title: 'text-lg font-semibold', description: 'mt-0.5', icon: 'flex-shrink-0 mt-1 text-primary w-6 h-6', - ...((classes?.items as {}) ?? {}), + ...((classes?.items as object) ?? {}), }} /> diff --git a/src/components/widgets/Hero.astro b/src/components/widgets/Hero.astro index 20a1ba7..e8ce3ee 100644 --- a/src/components/widgets/Hero.astro +++ b/src/components/widgets/Hero.astro @@ -10,7 +10,7 @@ export interface Props { tagline?: string; content?: string; actions?: string | CallToAction[]; - image?: string | any; // TODO: find HTMLElementProps + image?: string | unknown; // TODO: find HTMLElementProps } const { diff --git a/src/components/widgets/Hero2.astro b/src/components/widgets/Hero2.astro index 5eb3202..6180265 100644 --- a/src/components/widgets/Hero2.astro +++ b/src/components/widgets/Hero2.astro @@ -9,7 +9,7 @@ export interface Props { tagline?: string; content?: string; actions?: string | CallToAction[]; - image?: string | any; // TODO: find HTMLElementProps + image?: string | unknown; // TODO: find HTMLElementProps } const { diff --git a/src/components/widgets/Steps.astro b/src/components/widgets/Steps.astro index 160a729..3c65bf6 100644 --- a/src/components/widgets/Steps.astro +++ b/src/components/widgets/Steps.astro @@ -21,8 +21,8 @@ const { --- -
-
+
+
- + } />
{ image && (
- {(typeof image === 'string' ? ( - + {typeof image === 'string' ? ( + ) : ( - {image?.alt - ))} + {image?.alt + )}
) } diff --git a/src/components/widgets/Testimonials.astro b/src/components/widgets/Testimonials.astro index f40db05..98a7d50 100644 --- a/src/components/widgets/Testimonials.astro +++ b/src/components/widgets/Testimonials.astro @@ -5,7 +5,6 @@ import Button from '~/components/ui/Button.astro'; import Image from '~/components/common/Image.astro'; import type { Testimonials as Props } from '~/types'; - const { title = '', subtitle = '', @@ -50,7 +49,7 @@ const { height={40} widths={[400, 768]} layout="fixed" - {...(image as any)} + {...image} /> )}
diff --git a/src/utils/blog.ts b/src/utils/blog.ts index 9ace2fc..dec56f6 100644 --- a/src/utils/blog.ts +++ b/src/utils/blog.ts @@ -1,7 +1,7 @@ import type { PaginateFunction } from 'astro'; import { getCollection } from 'astro:content'; import type { CollectionEntry } from 'astro:content'; -import type { Post, Taxonomy } from '~/types'; +import type { Post } from '~/types'; import { APP_BLOG } from 'astrowind:config'; import { cleanSlug, trimSlash, BLOG_BASE, POST_PERMALINK_PATTERN, CATEGORY_BASE, TAG_BASE } from './permalinks'; @@ -243,7 +243,7 @@ export const getStaticPathsBlogTag = async ({ paginate }: { paginate: PaginateFu /** */ export async function getRelatedPosts(originalPost: Post, maxResults: number = 4): Promise { const allPosts = await fetchPosts(); - const originalTagsSet = new Set(originalPost.tags ? originalPost.tags.map(tag => tag.slug) : []); + const originalTagsSet = new Set(originalPost.tags ? originalPost.tags.map((tag) => tag.slug) : []); const postsWithScores = allPosts.reduce((acc: { post: Post; score: number }[], iteratedPost: Post) => { if (iteratedPost.slug === originalPost.slug) return acc; @@ -254,7 +254,7 @@ export async function getRelatedPosts(originalPost: Post, maxResults: number = 4 } if (iteratedPost.tags) { - iteratedPost.tags.forEach(tag => { + iteratedPost.tags.forEach((tag) => { if (originalTagsSet.has(tag.slug)) { score += 1; } diff --git a/src/utils/images-optimization.ts b/src/utils/images-optimization.ts index 5c4662c..df5cb17 100644 --- a/src/utils/images-optimization.ts +++ b/src/utils/images-optimization.ts @@ -210,7 +210,7 @@ const getBreakpoints = ({ }; /* ** */ -export const astroAsseetsOptimizer: ImagesOptimizer = async (image, breakpoints, width, height) => { +export const astroAsseetsOptimizer: ImagesOptimizer = async (image, breakpoints, _width, _height) => { if (!image) { return []; } diff --git a/src/utils/permalinks.ts b/src/utils/permalinks.ts index a913aee..4e3078d 100644 --- a/src/utils/permalinks.ts +++ b/src/utils/permalinks.ts @@ -109,7 +109,7 @@ export const applyGetPermalinks = (menu: object = {}) => { return menu.map((item) => applyGetPermalinks(item)); } else if (typeof menu === 'object' && menu !== null) { const obj = {}; - for (let key in menu) { + for (const key in menu) { if (key === 'href') { if (typeof menu[key] === 'string') { obj[key] = getPermalink(menu[key]);