From 5999e1b99d5942ad8eb6f653d2dd5621e40dea38 Mon Sep 17 00:00:00 2001 From: iorate <682043+iorate@users.noreply.github.com> Date: Sun, 22 Sep 2024 18:58:29 +0900 Subject: [PATCH] website: strict type check --- website/src/pages/subscribe.tsx | 10 ++++++---- website/tsconfig.json | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/website/src/pages/subscribe.tsx b/website/src/pages/subscribe.tsx index 929f89d73..6bfcf26b6 100644 --- a/website/src/pages/subscribe.tsx +++ b/website/src/pages/subscribe.tsx @@ -6,11 +6,13 @@ const Subscribe: React.FC = () => { "chrome-extension://pncfbmialoiaghdehhbnbhkkgmjanfhe/pages/options.html", ); const query = new URL(window.location.href).searchParams; - if (query.has("name")) { - optionsURL.searchParams.set("addSubscriptionName", query.get("name")); + const name = query.get("name"); + if (name != null) { + optionsURL.searchParams.set("addSubscriptionName", name); } - if (query.has("url")) { - optionsURL.searchParams.set("addSubscriptionURL", query.get("url")); + const url = query.get("url"); + if (url != null) { + optionsURL.searchParams.set("addSubscriptionURL", url); } window.location.href = optionsURL.toString(); }, []); diff --git a/website/tsconfig.json b/website/tsconfig.json index fae2c2390..5b1249385 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -1,3 +1,4 @@ { - "extends": "@docusaurus/tsconfig" + "extends": ["../tsconfig.json", "@docusaurus/tsconfig"], + "exclude": [".docusaurus", "build"] }