diff --git a/src/main.ts b/src/main.ts index 4003d2bc..82509ec7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,7 +12,7 @@ import { WebSocketPlugin } from '@/plugins/webSocketClient' import { registerSW } from 'virtual:pwa-register' // noinspection JSUnusedGlobalSymbols -const updateSW = registerSW({ +registerSW({ onOfflineReady() {}, }) @@ -84,7 +84,7 @@ const initLoad = async () => { await store.dispatch('importConfigJson', file) if ('defaultLocale' in file) i18n.locale = file.defaultLocale }) - .catch((_) => { + .catch(() => { window.console.error('config.json not found or cannot be decoded!') }) diff --git a/src/plugins/build-version.ts b/src/plugins/build-version.ts index 6297d4b2..96e2c9a7 100644 --- a/src/plugins/build-version.ts +++ b/src/plugins/build-version.ts @@ -10,7 +10,7 @@ import { PluginOption } from 'vite' export default function buildVersion(): PluginOption { return { name: 'build-version', - writeBundle: (context, options) => { + writeBundle: () => { setImmediate(async () => { const versionIdentifier = version.toString() const versionFile = await fs.promises.open(path.resolve(__dirname, '../../dist/.version'), 'w') diff --git a/src/plugins/helpers.ts b/src/plugins/helpers.ts index d9e4ae6f..b9a976d4 100644 --- a/src/plugins/helpers.ts +++ b/src/plugins/helpers.ts @@ -8,7 +8,6 @@ import { mdiEngine, mdiGamepad, mdiInformation, - mdiPrinter3d, mdiPrinter3dNozzle, mdiThermometerLines, mdiWebcam, diff --git a/src/store/actions.ts b/src/store/actions.ts index 966101e5..105b7be7 100644 --- a/src/store/actions.ts +++ b/src/store/actions.ts @@ -7,7 +7,7 @@ export const actions: ActionTree = { if (router.currentRoute.fullPath !== '/') router.push('/') }, - changePrinter({ dispatch, getters, state }, payload) { + changePrinter({ dispatch, getters }, payload) { dispatch('files/reset') dispatch('gui/reset') dispatch('printer/reset') @@ -29,7 +29,7 @@ export const actions: ActionTree = { /** * This function will parse the config.json content and config mainsail */ - importConfigJson({ commit, dispatch }, payload: ConfigJson) { + importConfigJson({ commit }, payload: ConfigJson) { type RootStateInstancesDbType = 'moonraker' | 'browser' | 'json' let instancesDB: RootStateInstancesDbType = payload.instancesDB ?? 'moonraker' if (document.location.hostname === 'my.mainsail.xyz') instancesDB = 'browser' diff --git a/src/store/editor/actions.ts b/src/store/editor/actions.ts index 2aa4c2b7..f4feb780 100644 --- a/src/store/editor/actions.ts +++ b/src/store/editor/actions.ts @@ -12,7 +12,7 @@ export const actions: ActionTree = { commit('reset') }, - openFile({ state, dispatch, commit, rootGetters, rootState }, payload) { + openFile({ state, dispatch, commit, rootGetters }, payload) { const fullFilepathArray = [] fullFilepathArray.push(payload.root) let path = payload.path diff --git a/src/store/farm/index.ts b/src/store/farm/index.ts index 72655f40..4aea8bce 100644 --- a/src/store/farm/index.ts +++ b/src/store/farm/index.ts @@ -38,7 +38,7 @@ export const farm: Module = { }, }, actions: { - registerPrinter({ state, commit, dispatch }, payload) { + registerPrinter({ commit, dispatch }, payload) { if (!this.hasModule(['farm', payload.id])) { this.registerModule(['farm', payload.id], printer) commit('farm/' + payload.id + '/setSocketData', { ...payload, _namespace: payload.id }, { root: true }) diff --git a/src/store/farm/printer/actions.ts b/src/store/farm/printer/actions.ts index 9f53c03f..ee4401b3 100644 --- a/src/store/farm/printer/actions.ts +++ b/src/store/farm/printer/actions.ts @@ -186,7 +186,7 @@ export const actions: ActionTree = { }) }, - getData({ commit, dispatch, state }, payload) { + getData({ commit, dispatch }, payload) { const data = 'status' in payload ? { ...payload.status } : { ...payload } commit('setData', data) diff --git a/src/store/files/actions.ts b/src/store/files/actions.ts index f79f0278..806469b3 100644 --- a/src/store/files/actions.ts +++ b/src/store/files/actions.ts @@ -260,10 +260,7 @@ export const actions: ActionTree = { } }, - async uploadFile( - { dispatch, commit, rootGetters }, - payload: { file: File; path: string; root: 'gcodes' | 'config' } - ) { + async uploadFile({ commit, rootGetters }, payload: { file: File; path: string; root: 'gcodes' | 'config' }) { const apiUrl = rootGetters['socket/getUrl'] const formData = new FormData() formData.append('file', payload.file, payload.file.name) diff --git a/src/store/files/getters.ts b/src/store/files/getters.ts index b7052545..71ca66a6 100644 --- a/src/store/files/getters.ts +++ b/src/store/files/getters.ts @@ -8,7 +8,6 @@ import { import { GetterTree } from 'vuex' import { FileState, FileStateFile, FileStateGcodefile } from '@/store/files/types' import { ServerHistoryStateJob } from '@/store/server/history/types' -import { ServerJobQueueStateJob } from '@/store/server/jobQueue/types' // eslint-disable-next-line export const getters: GetterTree = { diff --git a/src/store/gui/actions.ts b/src/store/gui/actions.ts index aab4627f..b5ed974c 100644 --- a/src/store/gui/actions.ts +++ b/src/store/gui/actions.ts @@ -239,7 +239,7 @@ export const actions: ActionTree = { }) }, - async resetMoonrakerDB({ commit, dispatch, rootGetters }, payload) { + async resetMoonrakerDB({ rootGetters }, payload) { const baseUrl = rootGetters['socket/getUrl'] + '/server/database/item' const urlDefault = @@ -306,7 +306,7 @@ export const actions: ActionTree = { window.location.reload() }, - async backupMoonrakerDB({ commit, dispatch, rootGetters }, payload) { + async backupMoonrakerDB({ rootGetters }, payload) { const backup: any = {} const responseMainsail = await fetch(rootGetters['socket/getUrl'] + '/server/database/item?namespace=mainsail') diff --git a/src/store/gui/console/getters.ts b/src/store/gui/console/getters.ts index 3d211f61..4315276b 100644 --- a/src/store/gui/console/getters.ts +++ b/src/store/gui/console/getters.ts @@ -37,7 +37,7 @@ export const getters: GetterTree = { return output }, - getConsoleClearedSince: (state, getters, rootState) => { + getConsoleClearedSince: (state) => { return state.cleared_since }, } diff --git a/src/store/gui/macros/actions.ts b/src/store/gui/macros/actions.ts index 53b976f2..6a5d3a1f 100644 --- a/src/store/gui/macros/actions.ts +++ b/src/store/gui/macros/actions.ts @@ -28,7 +28,7 @@ export const actions: ActionTree = { }) }, - async groupStore({ commit, dispatch, state }, payload) { + async groupStore({ commit, dispatch }, payload) { const id = uuidv4() await commit('groupStore', { id, values: payload.values }) @@ -37,7 +37,7 @@ export const actions: ActionTree = { return id }, - groupUpdate({ commit, dispatch, state }, payload) { + groupUpdate({ commit, dispatch }, payload) { commit('groupUpdate', payload) dispatch('groupUpload', payload.id) }, diff --git a/src/store/gui/notifications/getters.ts b/src/store/gui/notifications/getters.ts index 260570a5..de456430 100644 --- a/src/store/gui/notifications/getters.ts +++ b/src/store/gui/notifications/getters.ts @@ -3,7 +3,6 @@ import { GuiNotificationState, GuiNotificationStateDismissEntry, GuiNotification import { ServerAnnouncementsStateEntry } from '@/store/server/announcements/types' import i18n from '@/plugins/i18n.js' import { RootStateDependency } from '@/store/types' -import { camelize } from '@/plugins/helpers' import { sha256 } from 'js-sha256' import { PrinterStateKlipperConfigWarning } from '@/store/printer/types' diff --git a/src/store/gui/remoteprinters/actions.ts b/src/store/gui/remoteprinters/actions.ts index ac45de55..a62e70e1 100644 --- a/src/store/gui/remoteprinters/actions.ts +++ b/src/store/gui/remoteprinters/actions.ts @@ -28,7 +28,7 @@ export const actions: ActionTree = { } }, - async initStore({ commit, dispatch, state }, payload) { + async initStore({ commit, dispatch }, payload) { dispatch('reset') Object.keys(payload).forEach((printerId: string) => { const printer = payload[printerId] @@ -74,7 +74,7 @@ export const actions: ActionTree = { } }, - store({ commit, dispatch, state }, payload) { + store({ commit, dispatch }, payload) { const id = uuidv4() commit('store', { id, values: payload.values }) @@ -91,7 +91,7 @@ export const actions: ActionTree = { dispatch('upload', id) }, - update({ commit, dispatch, state }, payload) { + update({ commit, dispatch }, payload) { commit('update', payload) dispatch('farm/updatePrinter', payload, { root: true }) diff --git a/src/store/index.ts b/src/store/index.ts index 5ff2eee8..b88c51be 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -3,7 +3,7 @@ import Vuex from 'vuex' import { actions } from '@/store/actions' import { mutations } from '@/store/mutations' import { getters } from '@/store/getters' -import { ConfigJsonInstance, RootState } from './types' +import { RootState } from './types' // load modules import { socket } from '@/store/socket' diff --git a/src/store/server/actions.ts b/src/store/server/actions.ts index eb91058d..c48195bc 100644 --- a/src/store/server/actions.ts +++ b/src/store/server/actions.ts @@ -54,7 +54,7 @@ export const actions: ActionTree = { dispatch('socket/removeInitModule', 'server/identify', { root: true }) }, - checkDatabases({ dispatch, commit, rootState }, payload) { + checkDatabases({ dispatch, commit }, payload) { if (payload.namespaces?.includes('mainsail')) { dispatch('socket/addInitModule', 'gui/init', { root: true }) dispatch('gui/init', null, { root: true }) @@ -159,7 +159,7 @@ export const actions: ActionTree = { commit('setKlippyConnectedTimer', null) }, - checkKlippyConnected({ commit, dispatch, state }, payload) { + checkKlippyConnected({ commit, dispatch }, payload) { if (!payload.klippy_connected) { dispatch('startKlippyConnectedInterval') @@ -187,7 +187,7 @@ export const actions: ActionTree = { commit('setKlippyStateTimer', null) }, - checkKlippyState({ commit, dispatch, state }, payload: { state: string; state_message: string | null }) { + checkKlippyState({ commit, dispatch }, payload: { state: string; state_message: string | null }) { commit('setKlippyState', payload.state) commit('setKlippyMessage', payload.state_message) diff --git a/src/store/server/history/actions.ts b/src/store/server/history/actions.ts index 922580d8..6f23255d 100644 --- a/src/store/server/history/actions.ts +++ b/src/store/server/history/actions.ts @@ -47,7 +47,7 @@ export const actions: ActionTree = { else dispatch('socket/removeInitModule', 'server/history/init', { root: true }) }, - async initHistoryNotes({ commit, dispatch, state }, payload) { + async initHistoryNotes({ commit, dispatch }, payload) { const job_ids = Object.keys(payload.value) for (const job_id of job_ids) { diff --git a/src/store/server/history/getters.ts b/src/store/server/history/getters.ts index a9de1657..821d6869 100644 --- a/src/store/server/history/getters.ts +++ b/src/store/server/history/getters.ts @@ -4,13 +4,7 @@ import { ServerHistoryStateAllPrintStatusEntry, ServerHistoryStateJob, } from '@/store/server/history/types' -import { - mdiAlertCircleOutline, - mdiAlertOutline, - mdiCheckboxMarkedCircleOutline, - mdiCloseCircleOutline, - mdiProgressClock, -} from '@mdi/js' +import { mdiAlertOutline, mdiCheckboxMarkedCircleOutline, mdiCloseCircleOutline, mdiProgressClock } from '@mdi/js' import i18n from '@/plugins/i18n' // eslint-disable-next-line diff --git a/src/store/server/jobQueue/actions.ts b/src/store/server/jobQueue/actions.ts index 89a50b4a..5902c849 100644 --- a/src/store/server/jobQueue/actions.ts +++ b/src/store/server/jobQueue/actions.ts @@ -24,7 +24,7 @@ export const actions: ActionTree = { await dispatch('socket/removeInitModule', 'server/jobQueue/init', { root: true }) }, - async addToQueue({ state }, filenames: string[]) { + async addToQueue(_, filenames: string[]) { Vue.$socket.emit('server.job_queue.post_job', { filenames: filenames }) }, @@ -32,15 +32,15 @@ export const actions: ActionTree = { Vue.$socket.emit('server.job_queue.delete_job', { job_ids }) }, - clearQueue(_) { + clearQueue() { Vue.$socket.emit('server.job_queue.delete_job', { all: true }) }, - start(_) { + start() { Vue.$socket.emit('server.job_queue.start', {}, { loading: 'startJobqueue' }) }, - pause(_) { + pause() { Vue.$socket.emit('server.job_queue.pause', {}, { loading: 'pauseJobqueue' }) }, } diff --git a/src/store/server/mutations.ts b/src/store/server/mutations.ts index 99f646a2..c85dd572 100644 --- a/src/store/server/mutations.ts +++ b/src/store/server/mutations.ts @@ -1,7 +1,7 @@ import Vue from 'vue' import { getDefaultState } from './index' import { MutationTree } from 'vuex' -import { ServerState, ServerStateNetworkInterface } from '@/store/server/types' +import { ServerState } from '@/store/server/types' import { formatConsoleMessage, formatTime } from '@/plugins/helpers' import { maxEventHistory } from '@/store/variables' diff --git a/src/store/server/timelapse/actions.ts b/src/store/server/timelapse/actions.ts index 175959a5..99452eb8 100644 --- a/src/store/server/timelapse/actions.ts +++ b/src/store/server/timelapse/actions.ts @@ -48,7 +48,7 @@ export const actions: ActionTree = { } }, - saveSetting({ commit }, payload) { + saveSetting(_, payload) { Vue.$socket.emit('machine.timelapse.post_settings', payload, { action: 'server/timelapse/initSettings' }) },