diff --git a/src/data/honkai3rd/battlesuits.ts b/src/data/honkai3rd/battlesuits.ts index 4ea155b8..c82f1cd6 100644 --- a/src/data/honkai3rd/battlesuits.ts +++ b/src/data/honkai3rd/battlesuits.ts @@ -1,5 +1,4 @@ -import fs from 'fs' -import { readdirSync, readJsonFileSync, resolvePathname } from '../../lib/data' +import { readdirSync, readJsonFileSync } from '../../lib/data' export interface BattlesuitSkill { name: string diff --git a/src/pages/honkai3rd/stigmata/[stigmataId].tsx b/src/pages/honkai3rd/stigmata/[stigmataId].tsx index 3cac6b9d..6b1a7ff4 100644 --- a/src/pages/honkai3rd/stigmata/[stigmataId].tsx +++ b/src/pages/honkai3rd/stigmata/[stigmataId].tsx @@ -1,11 +1,5 @@ -import { - NavLink, - Box, - Card, - Heading, - Text, - Paragraph, -} from '@theme-ui/components' +import { NavLink, Box, Heading, Text, Paragraph } from '@theme-ui/components' +import { NextPageContext } from 'next' import Link from 'next/link' import React from 'react' import { @@ -101,16 +95,18 @@ const StigmataListPage = ({ export default StigmataListPage -export async function getStaticProps(ctx) { - const stigmataData = getStigmataById(ctx.params.stigmataId) +export async function getStaticProps( + ctx: NextPageContext & { params: { stigmataId: string } } +) { + const stigmataData = getStigmataById(ctx.params.stigmataId)! return { props: { stigmataData: stigmataData, - stigmataSetList: getStigmataListBySetId(stigmataData.set).sort( + stigmataSetList: (getStigmataListBySetId(stigmataData.set!) || []).sort( (a, b) => -a.type.localeCompare(b.type) ), - stigmataSet: getStigmataSetBySetId(stigmataData.set) || null, + stigmataSet: getStigmataSetBySetId(stigmataData.set!) || null, }, } } diff --git a/src/pages/honkai3rd/stigmata/index.tsx b/src/pages/honkai3rd/stigmata/index.tsx index 8ea6596c..ecfbc3c7 100644 --- a/src/pages/honkai3rd/stigmata/index.tsx +++ b/src/pages/honkai3rd/stigmata/index.tsx @@ -1,5 +1,5 @@ /** @jsxImportSource theme-ui */ -import { Text, NavLink, Box, Heading, Flex, Link } from '@theme-ui/components' +import { Text, Box, Heading, Flex, Link } from '@theme-ui/components' import NextLink from 'next/link' import Breadcrumb from '../../../components/organisms/Breadcrumb' import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator' diff --git a/tsconfig.json b/tsconfig.json index 6db37c02..e4d1b438 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,11 @@ { "compilerOptions": { "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, - "strict": false, + "strict": true, + "noUnusedLocals": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "incremental": true, @@ -19,12 +16,6 @@ "isolatedModules": true, "jsx": "preserve" }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "node_modules" - ] + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] }