Fix some linting errors and warnings

This commit is contained in:
Ramon Wenger 2022-12-28 17:17:23 +01:00
parent f58b2f6303
commit a4a93a2214
7 changed files with 7 additions and 10 deletions

View File

@ -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;

View File

@ -1,7 +1,7 @@
import { useUserStore } from "@/stores/user";
import type { NavigationGuardWithThis, RouteLocationNormalized } from "vue-router";
export const updateLoggedIn: NavigationGuardWithThis<undefined> = async (_to) => {
export const updateLoggedIn: NavigationGuardWithThis<undefined> = async () => {
const loggedIn = getCookieValue("loginStatus") === "true";
const userStore = useUserStore();
@ -11,10 +11,7 @@ export const updateLoggedIn: NavigationGuardWithThis<undefined> = async (_to) =>
}
};
export const redirectToLoginIfRequired: NavigationGuardWithThis<undefined> = (
to,
_from
) => {
export const redirectToLoginIfRequired: NavigationGuardWithThis<undefined> = (to) => {
const userStore = useUserStore();
if (loginRequired(to) && !userStore.loggedIn) {
return `/login?next=${to.fullPath}`;

View File

@ -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;
});

View File

@ -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";

View File

@ -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 !== "") {

View File

@ -1,3 +1,3 @@
export function assertUnreachable(x: never): never {
export function assertUnreachable(): never {
throw new Error("Didn't expect to get here");
}