From 4dd0e420056fdebabb6b22c92222c449e059c2a8 Mon Sep 17 00:00:00 2001 From: Timo Date: Wed, 28 Aug 2024 01:30:51 +0200 Subject: [PATCH] fix more issues detected by knip --- knip.ts | 1 + package.json | 2 -- src/usePrevious.ts | 27 --------------------------- yarn.lock | 17 ----------------- 4 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 src/usePrevious.ts diff --git a/knip.ts b/knip.ts index 691d1876..becafc2e 100644 --- a/knip.ts +++ b/knip.ts @@ -24,6 +24,7 @@ export default { // then Knip will flag it as a false positive // https://github.com/webpro-nl/knip/issues/766 "@vector-im/compound-web", + "matrix-widget-api", ], ignoreExportsUsedInFile: true, } satisfies KnipConfig; diff --git a/package.json b/package.json index cbb4574e..fa2e6bb8 100644 --- a/package.json +++ b/package.json @@ -66,8 +66,6 @@ "@testing-library/react": "^16.0.0", "@testing-library/user-event": "^14.5.1", "@types/content-type": "^1.1.5", - "@types/dom-screen-wake-lock": "^1.0.1", - "@types/dompurify": "^3.0.2", "@types/grecaptcha": "^3.0.9", "@types/lodash": "^4.14.199", "@types/node": "^20.0.0", diff --git a/src/usePrevious.ts b/src/usePrevious.ts deleted file mode 100644 index b298c10e..00000000 --- a/src/usePrevious.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2023 New Vector Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { useRef } from "react"; - -/** - * React hook that returns the value given on the previous render. - */ -export function usePrevious(value: T): T | undefined { - const ref = useRef(); - const previous = ref.current; - ref.current = value; - return previous; -} diff --git a/yarn.lock b/yarn.lock index e37e205f..9c97f098 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3316,18 +3316,6 @@ resolved "https://registry.yarnpkg.com/@types/content-type/-/content-type-1.1.8.tgz#319644d07ee6b4bfc734483008393b89b99f0219" integrity sha512-1tBhmVUeso3+ahfyaKluXe38p+94lovUZdoVfQ3OnJo9uJC42JT7CBoN3k9HYhAae+GwiBYmHu+N9FZhOG+2Pg== -"@types/dom-screen-wake-lock@^1.0.1": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@types/dom-screen-wake-lock/-/dom-screen-wake-lock-1.0.3.tgz#c3588a5f6f40fae957f9ce5be9bc4927a61bb9a0" - integrity sha512-3Iten7X3Zgwvk6kh6/NRdwN7WbZ760YgFCsF5AxDifltUQzW1RaW+WRmcVtgwFzLjaNu64H+0MPJ13yRa8g3Dw== - -"@types/dompurify@^3.0.2": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@types/dompurify/-/dompurify-3.0.5.tgz#02069a2fcb89a163bacf1a788f73cb415dd75cb7" - integrity sha512-1Wg0g3BtQF7sSb27fJQAKck1HECM6zV1EB66j8JH9i3LCjYabJa0FSdiSgsD5K/RbrsR0SiraKacLB+T8ZVYAg== - dependencies: - "@types/trusted-types" "*" - "@types/estree@1.0.5", "@types/estree@^1.0.0": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" @@ -3434,11 +3422,6 @@ resolved "https://registry.yarnpkg.com/@types/symlink-or-copy/-/symlink-or-copy-1.2.2.tgz#51b1c00b516a5774ada5d611e65eb123f988ef8d" integrity sha512-MQ1AnmTLOncwEf9IVU+B2e4Hchrku5N67NkgcAHW0p3sdzPe0FNMANxEm6OJUzPniEQGkeT3OROLlCwZJLWFZA== -"@types/trusted-types@*": - version "2.0.7" - resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11" - integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw== - "@types/uuid@10": version "10.0.0" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d"