diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b0e12aac..54f52f9ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: true matrix: - script: [format, lint] + script: ["format", "lint", "typecheck:ci"] steps: - name: Checkout repo diff --git a/package.json b/package.json index 805556920..7c9892363 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "now-build": "pnpm run build", "start": "next start", "typecheck": "tsc --noEmit", + "typecheck:ci": "next build --no-lint && tsc --noEmit", "prepare": "husky install" }, "lint-staged": { diff --git a/src/components/BuilderPage.tsx b/src/components/BuilderPage.tsx index 008823291..f23d43e59 100644 --- a/src/components/BuilderPage.tsx +++ b/src/components/BuilderPage.tsx @@ -4,6 +4,7 @@ import { Animate } from "react-simple-animate" import { useForm } from "react-hook-form" import SortableContainer from "./SortableContainer" import { useStateMachine } from "little-state-machine" +import type { GlobalState } from "little-state-machine" import colors from "../styles/colors" import generateCode from "./logic/generateCode" import copyClipBoard from "./utils/copyClipBoard" @@ -65,7 +66,7 @@ function BuilderPage({ useForm() const errors = formState.errors const [editIndex, setEditIndex] = useState(-1) - const copyFormData = useRef([]) + const copyFormData = useRef([]) const closeButton = useRef(null) const [showValidation, toggleValidation] = useState(false) const onSubmit = (data) => { @@ -90,7 +91,7 @@ function BuilderPage({ editFormData.minLength || editFormData.required copyFormData.current = formData - const editIndexRef = useRef(null) + const editIndexRef = useRef(null) editIndexRef.current = editIndex const router = useRouter() @@ -440,7 +441,7 @@ function BuilderPage({ aria-label="close builder" ref={closeButton} onClick={() => { - toggleBuilder(false) + toggleBuilder?.(false) goToBuilder(false) }} > diff --git a/src/components/mdx/theme.ts b/src/components/mdx/theme.ts index 58b1ae55e..15d5c1690 100644 --- a/src/components/mdx/theme.ts +++ b/src/components/mdx/theme.ts @@ -1,5 +1,4 @@ -// @ts-expect-error currently not being exported https://github.com/FormidableLabs/prism-react-renderer/issues/206 -import { PrismTheme } from "prism-react-renderer" +import type { PrismTheme } from "prism-react-renderer" export const theme: PrismTheme = { plain: {