Skip to content

Commit

Permalink
chore: lint updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-sull committed Dec 14, 2024
1 parent 1c47f8a commit 3b20023
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion _cache/webmentions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lastFetched": "2024-12-14T21:25:02.894Z",
"lastFetched": "2024-12-14T21:45:36.286Z",
"children": [
{
"type": "entry",
Expand Down
4 changes: 2 additions & 2 deletions src/assets/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
--link: var(--indigo-2);
}

:where(h1, h2, h3 ,h4 ,h5, h6) {
text-wrap:initial;
:where(h1, h2, h3, h4, h5, h6) {
text-wrap: initial;
text-wrap: pretty;
max-width: var(--size-header-3);
}
Expand Down
24 changes: 12 additions & 12 deletions src/components/Article.astro
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
import { type CollectionEntry, getEntry } from "astro:content";
import readingTime from "reading-time";
import { isoDate, shortDate } from "~/utils/dates.js";
import { Icon } from "astro-icon/components";
import Avatar from "./Avatar.astro";
import TagList from "./TagList.astro";
import { Image } from "astro:assets";
import { type CollectionEntry, getEntry } from 'astro:content'
import readingTime from 'reading-time'
import { isoDate, shortDate } from '~/utils/dates.js'
import { Icon } from 'astro-icon/components'
import Avatar from './Avatar.astro'
import TagList from './TagList.astro'
import { Image } from 'astro:assets'
export type Props = CollectionEntry<"articles">;
export type Props = CollectionEntry<'articles'>
const { body, data, render } = Astro.props;
const { body, data, render } = Astro.props
const { Content } = await render();
const { Content } = await render()
const author = await getEntry(data.author);
const minutes = readingTime(body);
const author = await getEntry(data.author)
const minutes = readingTime(body)
---

<article class="h-entry">
Expand Down
18 changes: 9 additions & 9 deletions src/components/BookmarkCard.astro
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
import Card from "./Card.astro";
import { Icon } from "astro-icon/components";
import { type CollectionEntry, getEntry } from "astro:content";
import Card from './Card.astro'
import { Icon } from 'astro-icon/components'
import { type CollectionEntry, getEntry } from 'astro:content'
export type Props = CollectionEntry<"bookmarks">;
export type Props = CollectionEntry<'bookmarks'>
const { data, slug } = Astro.props;
const { data, slug } = Astro.props
const metadata = data["bookmark-of"];
const metadata = data['bookmark-of']
if (!metadata) {
throw new Error(`Could not load metadata for bookmark "${slug}"`);
throw new Error(`Could not load metadata for bookmark "${slug}"`)
}
const bookmarkUrl = new URL(metadata.url);
const bookmarkUrl = new URL(metadata.url)
const author = await getEntry(data.author);
const author = await getEntry(data.author)
---

<Card
Expand Down
10 changes: 5 additions & 5 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
import { Icon } from "astro-icon/components";
import avatar from "~/assets/uploads/avatar-tony-sull.png";
import site from "~/data/site";
import { Icon } from 'astro-icon/components'
import avatar from '~/assets/uploads/avatar-tony-sull.png'
import site from '~/data/site'
const { url, title, social } = site;
const { url, title, social } = site
const year = new Date().getFullYear();
const year = new Date().getFullYear()
---

<footer class="container">
Expand Down
12 changes: 6 additions & 6 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
import { Icon } from "astro-icon/components";
import site from "~/data/site";
import ThemeToggle from "./ThemeToggle.astro";
import { Icon } from 'astro-icon/components'
import site from '~/data/site'
import ThemeToggle from './ThemeToggle.astro'
export type Link = {
href: string;
text: string;
};
href: string
text: string
}
---
<header class="container">
Expand Down
36 changes: 18 additions & 18 deletions src/components/Profile.astro
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
import type { HTMLAttributes } from "astro/types";
import { getCollection } from "astro:content";
import { Icon } from "astro-icon/components";
import site from "~/data/site";
import TagList from "./TagList.astro";
import type { HTMLAttributes } from 'astro/types'
import { getCollection } from 'astro:content'
import { Icon } from 'astro-icon/components'
import site from '~/data/site'
import TagList from './TagList.astro'
export type Props = Omit<HTMLAttributes<"aside">, "slot">;
export type Props = Omit<HTMLAttributes<'aside'>, 'slot'>
const { ...attrs } = Astro.props;
const { ...attrs } = Astro.props
const articles = await getCollection("articles");
const bookmarks = await getCollection("bookmarks");
const notes = await getCollection("notes");
const articles = await getCollection('articles')
const bookmarks = await getCollection('bookmarks')
const notes = await getCollection('notes')
const entries = [...articles, ...bookmarks, ...notes];
const entries = [...articles, ...bookmarks, ...notes]
const uniq = entries.reduce((acc, next) => {
(next.data.category || []).forEach((tag) => {
const count = acc.has(tag) ? acc.get(tag)! : 0;
;(next.data.category || []).forEach(tag => {
const count = acc.has(tag) ? acc.get(tag)! : 0
acc.set(tag, count + 1);
});
return acc;
}, new Map<string, number>());
acc.set(tag, count + 1)
})
return acc
}, new Map<string, number>())
const tags = Array.from(uniq.entries())
.sort(([, a], [, b]) => b - a)
.map(([tag]) => tag);
.map(([tag]) => tag)
---

<aside {...attrs}>
Expand Down
10 changes: 5 additions & 5 deletions src/components/Share.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
import { Icon } from "astro-icon/components";
import { Icon } from 'astro-icon/components'
export type Props = {
url: string;
alt: string;
};
url: string
alt: string
}
const { url, alt } = Astro.props;
const { url, alt } = Astro.props
---

<share-link href={url} role="button">
Expand Down
3 changes: 1 addition & 2 deletions src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export const collections = {
schema: bookmarkSchema,
}),
personas: defineCollection({
schema: ({ image }) =>
personSchema({ image }),
schema: ({ image }) => personSchema({ image }),
}),
photos: defineCollection({
schema: photoSchema,
Expand Down
26 changes: 13 additions & 13 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
import { getCollection } from "astro:content";
import ArticleCard from "~/components/ArticleCard.astro";
import BookmarkCard from "~/components/BookmarkCard.astro";
import NoteCard from "~/components/NoteCard.astro";
import PhotoCard from "~/components/PhotoCard.astro";
import Profile from "~/components/Profile.astro";
import Layout from "~/layouts/Page.astro";
import { sortByDate } from "~/utils/sortByDate";
import { getCollection } from 'astro:content'
import ArticleCard from '~/components/ArticleCard.astro'
import BookmarkCard from '~/components/BookmarkCard.astro'
import NoteCard from '~/components/NoteCard.astro'
import PhotoCard from '~/components/PhotoCard.astro'
import Profile from '~/components/Profile.astro'
import Layout from '~/layouts/Page.astro'
import { sortByDate } from '~/utils/sortByDate'
const articles = await getCollection("articles");
const bookmarks = await getCollection("bookmarks");
const notes = await getCollection("notes");
const photos = await getCollection("photos");
const articles = await getCollection('articles')
const bookmarks = await getCollection('bookmarks')
const notes = await getCollection('notes')
const photos = await getCollection('photos')
const entries = [...articles, ...bookmarks, ...notes, ...photos].sort(
sortByDate,
);
)
---

<Layout>
Expand Down
4 changes: 2 additions & 2 deletions src/types/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export function noteSchema({ image }: { image: ImageFunction }) {
}
}),
/* Draft properties */
photo: reference("photos")
.or(z.array(reference("photos")))
photo: reference('photos')
.or(z.array(reference('photos')))
.describe(
'one or more photos that is/are considered the primary content of the entry',
)
Expand Down
7 changes: 4 additions & 3 deletions src/types/personas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import type { ImageFunction } from 'astro:content'
import { baseCardSchema } from './base'

export function personSchema({ image }: { image: ImageFunction }) {
return baseCardSchema({ image }).extend({
type: z.literal('person').default('person'),
})
return baseCardSchema({ image })
.extend({
type: z.literal('person').default('person'),
})
.required({ nickname: true, logo: true })
}

Expand Down

0 comments on commit 3b20023

Please sign in to comment.