Fix eslint warnings
This commit is contained in:
parent
38db04f8ae
commit
6a7a1eef0c
@ -11,8 +11,12 @@
|
|||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"vue/multi-word-component-names": "off",
|
"vue/multi-word-component-names": "off",
|
||||||
"vue/no-reserved-component-names": "warn",
|
"vue/no-mutating-props": [
|
||||||
"vue/no-mutating-props": "warn"
|
"error",
|
||||||
|
{
|
||||||
|
"shallowOnly": true
|
||||||
|
}
|
||||||
|
]
|
||||||
// no-undef is already included in
|
// no-undef is already included in
|
||||||
// @vue/eslint-config-typescript
|
// @vue/eslint-config-typescript
|
||||||
},
|
},
|
||||||
|
|||||||
@ -16,6 +16,7 @@ defineProps<{
|
|||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
(e: "update:theme", val: string | null): void;
|
(e: "update:theme", val: string | null): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
|||||||
@ -114,17 +114,17 @@ export function detectLocale() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: was this really necessary?
|
// TODO: was this really necessary?
|
||||||
function removeEmpty(obj: Record<string, any>): void {
|
// function removeEmpty(obj: Record<string, any>): void {
|
||||||
Object.keys(obj)
|
// Object.keys(obj)
|
||||||
.filter((k) => obj[k] !== null && obj[k] !== undefined && obj[k] !== "") // Remove undef. and null and empty.string.
|
// .filter((k) => obj[k] !== null && obj[k] !== undefined && obj[k] !== "") // Remove undef. and null and empty.string.
|
||||||
.reduce(
|
// .reduce(
|
||||||
(newObj, k) =>
|
// (newObj, k) =>
|
||||||
typeof obj[k] === "object"
|
// typeof obj[k] === "object"
|
||||||
? Object.assign(newObj, { [k]: removeEmpty(obj[k]) }) // Recurse.
|
// ? Object.assign(newObj, { [k]: removeEmpty(obj[k]) }) // Recurse.
|
||||||
: Object.assign(newObj, { [k]: obj[k] }), // Copy value.
|
// : Object.assign(newObj, { [k]: obj[k] }), // Copy value.
|
||||||
{}
|
// {}
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
export const rtlLanguages = ["he", "ar"];
|
export const rtlLanguages = ["he", "ar"];
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import Shares from "@/views/settings/Shares.vue";
|
|||||||
import Errors from "@/views/Errors.vue";
|
import Errors from "@/views/Errors.vue";
|
||||||
import { useAuthStore } from "@/stores/auth";
|
import { useAuthStore } from "@/stores/auth";
|
||||||
import { baseURL, name } from "@/utils/constants";
|
import { baseURL, name } from "@/utils/constants";
|
||||||
import { i18n, isRtl, rtlLanguages } from "@/i18n";
|
import i18n from "@/i18n";
|
||||||
import { recaptcha, loginPage } from "@/utils/constants";
|
import { recaptcha, loginPage } from "@/utils/constants";
|
||||||
import { login, validateLogin } from "@/utils/auth";
|
import { login, validateLogin } from "@/utils/auth";
|
||||||
|
|
||||||
@ -177,13 +177,7 @@ const router = createRouter({
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.beforeResolve(async (to, from, next) => {
|
router.beforeResolve(async (to, from, next) => {
|
||||||
let title;
|
const title = i18n.global.t(titles[to.name as keyof typeof titles]);
|
||||||
try {
|
|
||||||
title = i18n.global.t(titles[to.name as keyof typeof titles]);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
// const title = titles[to.name];
|
|
||||||
document.title = title + " - " + name;
|
document.title = title + " - " + name;
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import i18n, { detectLocale, setLocale } from "@/i18n";
|
import { detectLocale, setLocale } from "@/i18n";
|
||||||
import { cloneDeep } from "lodash-es";
|
import { cloneDeep } from "lodash-es";
|
||||||
|
|
||||||
export const useAuthStore = defineStore("auth", {
|
export const useAuthStore = defineStore("auth", {
|
||||||
|
|||||||
@ -82,7 +82,6 @@ import { users as api } from "@/api";
|
|||||||
import Languages from "@/components/settings/Languages.vue";
|
import Languages from "@/components/settings/Languages.vue";
|
||||||
import { computed, inject, onMounted, ref } from "vue";
|
import { computed, inject, onMounted, ref } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import i18n, { rtlLanguages } from "@/i18n";
|
|
||||||
|
|
||||||
const layoutStore = useLayoutStore();
|
const layoutStore = useLayoutStore();
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user