Skip to content

Commit 80b0dc9

Browse files
authored
feat: fix lint error
1 parent 857fd5d commit 80b0dc9

File tree

8 files changed

+42
-12
lines changed

8 files changed

+42
-12
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ module.exports = {
1717
parser: "@typescript-eslint/parser",
1818
extraFileExtensions: [".astro"],
1919
},
20+
globals: {
21+
dataLayer: "readonly",
22+
},
2023
rules: {},
2124
},
2225
],

package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@divriots/jampack": "^0.23.2",
3939
"@tailwindcss/typography": "^0.5.10",
4040
"@types/github-slugger": "^1.3.0",
41+
"@types/howler": "^2.2.12",
4142
"@types/react": "^18.2.48",
4243
"@typescript-eslint/parser": "^6.19.0",
4344
"astro-eslint-parser": "^0.16.2",

src/components/GoogleAnalytics.astro

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
<script is:inline async src="https://www.googletagmanager.com/gtag/js?id=G-1X5E9W6VJ2"></script>
33
<script is:inline>
44
window.dataLayer = window.dataLayer || [];
5-
function gtag(){dataLayer.push(arguments);}
6-
gtag('js', new Date());
5+
function gtag() {
6+
window.dataLayer.push(arguments);
7+
}
8+
gtag("js", new Date());
79

8-
gtag('config', 'G-1X5E9W6VJ2');
10+
gtag("config", "G-1X5E9W6VJ2");
911
</script>

src/pages/og.png.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import type { APIRoute } from "astro";
22
import { generateOgImageForSite } from "@utils/generateOgImages";
33

4-
export const GET: APIRoute = async () =>
5-
new Response(await generateOgImageForSite(), {
4+
export const GET: APIRoute = async () => {
5+
const imageBuffer = await generateOgImageForSite();
6+
const body = imageBuffer.buffer.slice(
7+
imageBuffer.byteOffset,
8+
imageBuffer.byteOffset + imageBuffer.byteLength
9+
);
10+
11+
return new Response(body, {
612
headers: { "Content-Type": "image/png" },
713
});
14+
};

src/pages/posts/[slug]/index.png.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ export async function getStaticPaths() {
1414
}));
1515
}
1616

17-
export const GET: APIRoute = async ({ props }) =>
18-
new Response(await generateOgImageForPost(props as CollectionEntry<"blog">), {
17+
export const GET: APIRoute = async ({ props }) => {
18+
const imageBuffer = await generateOgImageForPost(
19+
props as CollectionEntry<"blog">
20+
);
21+
const body = imageBuffer.buffer.slice(
22+
imageBuffer.byteOffset,
23+
imageBuffer.byteOffset + imageBuffer.byteLength
24+
);
25+
26+
return new Response(body, {
1927
headers: { "Content-Type": "image/png" },
2028
});
29+
};

src/pages/radio/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { defaultCategoryId, radioLibrary } from "./radio-data";
77

88
<!-- eslint-disable -->
99
<Layout title="Radio">
10-
<Main>
10+
<Main pageTitle="Radio" pageDesc="Listen back to book recordings">
1111
<RadioPlayer
1212
client:load
1313
categories={radioLibrary}

src/pages/shanghai/index.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { ALL_COMPANY } from "./company-data";
1616
</nav>
1717

1818
<div class="mt-8">
19-
<h3 id="sesson1">欧洲公司</h3>
19+
<h3 id="session1">欧洲公司</h3>
2020
{
2121
ALL_COMPANY.filter(item => item.tag.includes("eu")).map((item, idx) => (
2222
<div class="border-b border-gray-200 p-2">
@@ -29,7 +29,7 @@ import { ALL_COMPANY } from "./company-data";
2929
<div class="flex gap-4">
3030
{item.link ? (
3131
<div class="flex">
32-
<div class="pr-2">link => </div>
32+
<div class="pr-2">link =&gt; </div>
3333
<div>
3434
<a
3535
href={item.link}
@@ -44,7 +44,7 @@ import { ALL_COMPANY } from "./company-data";
4444

4545
{item.boss ? (
4646
<div class="flex">
47-
<div class="pr-2">Bosses=> </div>
47+
<div class="pr-2">Bosses =&gt; </div>
4848
<div>
4949
{item.boss.map((itemBoss, itemIdx) => (
5050
<a
@@ -98,7 +98,7 @@ import { ALL_COMPANY } from "./company-data";
9898
</Layout>
9999

100100
<script is:inline>
101-
document.addEventListener("DOMContentLoaded", _event => {
101+
document.addEventListener("DOMContentLoaded", () => {
102102
const searchInput = document.getElementById("searchInput");
103103
const companyList = document.getElementById("companyList");
104104
const companies = companyList.querySelectorAll("div");

0 commit comments

Comments
 (0)