Skip to content

Commit 4b4b39d

Browse files
authored
refactor: fix typecheck errors and add script execution to CI (#1103)
* refactor: fix typecheck errors and add script execution to CI * ci: add `typecheck:ci` script
1 parent e2c5675 commit 4b4b39d

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: true
2222
matrix:
23-
script: [format, lint]
23+
script: ["format", "lint", "typecheck:ci"]
2424

2525
steps:
2626
- name: Checkout repo

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"now-build": "pnpm run build",
6767
"start": "next start",
6868
"typecheck": "tsc --noEmit",
69+
"typecheck:ci": "next build --no-lint && tsc --noEmit",
6970
"prepare": "husky install"
7071
},
7172
"lint-staged": {

src/components/BuilderPage.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Animate } from "react-simple-animate"
44
import { useForm } from "react-hook-form"
55
import SortableContainer from "./SortableContainer"
66
import { useStateMachine } from "little-state-machine"
7+
import type { GlobalState } from "little-state-machine"
78
import colors from "../styles/colors"
89
import generateCode from "./logic/generateCode"
910
import copyClipBoard from "./utils/copyClipBoard"
@@ -65,7 +66,7 @@ function BuilderPage({
6566
useForm()
6667
const errors = formState.errors
6768
const [editIndex, setEditIndex] = useState(-1)
68-
const copyFormData = useRef([])
69+
const copyFormData = useRef<GlobalState["formData"]>([])
6970
const closeButton = useRef<HTMLButtonElement>(null)
7071
const [showValidation, toggleValidation] = useState(false)
7172
const onSubmit = (data) => {
@@ -90,7 +91,7 @@ function BuilderPage({
9091
editFormData.minLength ||
9192
editFormData.required
9293
copyFormData.current = formData
93-
const editIndexRef = useRef(null)
94+
const editIndexRef = useRef<number | null>(null)
9495
editIndexRef.current = editIndex
9596
const router = useRouter()
9697

@@ -440,7 +441,7 @@ function BuilderPage({
440441
aria-label="close builder"
441442
ref={closeButton}
442443
onClick={() => {
443-
toggleBuilder(false)
444+
toggleBuilder?.(false)
444445
goToBuilder(false)
445446
}}
446447
>

src/components/mdx/theme.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// @ts-expect-error currently not being exported https://github.com/FormidableLabs/prism-react-renderer/issues/206
2-
import { PrismTheme } from "prism-react-renderer"
1+
import type { PrismTheme } from "prism-react-renderer"
32

43
export const theme: PrismTheme = {
54
plain: {

0 commit comments

Comments
 (0)