Skip to content

Commit 7288731

Browse files
Fixed lint issues (#723)
1 parent e50e71e commit 7288731

4 files changed

Lines changed: 21 additions & 15 deletions

File tree

src/pages/categories/[...slug].astro

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
import type { GetStaticPaths } from 'astro';
3-
import { getCollection, getEntry, render } from 'astro:content';
2+
import type { GetStaticPaths, InferGetStaticPropsType } from 'astro';
3+
import { getCollection, render } from 'astro:content';
44
55
import { FilterableToolsList } from '@/components/filters/FilterableToolsList';
66
import Link from '@/components/Link';
@@ -20,13 +20,15 @@ import {
2020
import { isModern } from '@/utils/versionFilters';
2121
2222
// 1. Generate a new path for every collection entry
23-
export const getStaticPaths: GetStaticPaths = async () => {
23+
export const getStaticPaths = (async () => {
2424
const categories = await getCollection('categories');
2525
return categories.map((category) => ({
2626
params: { slug: category.id.replace(/\.md$/, '') },
2727
props: { category },
2828
}));
29-
};
29+
}) satisfies GetStaticPaths;
30+
31+
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
3032
3133
// 2. For your template, you can get the entry directly from the prop
3234
const { category } = Astro.props;
@@ -53,9 +55,7 @@ const allTools = (await getCollection('tools')).filter((tool) => {
5355
}
5456
const categories = tool.data.categories;
5557
// Check if tool belongs to this category
56-
const isInCategory = categories.some(
57-
(cat) => cat.id === categorySlug
58-
);
58+
const isInCategory = categories.some((cat) => cat.id === categorySlug);
5959
6060
if (!isInCategory) {
6161
return false;

src/pages/collections/[...slug].astro

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
import type { GetStaticPaths } from 'astro';
3-
import { getCollection, getEntry, render } from 'astro:content';
2+
import type { GetStaticPaths, InferGetStaticPropsType } from 'astro';
3+
import { getCollection, render } from 'astro:content';
44
55
import { FilterableCollectionView } from '@/components/filters/FilterableCollectionView';
66
import PageHeader from '@/components/PageHeader.astro';
@@ -74,13 +74,15 @@ function filterTools(
7474
}
7575
7676
// 1. Generate a new path for every collection entry
77-
export const getStaticPaths: GetStaticPaths = async () => {
77+
export const getStaticPaths = (async () => {
7878
const curatedCollections = await getCollection('curated-collections');
7979
return curatedCollections.map((collection) => ({
8080
params: { slug: collection.id.replace(/\.md$/, '') },
8181
props: { collection },
8282
}));
83-
};
83+
}) satisfies GetStaticPaths;
84+
85+
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
8486
8587
// 2. Get the collection from props
8688
const { collection } = Astro.props;

src/pages/sponsor/index.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ const uniqueSponsors = activeSponsors.filter((tool) => {
113113
<ul>
114114
{uniqueSponsors.map((tool) => (
115115
<li>
116-
<Link href={`/tools/${tool.id.replace(/\.md$/, '')}`}>{tool.data.name}</Link>
116+
<Link href={`/tools/${tool.id.replace(/\.md$/, '')}`}>
117+
{tool.data.name}
118+
</Link>
117119
{tool.data.description && ` - ${tool.data.description}`}
118120
</li>
119121
))}

src/pages/tools/[...slug].astro

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import type { GetStaticPaths } from 'astro';
2+
import type { GetStaticPaths, InferGetStaticPropsType } from 'astro';
33
import { getCollection, getEntry, render } from 'astro:content';
44
55
import Badge from '@/components/Badge';
@@ -22,13 +22,15 @@ import {
2222
} from '@/utils/structuredData';
2323
2424
// 1. Generate a new path for every collection entry
25-
export const getStaticPaths: GetStaticPaths = async () => {
25+
export const getStaticPaths = (async () => {
2626
const tools = await getCollection('tools');
2727
return tools.map((tool) => ({
2828
params: { slug: tool.id.replace(/\.md$/, '') },
2929
props: { tool },
3030
}));
31-
};
31+
}) satisfies GetStaticPaths;
32+
33+
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
3234
3335
// 2. For your template, you can get the entry directly from the prop
3436
const { tool } = Astro.props;

0 commit comments

Comments
 (0)