From 3960e5997892b78f06b3b6c2e41ecdb6a7a671ab Mon Sep 17 00:00:00 2001 From: canisminor1990 Date: Mon, 6 Jan 2025 18:18:43 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Fix=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/pre-commit | 2 ++ package.json | 22 +++++++++++----------- src/react/hooks/useAudioPlayer.ts | 2 +- src/react/hooks/useStreamAudioPlayer.ts | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 7e617c2..72d291e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,5 @@ #!/usr/bin/env sh +npm run type-check +npm run lint:circular npx --no-install lint-staged diff --git a/package.json b/package.json index 6bd147e..f958bdf 100644 --- a/package.json +++ b/package.json @@ -77,28 +77,28 @@ "unist-util-visit": "^5.0.0" }, "devDependencies": { - "@commitlint/cli": "^19.6.0", - "@lobehub/i18n-cli": "^1.20.1", + "@commitlint/cli": "^19.6.1", + "@lobehub/i18n-cli": "^1.20.3", "@lobehub/lint": "^1.24.4", "@types/lodash-es": "^4.17.12", - "@types/node": "^20.17.7", - "@types/react": "18.2.40", - "@types/react-dom": "^18.3.1", + "@types/node": "^20.17.11", + "@types/react": "^19.0.2", + "@types/react-dom": "^19.0.2", "@types/uuid": "^9.0.8", - "@vercel/node": "^3.2.26", + "@vercel/node": "^3.2.29", "@vitest/coverage-v8": "~1.2.2", "babel-plugin-antd-style": "^1.0.4", "clean-package": "^2.2.0", - "commitlint": "^19.6.0", - "concurrently": "^9.1.0", + "commitlint": "^19.6.1", + "concurrently": "^9.1.2", "dpdm": "^3.14.0", - "dumi": "^2.4.14", + "dumi": "^2.4.17", "dumi-theme-lobehub": "^1.11.0", "eslint": "^8.57.1", "father": "^4.5.1", "husky": "^9.1.7", - "lint-staged": "^15.2.10", - "prettier": "^3.3.3", + "lint-staged": "^15.3.0", + "prettier": "^3.4.2", "remark": "^14.0.3", "remark-cli": "^11.0.0", "semantic-release": "^21.1.2", diff --git a/src/react/hooks/useAudioPlayer.ts b/src/react/hooks/useAudioPlayer.ts index 4c26182..b740429 100644 --- a/src/react/hooks/useAudioPlayer.ts +++ b/src/react/hooks/useAudioPlayer.ts @@ -21,7 +21,7 @@ export const useAudioPlayer = ({ src, type = 'audio/mp3', }: AudioPlayerOptions = {}): AudioPlayerResponse => { - const audioRef = useRef(); + const audioRef = useRef(null); const [arrayBuffers, setArrayBuffers] = useState([]); const [currentTime, setCurrentTime] = useState(0); const [duration, setDuration] = useState(0); diff --git a/src/react/hooks/useStreamAudioPlayer.ts b/src/react/hooks/useStreamAudioPlayer.ts index d42ab90..b3ce92b 100644 --- a/src/react/hooks/useStreamAudioPlayer.ts +++ b/src/react/hooks/useStreamAudioPlayer.ts @@ -12,7 +12,7 @@ export interface StreamAudioPlayerResponse extends AudioProps { } export const useStreamAudioPlayer = (): StreamAudioPlayerResponse => { - const audioRef = useRef(); + const audioRef = useRef(null); const [arrayBuffers, setArrayBuffers] = useState([]); const [currentTime, setCurrentTime] = useState(0); const [duration, setDuration] = useState(0);