From a4a93a221428509a291d0c1526c81bed4e8737ed Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Wed, 28 Dec 2022 17:17:23 +0100 Subject: [PATCH] Fix some linting errors and warnings --- client/src/components/{Feedback.vue => FeedbackForm.vue} | 0 client/src/pages/cockpit/CockpitIndexPage.vue | 2 +- client/src/router/guards.ts | 7 ++----- client/src/router/index.ts | 2 +- client/src/stores/courseSessions.ts | 2 +- client/src/stores/user.ts | 2 +- client/src/utils/utils.ts | 2 +- 7 files changed, 7 insertions(+), 10 deletions(-) rename client/src/components/{Feedback.vue => FeedbackForm.vue} (100%) diff --git a/client/src/components/Feedback.vue b/client/src/components/FeedbackForm.vue similarity index 100% rename from client/src/components/Feedback.vue rename to client/src/components/FeedbackForm.vue diff --git a/client/src/pages/cockpit/CockpitIndexPage.vue b/client/src/pages/cockpit/CockpitIndexPage.vue index 35202cb2..8b05ba8e 100644 --- a/client/src/pages/cockpit/CockpitIndexPage.vue +++ b/client/src/pages/cockpit/CockpitIndexPage.vue @@ -7,7 +7,7 @@ import type { LearningPath } from "@/services/learningPath"; import { useCockpitStore } from "@/stores/cockpit"; import { useCompetenceStore } from "@/stores/competence"; import { useLearningPathStore } from "@/stores/learningPath"; -import * as log from "loglevel"; +import log from "loglevel"; const props = defineProps<{ courseSlug: string; diff --git a/client/src/router/guards.ts b/client/src/router/guards.ts index 52b76999..e4902f33 100644 --- a/client/src/router/guards.ts +++ b/client/src/router/guards.ts @@ -1,7 +1,7 @@ import { useUserStore } from "@/stores/user"; import type { NavigationGuardWithThis, RouteLocationNormalized } from "vue-router"; -export const updateLoggedIn: NavigationGuardWithThis = async (_to) => { +export const updateLoggedIn: NavigationGuardWithThis = async () => { const loggedIn = getCookieValue("loginStatus") === "true"; const userStore = useUserStore(); @@ -11,10 +11,7 @@ export const updateLoggedIn: NavigationGuardWithThis = async (_to) => } }; -export const redirectToLoginIfRequired: NavigationGuardWithThis = ( - to, - _from -) => { +export const redirectToLoginIfRequired: NavigationGuardWithThis = (to) => { const userStore = useUserStore(); if (loginRequired(to) && !userStore.loggedIn) { return `/login?next=${to.fullPath}`; diff --git a/client/src/router/index.ts b/client/src/router/index.ts index 89f19128..4f6ecbae 100644 --- a/client/src/router/index.ts +++ b/client/src/router/index.ts @@ -154,7 +154,7 @@ const router = createRouter({ router.beforeEach(updateLoggedIn); router.beforeEach(redirectToLoginIfRequired); -router.afterEach((to, from) => { +router.afterEach(() => { const appStore = useAppStore(); appStore.routingFinished = true; }); diff --git a/client/src/stores/courseSessions.ts b/client/src/stores/courseSessions.ts index a78a78c8..b83ff06b 100644 --- a/client/src/stores/courseSessions.ts +++ b/client/src/stores/courseSessions.ts @@ -1,5 +1,5 @@ import { itGetCached } from "@/fetchHelpers"; -import type { CircleExpert, Course, CourseSession } from "@/types"; +import type { CourseSession } from "@/types"; import _ from "lodash"; import log from "loglevel"; diff --git a/client/src/stores/user.ts b/client/src/stores/user.ts index 6f5d2f6c..7fdad794 100644 --- a/client/src/stores/user.ts +++ b/client/src/stores/user.ts @@ -60,7 +60,7 @@ export const useUserStore = defineStore({ handleLogout() { Object.assign(this, initialUserState); - itPost("/api/core/logout/", {}).then((data) => { + itPost("/api/core/logout/", {}).then(() => { let redirectUrl; if (logoutRedirectUrl !== "") { diff --git a/client/src/utils/utils.ts b/client/src/utils/utils.ts index 966499f3..c6a55326 100644 --- a/client/src/utils/utils.ts +++ b/client/src/utils/utils.ts @@ -1,3 +1,3 @@ -export function assertUnreachable(x: never): never { +export function assertUnreachable(): never { throw new Error("Didn't expect to get here"); }