Skip to content

Commit ba8ff72

Browse files
committed
fix typescript a bit
1 parent 7415533 commit ba8ff72

19 files changed

Lines changed: 47 additions & 58 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
install:
2-
bun
2+
bun install
33

44
build:
55
bun build

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"linter": {
88
"enabled": true,
99
"rules": {
10-
"recommended": false,
10+
"recommended": true,
1111
"complexity": {
1212
"noExtraBooleanCast": "error",
1313
"noMultipleSpacesInRegularExpressionLiterals": "error",
@@ -68,6 +68,7 @@
6868
"ignore": ["./node_modules/*", "./.next/*", "./out/*"]
6969
},
7070
"javascript": {
71+
"jsxRuntime": "transparent",
7172
"formatter": { "quoteStyle": "double" },
7273
"globals": ["React"]
7374
},

bun.lockb

24 Bytes
Binary file not shown.

next.config.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
module.exports = {
2-
typescript: {
3-
// !! WARN !!
4-
// Dangerously allow production builds to successfully complete even if
5-
// your project has type errors.
6-
// !! WARN !!
7-
ignoreBuildErrors: true,
8-
},
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
3+
output: "export",
4+
// typescript: {
5+
// ignoreBuildErrors: true,
6+
// },
97
};
8+
module.exports = nextConfig;

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"dependencies": {
1212
"@emotion/react": "^11.13.3",
1313
"@opentelemetry/api": "^1.9.0",
14+
"@theme-ui/components": "^0.16.2",
1415
"date-fns": "^4.1.0",
1516
"next": "13.5.6",
1617
"react": "^18.2.0",
@@ -19,14 +20,14 @@
1920
},
2021
"scripts": {
2122
"dev": "next dev",
22-
"lint-fix": "prettier ./src --write && eslint ./src --fix",
23-
"build": "next build && next export",
23+
"lint-fix": "bun biome format --write && bun biome lint && tsc --noemit",
24+
"build": "next build",
2425
"start": "next start"
2526
},
2627
"devDependencies": {
2728
"@biomejs/biome": "1.9.3",
2829
"@types/node": "^20.8.9",
29-
"@types/react": "^18.2.32",
30+
"@types/react": "^18.3.11",
3031
"typescript": "^5.6.3"
3132
}
3233
}

src/components/avatar.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
/** @jsxRuntime classic */
2-
/** @jsx jsx */
3-
import { Box, jsx } from "theme-ui";
4-
1+
import { Box, type BoxProps } from "theme-ui";
52
import { Image } from "~/components/image";
3+
import type { FC } from "react";
64

7-
type Props = {
5+
type Props = Omit<BoxProps, "src"> & {
86
src: string;
97
};
108

11-
export const Avatar: React.FC<Props> = ({ src, ...props }) => (
9+
export const Avatar: FC<Props> = ({ src, ...props }) => (
1210
<Box
1311
sx={{
1412
width: ["8rem", "14.4rem"],

src/components/external-link-icon.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/** @jsxRuntime classic */
2-
/** @jsx jsx */
3-
import { jsx } from "theme-ui";
4-
51
export const ExternalLinkIcon: React.FC = (props) => (
62
<svg
73
width="1.8rem"
@@ -11,6 +7,7 @@ export const ExternalLinkIcon: React.FC = (props) => (
117
sx={{ display: "inline-block", ml: ".5rem" }}
128
{...props}
139
>
10+
<title>External Link Icon</title>
1411
<path d="M40.5 24H3V72H51V33" stroke="black" strokeWidth="5" />
1512
<path
1613
d="M65.4973 9.88384C65.4332 8.50462 64.2631 7.43855 62.8839 7.5027L40.4082 8.54808C39.0289 8.61223 37.9629 9.78231 38.027 11.1615C38.0912 12.5408 39.2612 13.6068 40.6405 13.5427L60.6189 12.6134L61.5481 32.5919C61.6122 33.9711 62.7823 35.0371 64.1615 34.973C65.5408 34.9088 66.6068 33.7388 66.5427 32.3595L65.4973 9.88384ZM23.848 56.6837L64.848 11.6837L61.152 8.31627L20.152 53.3163L23.848 56.6837Z"

src/components/footer.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
/** @jsxRuntime classic */
2-
/** @jsx jsx */
3-
4-
import { Box, Container, jsx } from "theme-ui";
5-
1+
/** @jsxImportSource theme-ui */
2+
import { Box, Container, Link } from "theme-ui";
63
import { Image } from "~/components/image";
7-
84
import { Wave } from "./wave";
95

106
const SOCIALS = [
@@ -44,7 +40,8 @@ export const Footer = () => (
4440
<Wave invert />
4541
<Container>
4642
{SOCIALS.map((social) => (
47-
<a
43+
<Link
44+
as="a"
4845
sx={{ mx: "secondary" }}
4946
target="_blank"
5047
rel="noopener noreferrer"
@@ -57,7 +54,7 @@ export const Footer = () => (
5754
src={social.icon}
5855
alt={social.name}
5956
/>
60-
</a>
57+
</Link>
6158
))}
6259
</Container>
6360
</Box>

src/components/header.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { MouseEvent, useCallback } from "react";
1+
import { type MouseEvent, useCallback } from "react";
22
import { Box, Container, Flex, NavLink } from "theme-ui";
33

44
import { Logo } from "./logo";
55

6-
const MenuLink: React.FC<{ href: string }> = ({ href, children }) => {
6+
type LinkComponent = React.FC<{ href: string; children: React.ReactNode }>;
7+
8+
const MenuLink: LinkComponent = ({ href, children }) => {
79
const goToSection = useCallback(
810
(e: MouseEvent) => {
911
e.preventDefault();
@@ -26,7 +28,8 @@ const MenuLink: React.FC<{ href: string }> = ({ href, children }) => {
2628
return (
2729
<NavLink
2830
sx={{
29-
background: `linear-gradient(0deg, #fff .2rem,transparent 0) no-repeat 50%`,
31+
background:
32+
"linear-gradient(0deg, #fff .2rem,transparent 0) no-repeat 50%",
3033
transition: "background-size .3s cubic-bezier(.165,.84,.44,1)",
3134
backgroundSize: "0 100%",
3235
p: ".4rem",
@@ -44,7 +47,7 @@ const MenuLink: React.FC<{ href: string }> = ({ href, children }) => {
4447
);
4548
};
4649

47-
const MenuButton: React.FC<{ href: string }> = ({ children, href }) => (
50+
const MenuButton: LinkComponent = ({ children, href }) => (
4851
<Box
4952
sx={{
5053
perspective: "24rem",
@@ -77,10 +80,7 @@ const MenuButton: React.FC<{ href: string }> = ({ children, href }) => (
7780
</Box>
7881
);
7982

80-
export const ContentButton: React.FC<{ href: string }> = ({
81-
children,
82-
href,
83-
}) => (
83+
export const ContentButton: LinkComponent = ({ children, href }) => (
8484
<Box
8585
sx={{
8686
perspective: "24rem",

src/components/image.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsxRuntime classic */
22
/** @jsx jsx */
3-
import React from "react";
3+
import type React from "react";
44
import { jsx } from "theme-ui";
55

66
type Props = {

0 commit comments

Comments
 (0)