Fixed eslint errors
This commit is contained in:
parent
abe3a4387c
commit
0f85be0cb8
@ -3,7 +3,7 @@
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parser": "vue-eslint-parser",
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
@ -15,10 +15,13 @@
|
||||
"rules": {
|
||||
"vue/multi-word-component-names": "off",
|
||||
"vue/no-reserved-component-names": "warn",
|
||||
"vue/no-mutating-props": "warn"
|
||||
"vue/no-mutating-props": "warn",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off"
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
"sourceType": "module",
|
||||
"parser": "@typescript-eslint/parser"
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ export const useFileStore = defineStore("file", {
|
||||
this.req = value;
|
||||
},
|
||||
removeSelected(value: any) {
|
||||
let i = this.selected.indexOf(value);
|
||||
const i = this.selected.indexOf(value);
|
||||
if (i === -1) return;
|
||||
this.selected.splice(i, 1);
|
||||
},
|
||||
|
||||
@ -7,7 +7,7 @@ export const useLayoutStore = defineStore("layout", {
|
||||
state: (): {
|
||||
loading: boolean,
|
||||
show: string | null | boolean,
|
||||
showConfirm: Function | null,
|
||||
showConfirm: any,
|
||||
showAction: boolean | null,
|
||||
showShell: boolean | null
|
||||
} => ({
|
||||
|
||||
@ -50,7 +50,7 @@ export const useUploadStore = defineStore("upload", {
|
||||
filesInUpload: (state) => {
|
||||
const files = [];
|
||||
|
||||
for (let index in state.uploads) {
|
||||
for (const index in state.uploads) {
|
||||
const upload = state.uploads[index];
|
||||
const id = upload.id;
|
||||
const type = upload.type;
|
||||
|
||||
3
frontend/src/types/global.d.ts
vendored
3
frontend/src/types/global.d.ts
vendored
@ -5,7 +5,4 @@ declare global {
|
||||
FileBrowser: any;
|
||||
grecaptcha: any
|
||||
}
|
||||
interface HTMLAttributes extends HTMLAttributes {
|
||||
title: any
|
||||
}
|
||||
}
|
||||
@ -22,7 +22,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, defineAsyncComponent, onBeforeUnmount, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
import { files as api } from "@/api";
|
||||
import { mapState, mapActions, mapWritableState } from "pinia";
|
||||
import { useFileStore } from "@/stores/file";
|
||||
import { useLayoutStore } from "@/stores/layout";
|
||||
import { useUploadStore } from "@/stores/upload";
|
||||
@ -30,8 +29,6 @@ import { useUploadStore } from "@/stores/upload";
|
||||
import HeaderBar from "@/components/header/HeaderBar.vue";
|
||||
import Breadcrumbs from "@/components/Breadcrumbs.vue";
|
||||
import Errors from "@/views/Errors.vue";
|
||||
import Preview from "@/views/files/Preview.vue";
|
||||
import FileListing from "@/views/files/FileListing.vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { pub as api, files } from "@/api";
|
||||
import { pub as api } from "@/api";
|
||||
import { filesize } from "filesize";
|
||||
import dayjs from "dayjs";
|
||||
import { Base64 } from "js-base64";
|
||||
@ -154,16 +154,13 @@ const route = useRoute()
|
||||
const fileStore = useFileStore()
|
||||
const layoutStore = useLayoutStore()
|
||||
|
||||
watch(route, (newValue, oldValue) => {
|
||||
watch(route, () => {
|
||||
showLimit.value = 100
|
||||
fetchData();
|
||||
})
|
||||
|
||||
const req = computed(() => fileStore.req)
|
||||
|
||||
// inject: ["$showSuccess"],
|
||||
|
||||
|
||||
// Define computes
|
||||
|
||||
const icon = computed(() => {
|
||||
@ -209,8 +206,8 @@ const fetchData = async () => {
|
||||
try {
|
||||
let file = await api.fetch(url, password.value);
|
||||
file.hash = hash.value;
|
||||
|
||||
|
||||
|
||||
|
||||
token.value = file.token || "";
|
||||
|
||||
fileStore.updateRequest(file);
|
||||
@ -283,16 +280,16 @@ onMounted(async () => {
|
||||
await fetchData();
|
||||
|
||||
|
||||
// window.addEventListener("keydown", this.keyEvent);
|
||||
// this.clip = new Clipboard(".copy-clipboard");
|
||||
// this.clip.on("success", () => {
|
||||
// this.$showSuccess(this.t("success.linkCopied"));
|
||||
// });
|
||||
window.addEventListener("keydown", keyEvent);
|
||||
clip.value = new Clipboard(".copy-clipboard");
|
||||
clip.value.on("success", () => {
|
||||
// $showSuccess(this.t("success.linkCopied"));
|
||||
});
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
// window.removeEventListener("keydown", this.keyEvent);
|
||||
// this.clip.destroy();
|
||||
window.removeEventListener("keydown", keyEvent);
|
||||
clip.value.destroy();
|
||||
})
|
||||
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user