From d3a10b062d0a04a0e5ca21a8bc5d8683b209cdbe Mon Sep 17 00:00:00 2001 From: Imbus Date: Mon, 13 Nov 2023 12:00:46 +0100 Subject: [PATCH] Enforced actual types in typescript --- client-solid/.eslintrc.cjs | 3 +++ client-solid/src/Icons.tsx | 4 +++- client-solid/src/LoginModal.tsx | 6 +++--- client-solid/src/Navbar.tsx | 12 ++++++------ client-solid/src/NewPost.tsx | 19 +++++++++++-------- client-solid/src/Posts.tsx | 13 +++++++------ client-solid/src/Primary.tsx | 3 ++- client-solid/src/RegLogin/Login.tsx | 16 ++++++++-------- client-solid/src/RegLogin/Register.tsx | 14 +++++++------- client-solid/src/Root.tsx | 4 ++-- client-solid/src/SinglePost.tsx | 4 ++-- 11 files changed, 54 insertions(+), 44 deletions(-) diff --git a/client-solid/.eslintrc.cjs b/client-solid/.eslintrc.cjs index c8102e3..4271642 100644 --- a/client-solid/.eslintrc.cjs +++ b/client-solid/.eslintrc.cjs @@ -4,4 +4,7 @@ module.exports = { parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint'], root: true, + "rules": { + "@typescript-eslint/explicit-function-return-type": "warn" + } }; diff --git a/client-solid/src/Icons.tsx b/client-solid/src/Icons.tsx index b4ce6fb..9384b96 100644 --- a/client-solid/src/Icons.tsx +++ b/client-solid/src/Icons.tsx @@ -1,4 +1,6 @@ -export function Arrow() { +import { JSXElement } from "solid-js"; + +export function Arrow(): JSXElement { return ( { + const closeModal = (): void => { modal_ctx.setLoginModalOpen(false); }; diff --git a/client-solid/src/Navbar.tsx b/client-solid/src/Navbar.tsx index 8e9285d..ac6675d 100644 --- a/client-solid/src/Navbar.tsx +++ b/client-solid/src/Navbar.tsx @@ -4,7 +4,7 @@ import { LoginContext } from "./Root"; import { ModalContext } from "./Root"; // Represents a single list item in the menu bar -function MenuItem(props: { href: string; children: JSXElement }) { +function MenuItem(props: { href: string; children: JSXElement }): JSXElement { return (
  • @@ -15,7 +15,7 @@ function MenuItem(props: { href: string; children: JSXElement }) { } // Represents the menu bar at the top of the page -function Menu() { +function Menu(): JSXElement { const login_ctx = useContext(LoginContext); return (