diff --git a/webapp/eslint.config.js b/webapp/eslint.config.js index 9a2aaecb7..94f27454c 100644 --- a/webapp/eslint.config.js +++ b/webapp/eslint.config.js @@ -1,22 +1,12 @@ /* eslint-env node */ -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -import { FlatCompat } from "@eslint/eslintrc"; import js from "@eslint/js"; import pluginVue from 'eslint-plugin-vue' - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, -}); +import vueTsEslintConfig from '@vue/eslint-config-typescript' export default [ js.configs.recommended, ...pluginVue.configs['flat/essential'], - ...compat.extends("@vue/eslint-config-typescript/recommended"), + ...vueTsEslintConfig(), { files: [ "**/*.vue", diff --git a/webapp/src/components/NavBar.vue b/webapp/src/components/NavBar.vue index fc880b048..2cae5d09c 100644 --- a/webapp/src/components/NavBar.vue +++ b/webapp/src/components/NavBar.vue @@ -216,7 +216,9 @@ export default defineComponent({ this.$router.push('/'); }, onClick() { - this.$refs.navbarCollapse && (this.$refs.navbarCollapse as HTMLElement).classList.remove('show'); + if (this.$refs.navbarCollapse) { + (this.$refs.navbarCollapse as HTMLElement).classList.remove('show'); + } }, getEasterSunday(year: number): Date { const f = Math.floor; diff --git a/webapp/src/types/PinMapping.ts b/webapp/src/types/PinMapping.ts index 8b3b7651f..9ec1bd07d 100644 --- a/webapp/src/types/PinMapping.ts +++ b/webapp/src/types/PinMapping.ts @@ -48,4 +48,4 @@ export interface Device { display: Display; } -export interface PinMapping extends Array {} +export type PinMapping = Array; diff --git a/webapp/src/views/ConsoleInfoView.vue b/webapp/src/views/ConsoleInfoView.vue index 745badd17..44feb07e4 100644 --- a/webapp/src/views/ConsoleInfoView.vue +++ b/webapp/src/views/ConsoleInfoView.vue @@ -84,7 +84,7 @@ export default defineComponent({ this.socket.onmessage = (event) => { console.log(event); - let outstr = new String(event.data); + let outstr = String(event.data); let removedNewline = false; if (outstr.endsWith('\n')) { outstr = outstr.substring(0, outstr.length - 1); @@ -108,7 +108,9 @@ export default defineComponent({ }, // Send heartbeat packets regularly * 59s Send a heartbeat heartCheck() { - this.heartInterval && clearTimeout(this.heartInterval); + if (this.heartInterval) { + clearTimeout(this.heartInterval); + } this.heartInterval = setInterval(() => { if (this.socket.readyState === 1) { // Connection status @@ -126,7 +128,9 @@ export default defineComponent({ // continue regardless of error } - this.heartInterval && clearTimeout(this.heartInterval); + if (this.heartInterval) { + clearTimeout(this.heartInterval); + } }, getOutDate(): string { const u = new Date(); diff --git a/webapp/src/views/HomeView.vue b/webapp/src/views/HomeView.vue index ef8fa8ef2..94c23693f 100644 --- a/webapp/src/views/HomeView.vue +++ b/webapp/src/views/HomeView.vue @@ -734,7 +734,9 @@ export default defineComponent({ }, // Send heartbeat packets regularly * 59s Send a heartbeat heartCheck(duration: number = 59) { - this.heartInterval && clearTimeout(this.heartInterval); + if (this.heartInterval) { + clearTimeout(this.heartInterval); + } this.heartInterval = setInterval(() => { if (this.socket.readyState === 1) { // Connection status @@ -747,7 +749,9 @@ export default defineComponent({ /** To break off websocket Connect */ closeSocket() { this.socket.close(); - this.heartInterval && clearTimeout(this.heartInterval); + if (this.heartInterval) { + clearTimeout(this.heartInterval); + } this.isFirstFetchAfterConnect = true; }, onShowEventlog(serial: string) { diff --git a/webapp/vite.config.ts b/webapp/vite.config.ts index fcf7fe788..6c1a992f9 100644 --- a/webapp/vite.config.ts +++ b/webapp/vite.config.ts @@ -14,7 +14,7 @@ let proxy_target; try { // eslint-disable-next-line proxy_target = require('./vite.user.ts').proxy_target; -} catch (error) { +} catch { proxy_target = '192.168.20.110'; }