Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MikuroXina committed Aug 30, 2024
1 parent 5f6e971 commit ecf6968
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@ export const createPages: GatsbyNode["createPages"] = async (api) => {
return;
}

const pages = res.data?.allMarkdownRemark.nodes!;
const pages = res.data?.allMarkdownRemark.nodes;
if (!pages) {
api.reporter.error("unreachable");
return;
}

const component = path.resolve("src/templates/blog-post.tsx");
for (let i = 0; i < pages.length; ++i) {
const slug = path.basename(pages[i].parent.name);
Expand Down
1 change: 1 addition & 0 deletions src/components/date.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect, it } from "vitest";
import { DateString } from "./date";
import React from "react";
import { render } from "../../utils/react-test";

it("renders correctly", () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/footer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect, it } from "vitest";
import { Footer } from "./footer";
import React from "react";
import { render } from "../../utils/react-test";

it("renders correctly", () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/header.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect, it } from "vitest";
import { Header } from "./header";
import React from "react";
import { render } from "../../utils/react-test";

it("renders correctly", () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/navigation.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect, it } from "vitest";
import { Navigation } from "./navigation";
import React from "react";
import { render } from "../../utils/react-test";

it("renders correctly", () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/prev-next-link.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect, it } from "vitest";
import { PrevNextLink } from "./prev-next-link";
import React from "react";
import { render } from "../../utils/react-test";

it("renders both prev and next correctly", () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/questions.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect, it } from "vitest";
import { Questions } from "./questions";
import React from "react";
import { render } from "../../utils/react-test";

it("renders correctly", () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/sns-link.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect, it } from "vitest";
import React from "react";
import { SNSLink } from "./sns-link";
import { render } from "../../utils/react-test";

Expand Down
1 change: 1 addition & 0 deletions src/components/title.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Subtitle, Title } from "./title";
import { expect, it } from "vitest";
import React from "react";
import { render } from "../../utils/react-test";

it("renders title correctly", () => {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ function BlogCard({
parent,
}: Queries.BlogEntriesQuery["allMarkdownRemark"]["nodes"][number]): JSX.Element {
const title = frontmatter?.title ?? "無題";
// NOTE: it will be fixed in PR #395.
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
const slug = (parent as { name?: string })?.name!;
return (
<HStack borderColor="shadowed" borderRightWidth="1px" borderBottomWidth="2px">
Expand Down

0 comments on commit ecf6968

Please sign in to comment.