From 8c51df044ee7f0b3220e6630cb5c4df63b2be735 Mon Sep 17 00:00:00 2001 From: Mantra Date: Wed, 6 Nov 2024 13:48:09 +0000 Subject: [PATCH] lint fixed --- app/static/src/apiService.ts | 8 ++++---- app/static/src/components/WodinPlot.vue | 4 ++-- app/static/src/components/WodinSession.vue | 2 +- app/static/src/components/options/ParameterSetView.vue | 2 +- app/static/src/components/options/ParameterValues.vue | 2 +- app/static/src/components/run/RunPlot.vue | 2 +- .../src/components/sensitivity/SensitivityTracesPlot.vue | 2 +- app/static/src/csvUpload.ts | 4 ++-- app/static/src/directives/tooltip.ts | 8 ++++---- app/static/src/excel/wodinExcelDownload.ts | 2 +- app/static/src/plot.ts | 2 +- app/static/src/serialise.ts | 2 +- app/static/src/store/basic/basic.ts | 2 +- app/static/src/store/fit/fit.ts | 2 +- app/static/src/store/stochastic/stochastic.ts | 2 +- app/static/src/types/responseTypes.ts | 2 +- app/static/src/types/utilTypes.ts | 2 +- app/static/src/utils.ts | 4 ++-- app/static/src/wodin.ts | 2 -- app/static/tests/e2e/code.etest.ts | 1 - app/static/tests/e2e/data.etest.ts | 2 +- app/static/tests/e2e/link.etest.ts | 1 - app/static/tests/e2e/stochastic.etest.ts | 2 +- app/static/tests/e2e/tabs.etest.ts | 2 +- app/static/tests/mocks.ts | 3 +-- app/static/tests/unit/components/downloadOutput.test.ts | 4 +--- .../tests/unit/components/help/draggableDialog.test.ts | 2 +- .../multiSensitivity/multiSensitivityTab.test.ts | 2 +- .../unit/components/options/advancedSettings.test.ts | 2 +- .../unit/components/options/parameterSetView.test.ts | 2 +- .../tests/unit/components/options/parameterSets.test.ts | 1 - .../tests/unit/components/options/parameterValues.test.ts | 2 +- .../components/options/sensitivityPlotOptions.test.ts | 2 +- .../tests/unit/components/sensitivity/support.test.ts | 2 +- app/static/tests/unit/components/wodinSession.test.ts | 2 -- app/static/tests/unit/components/wodinTabs.test.ts | 2 +- app/static/tests/unit/palette.test.ts | 1 - app/static/tests/unit/store/appState/actions.test.ts | 3 +-- app/static/tests/unit/store/appState/getters.test.ts | 2 +- app/static/tests/unit/store/model/actions.test.ts | 4 +--- app/static/tests/unit/store/modelFit/actions.test.ts | 3 +-- app/static/tests/unit/store/sensitivity/actions.test.ts | 2 +- app/static/tests/unit/store/sensitivity/mutations.test.ts | 2 +- app/static/translationPackage/src/LanguageSwitcher.vue | 7 ++----- .../translationPackage/tests/registerTranslations.test.ts | 2 +- 45 files changed, 49 insertions(+), 67 deletions(-) diff --git a/app/static/src/apiService.ts b/app/static/src/apiService.ts index ffc5ca549..5ad6f77fb 100644 --- a/app/static/src/apiService.ts +++ b/app/static/src/apiService.ts @@ -1,5 +1,5 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ + + import axios, { AxiosError, AxiosResponse } from "axios"; import { Commit } from "vuex"; import { freezer } from "./utils"; @@ -34,9 +34,9 @@ export interface API { get(url: string): Promise>; } -// eslint-disable-next-line @typescript-eslint/no-unused-vars + type OnError = (failure: ResponseFailure) => void; -// eslint-disable-next-line @typescript-eslint/no-unused-vars + type OnSuccess = (success: ResponseSuccess) => void; export class APIService implements API { diff --git a/app/static/src/components/WodinPlot.vue b/app/static/src/components/WodinPlot.vue index 52907dfaf..b695450c7 100644 --- a/app/static/src/components/WodinPlot.vue +++ b/app/static/src/components/WodinPlot.vue @@ -46,7 +46,7 @@ export default defineComponent({ // Only used as an indicator that redraw is required when this changes - the data to display is calculated by // plotData function using these solutions redrawWatches: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + type: Array as PropType, required: true }, @@ -102,7 +102,7 @@ export default defineComponent({ const lastYAxisFromZoom: Ref | null> = ref(null); const commitYAxisRange = () => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + const plotLayout = (plot.value as any).layout; const yRange = plotLayout.yaxis?.range; if (plotLayout) { diff --git a/app/static/src/components/WodinSession.vue b/app/static/src/components/WodinSession.vue index 6b71484ae..0f74047e9 100644 --- a/app/static/src/components/WodinSession.vue +++ b/app/static/src/components/WodinSession.vue @@ -34,7 +34,7 @@ export default defineComponent({ const appInitialised = computed(() => !!store.state.config && !!store.state.sessions.sessionsMetadata); // These props won't change as provided by server - // eslint-disable-next-line vue/no-setup-props-destructure + const { appName, baseUrl, loadSessionId, appsPath, enableI18n, defaultLanguage } = props; store.dispatch(AppStateAction.InitialiseApp, { diff --git a/app/static/src/components/options/ParameterSetView.vue b/app/static/src/components/options/ParameterSetView.vue index 19cf6baa8..98f22a933 100644 --- a/app/static/src/components/options/ParameterSetView.vue +++ b/app/static/src/components/options/ParameterSetView.vue @@ -191,7 +191,7 @@ export default defineComponent({ }; const saveButton = ref(null); const cancelEditDisplayName = (event: FocusEvent) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (event.relatedTarget && event.relatedTarget === (saveButton.value as any).$el) return; store.commit(`run/${RunMutation.TurnOffDisplayNameError}`, props.parameterSet.name); newDisplayName.value = props.parameterSet.displayName; diff --git a/app/static/src/components/options/ParameterValues.vue b/app/static/src/components/options/ParameterValues.vue index 0a20b0be0..910a9740d 100644 --- a/app/static/src/components/options/ParameterValues.vue +++ b/app/static/src/components/options/ParameterValues.vue @@ -57,7 +57,7 @@ export default defineComponent({ const paramVaryFlags = computed(() => { return paramNames.value.reduce((values: Dict, key: string) => { - // eslint-disable-next-line no-param-reassign + values[key] = paramsToVary.value.includes(key); return values; }, {} as Dict); diff --git a/app/static/src/components/run/RunPlot.vue b/app/static/src/components/run/RunPlot.vue index 4754691e9..133bbbb2c 100644 --- a/app/static/src/components/run/RunPlot.vue +++ b/app/static/src/components/run/RunPlot.vue @@ -97,7 +97,7 @@ const allPlotData = (start: number, end: number, points: number): WodinPlotData const lineStylesForParamSets = computed(() => store.getters[`run/${RunGetter.lineStylesForParameterSets}`]); const updatePlotTraceNameWithParameterSetName = (plotTrace: Partial, setName: string) => { - // eslint-disable-next-line no-param-reassign + plotTrace.name = `${plotTrace.name} (${setName})`; }; diff --git a/app/static/src/components/sensitivity/SensitivityTracesPlot.vue b/app/static/src/components/sensitivity/SensitivityTracesPlot.vue index a829dbcf1..4433f5d5a 100644 --- a/app/static/src/components/sensitivity/SensitivityTracesPlot.vue +++ b/app/static/src/components/sensitivity/SensitivityTracesPlot.vue @@ -156,7 +156,7 @@ export default defineComponent({ const plotlyOptions = { includeLegendGroup: true }; const filterStochasticCentralOutput = (centralOutput: OdinSeriesSet) => { // Only show summary and deterministic values as central for stochastic - // eslint-disable-next-line no-param-reassign + centralOutput.values = centralOutput.values.filter( (v: DiscreteSeriesValues) => v.description !== "Individual" ); diff --git a/app/static/src/csvUpload.ts b/app/static/src/csvUpload.ts index f49feebe4..2e1159f0a 100644 --- a/app/static/src/csvUpload.ts +++ b/app/static/src/csvUpload.ts @@ -6,9 +6,9 @@ import { WodinError } from "./types/responseTypes"; import { processFitData, ProcessFitDataResult } from "./utils"; import { SetDataPayload } from "./store/fitData/mutations"; -// eslint-disable-next-line @typescript-eslint/no-unused-vars + type OnError = (error: WodinError) => void; -// eslint-disable-next-line @typescript-eslint/no-unused-vars + type OnSuccess = (success: SetDataPayload) => void; type PostSuccess = () => void; diff --git a/app/static/src/directives/tooltip.ts b/app/static/src/directives/tooltip.ts index 822f53c74..59309162e 100644 --- a/app/static/src/directives/tooltip.ts +++ b/app/static/src/directives/tooltip.ts @@ -18,7 +18,7 @@ export default { if (typeof value === "string") { // disabling no-new lint error as bootstrap // needs the new keyword - // eslint-disable-next-line no-new + new Tooltip(el, { title: value, placement: "top", @@ -27,7 +27,7 @@ export default { }); } else { const variant = value?.variant || "text"; - // eslint-disable-next-line no-new + new Tooltip(el, { title: value?.content || "", placement: value?.placement || "top", @@ -47,7 +47,7 @@ export default { const variant = value?.variant || "text"; const oldCustomClass = variant === "text" ? "" : `tooltip-${variant}`; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + const isVariantSame = (tooltip as any)._config.customClass === oldCustomClass; if (!isVariantSame) { tooltip.dispose(); @@ -66,7 +66,7 @@ export default { const content = typeof value === "string" ? value : value?.content || ""; if (tooltip) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + const configuredTooltip = tooltip as any; configuredTooltip._config.title = content; const { trigger } = configuredTooltip._config; diff --git a/app/static/src/excel/wodinExcelDownload.ts b/app/static/src/excel/wodinExcelDownload.ts index bbe2f554e..50b369c2a 100644 --- a/app/static/src/excel/wodinExcelDownload.ts +++ b/app/static/src/excel/wodinExcelDownload.ts @@ -9,7 +9,7 @@ export abstract class WodinExcelDownload { protected readonly _state: AppState; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + protected readonly _rootGetters: any; protected readonly _commit: Commit; diff --git a/app/static/src/plot.ts b/app/static/src/plot.ts index 68527a219..f09f4733a 100644 --- a/app/static/src/plot.ts +++ b/app/static/src/plot.ts @@ -189,6 +189,6 @@ export const updatePlotTraceName = ( if (parameterSetName) { parenthesisItems.push(parameterSetName); } - // eslint-disable-next-line no-param-reassign + plotTrace.name = `${plotTrace.name} (${parenthesisItems.join(" ")})`; }; diff --git a/app/static/src/serialise.ts b/app/static/src/serialise.ts index 6e153b5a7..ad09d6239 100644 --- a/app/static/src/serialise.ts +++ b/app/static/src/serialise.ts @@ -201,7 +201,7 @@ export const deserialiseState = (targetState: AppState, serialised: SerialisedAp !graphs.config[0].selectedVariables.length && !graphs.config[0].unselectedVariables?.length ) { - /* eslint-disable no-param-reassign */ + const selectedVariables = [...(model.odinModelResponse?.metadata?.variables || [])]; const unselectedVariables: string[] = []; diff --git a/app/static/src/store/basic/basic.ts b/app/static/src/store/basic/basic.ts index d34f33cf2..34c3f1f29 100644 --- a/app/static/src/store/basic/basic.ts +++ b/app/static/src/store/basic/basic.ts @@ -19,7 +19,7 @@ import { multiSensitivity } from "../multiSensitivity/multiSensitivity"; const language = getStoreModule(); -/* eslint-disable @typescript-eslint/no-explicit-any */ + const defaultState: () => any = () => { return { sessionId: newUid(), diff --git a/app/static/src/store/fit/fit.ts b/app/static/src/store/fit/fit.ts index d9fb63cf1..3929ebcde 100644 --- a/app/static/src/store/fit/fit.ts +++ b/app/static/src/store/fit/fit.ts @@ -21,7 +21,7 @@ import { multiSensitivity } from "../multiSensitivity/multiSensitivity"; const language = getStoreModule(); -/* eslint-disable @typescript-eslint/no-explicit-any */ + const defaultState: () => any = () => { return { sessionId: newUid(), diff --git a/app/static/src/store/stochastic/stochastic.ts b/app/static/src/store/stochastic/stochastic.ts index 0c7be0f86..8c9ca6234 100644 --- a/app/static/src/store/stochastic/stochastic.ts +++ b/app/static/src/store/stochastic/stochastic.ts @@ -19,7 +19,7 @@ import { multiSensitivity } from "../multiSensitivity/multiSensitivity"; const language = getStoreModule(); -/* eslint-disable @typescript-eslint/no-explicit-any */ + const defaultState: () => any = () => { return { sessionId: newUid(), diff --git a/app/static/src/types/responseTypes.ts b/app/static/src/types/responseTypes.ts index 61ba4993b..f11a37988 100644 --- a/app/static/src/types/responseTypes.ts +++ b/app/static/src/types/responseTypes.ts @@ -56,7 +56,7 @@ export interface OdinParameter { default: null | number; min: null | number; max: null | number; - // eslint-disable-next-line camelcase + is_integer: boolean; rank: number; } diff --git a/app/static/src/types/utilTypes.ts b/app/static/src/types/utilTypes.ts index e306cf6dd..58c9ab252 100644 --- a/app/static/src/types/utilTypes.ts +++ b/app/static/src/types/utilTypes.ts @@ -2,5 +2,5 @@ import { ActionContext } from "vuex"; export type Dict = { [k: string]: V }; -// eslint-disable-next-line @typescript-eslint/no-explicit-any + export type AppCtx = ActionContext; diff --git a/app/static/src/utils.ts b/app/static/src/utils.ts index 5f19bb7f3..6f5ae556c 100644 --- a/app/static/src/utils.ts +++ b/app/static/src/utils.ts @@ -20,7 +20,7 @@ import { AppState } from "./store/appState/state"; import { AdvancedComponentType, AdvancedSettings, Tag } from "./store/run/state"; export const freezer = { - /* eslint-disable @typescript-eslint/no-explicit-any */ + deepFreeze: (data: unknown): unknown => { if (Array.isArray(data)) { return Object.freeze(data.map((d) => freezer.deepFreeze(d))); @@ -36,7 +36,7 @@ export const freezer = { } }; -/* eslint-disable no-eval */ + export function evaluateScript(script: string): T { return eval(script) as T; } diff --git a/app/static/src/wodin.ts b/app/static/src/wodin.ts index f1aefb5a8..b7ccb0ac3 100644 --- a/app/static/src/wodin.ts +++ b/app/static/src/wodin.ts @@ -1,10 +1,8 @@ import { createApp } from "vue"; import Vuex from "vuex"; -import WodinSession from "./components/WodinSession.vue"; import BasicApp from "./components/basic/BasicApp.vue"; import FitApp from "./components/fit/FitApp.vue"; import StochasticApp from "./components/stochastic/StochasticApp.vue"; -import AppHeader from "./components/header/AppHeader.vue"; import { BasicState } from "./store/basic/state"; import { FitState } from "./store/fit/state"; import { StochasticState } from "./store/stochastic/state"; diff --git a/app/static/tests/e2e/code.etest.ts b/app/static/tests/e2e/code.etest.ts index efc65ad99..aaa7123e4 100644 --- a/app/static/tests/e2e/code.etest.ts +++ b/app/static/tests/e2e/code.etest.ts @@ -69,7 +69,6 @@ const expectMonacoDecoration = async (state: EditorStates, line: number, numOfLi }; const expectMonacoHover = async (type: "glyph" | "content", line: number, message: string, page: Page) => { - const isGlyph = type === "glyph"; const hoverElem = type === "content" ? `.view-overlays div:nth-child(${line}) >> div` : ".glyph-margin-widgets .fa-solid"; diff --git a/app/static/tests/e2e/data.etest.ts b/app/static/tests/e2e/data.etest.ts index c8d012245..e23f01ba0 100644 --- a/app/static/tests/e2e/data.etest.ts +++ b/app/static/tests/e2e/data.etest.ts @@ -1,4 +1,4 @@ -import { expect, test, Page } from "@playwright/test"; +import { expect, test } from "@playwright/test"; import PlaywrightConfig from "../../playwright.config"; import { uploadCSVData } from "./utils"; diff --git a/app/static/tests/e2e/link.etest.ts b/app/static/tests/e2e/link.etest.ts index 5f94a38ce..7a1536429 100644 --- a/app/static/tests/e2e/link.etest.ts +++ b/app/static/tests/e2e/link.etest.ts @@ -1,7 +1,6 @@ import { expect, test, Page } from "@playwright/test"; import PlaywrightConfig from "../../playwright.config"; import { uploadCSVData } from "./utils"; -import { newValidCode } from "./code.etest"; export const newVariableCode = `# variables deriv(S) <- - beta * S * J / N diff --git a/app/static/tests/e2e/stochastic.etest.ts b/app/static/tests/e2e/stochastic.etest.ts index 0ab40eeee..3e6013f66 100644 --- a/app/static/tests/e2e/stochastic.etest.ts +++ b/app/static/tests/e2e/stochastic.etest.ts @@ -1,4 +1,4 @@ -import { expect, Page, test } from "@playwright/test"; +import { expect, test } from "@playwright/test"; import PlaywrightConfig from "../../playwright.config"; import { expectSummaryValues } from "./utils"; diff --git a/app/static/tests/e2e/tabs.etest.ts b/app/static/tests/e2e/tabs.etest.ts index 108677dad..fd3de7b39 100644 --- a/app/static/tests/e2e/tabs.etest.ts +++ b/app/static/tests/e2e/tabs.etest.ts @@ -1,4 +1,4 @@ -import { expect, test, Page } from "@playwright/test"; +import { expect, test } from "@playwright/test"; test.describe("Wodin App tabs tests", () => { test.beforeEach(async ({ page }) => { diff --git a/app/static/tests/mocks.ts b/app/static/tests/mocks.ts index 867dd0bb5..2e56a5fb9 100644 --- a/app/static/tests/mocks.ts +++ b/app/static/tests/mocks.ts @@ -5,7 +5,6 @@ import { FitState } from "../src/store/fit/state"; import { StochasticState } from "../src/store/stochastic/state"; import { AdvancedOptions, - BatchPars, OdinUserType, ResponseFailure, ResponseSuccess, @@ -377,7 +376,7 @@ export const mockBatchParsDisplace = ( export const mockRunnerOde = () => { return { - wodinRun: vi.fn((odin, pars, start, end) => "test solution" as any) + wodinRun: vi.fn(() => "test solution" as any) } as any; }; diff --git a/app/static/tests/unit/components/downloadOutput.test.ts b/app/static/tests/unit/components/downloadOutput.test.ts index 8a56233c7..d263149b1 100644 --- a/app/static/tests/unit/components/downloadOutput.test.ts +++ b/app/static/tests/unit/components/downloadOutput.test.ts @@ -1,13 +1,11 @@ import Vuex from "vuex"; import { shallowMount } from "@vue/test-utils"; -import { mockBasicState, mockRunState } from "../../mocks"; +import { mockBasicState } from "../../mocks"; import { BasicState } from "../../../src/store/basic/state"; import DownloadOutput from "../../../src/components/DownloadOutput.vue"; -/* eslint-disable max-len */ const generatedFilenameRegex = /^test-run-([0-9]{4})?(1[0-2]|0[1-9])?(3[01]|0[1-9]|[12][0-9])-(2[0-3]|[0-1][0-9])?([0-5][0-9])?([0-5][0-9])?$/; -/* eslint-disable max-len */ const generatedFilenameWithSuffixRegex = /^test-run-([0-9]{4})?(1[0-2]|0[1-9])?(3[01]|0[1-9]|[12][0-9])-(2[0-3]|[0-1][0-9])?([0-5][0-9])?([0-5][0-9])?.xlsx$/; diff --git a/app/static/tests/unit/components/help/draggableDialog.test.ts b/app/static/tests/unit/components/help/draggableDialog.test.ts index ebef18c84..b473113a3 100644 --- a/app/static/tests/unit/components/help/draggableDialog.test.ts +++ b/app/static/tests/unit/components/help/draggableDialog.test.ts @@ -1,4 +1,4 @@ -import { mount, shallowMount } from "@vue/test-utils"; +import { mount } from "@vue/test-utils"; import VueFeather from "vue-feather"; import { nextTick } from "vue"; import DraggableDialog from "../../../../src/components/help/DraggableDialog.vue"; diff --git a/app/static/tests/unit/components/multiSensitivity/multiSensitivityTab.test.ts b/app/static/tests/unit/components/multiSensitivity/multiSensitivityTab.test.ts index a9830e74c..58b9b3fd1 100644 --- a/app/static/tests/unit/components/multiSensitivity/multiSensitivityTab.test.ts +++ b/app/static/tests/unit/components/multiSensitivity/multiSensitivityTab.test.ts @@ -1,7 +1,7 @@ import { shallowMount } from "@vue/test-utils"; import Vuex from "vuex"; import MultiSensitivityTab from "../../../../src/components/multiSensitivity/MultiSensitivityTab.vue"; -import { AppState, AppType } from "../../../../src/store/appState/state"; +import { AppState } from "../../../../src/store/appState/state"; import LoadingButton from "../../../../src/components/LoadingButton.vue"; import { ModelState } from "../../../../src/store/model/state"; import { MultiSensitivityAction } from "../../../../src/store/multiSensitivity/actions"; diff --git a/app/static/tests/unit/components/options/advancedSettings.test.ts b/app/static/tests/unit/components/options/advancedSettings.test.ts index 09267f061..55b426ab7 100644 --- a/app/static/tests/unit/components/options/advancedSettings.test.ts +++ b/app/static/tests/unit/components/options/advancedSettings.test.ts @@ -8,7 +8,7 @@ import StandardFormInput from "../../../../src/components/options/StandardFormIn import { AdvancedOptions } from "../../../../src/types/responseTypes"; import TagInput from "../../../../src/components/options/TagInput.vue"; import { ModelFitMutation } from "../../../../src/store/modelFit/mutations"; -import { BaseSensitivityMutation, SensitivityMutation } from "../../../../src/store/sensitivity/mutations"; +import { BaseSensitivityMutation } from "../../../../src/store/sensitivity/mutations"; import { AppType } from "../../../../src/store/appState/state"; describe("Advanced Settings", () => { diff --git a/app/static/tests/unit/components/options/parameterSetView.test.ts b/app/static/tests/unit/components/options/parameterSetView.test.ts index 6d35a47f2..ae7a8a4d8 100644 --- a/app/static/tests/unit/components/options/parameterSetView.test.ts +++ b/app/static/tests/unit/components/options/parameterSetView.test.ts @@ -1,6 +1,6 @@ import Vuex from "vuex"; import { nextTick } from "vue"; -import { flushPromises, shallowMount } from "@vue/test-utils"; +import { shallowMount } from "@vue/test-utils"; import VueFeather from "vue-feather"; import { BasicState } from "../../../../src/store/basic/state"; import { mockBasicState, mockRunState, mockModelState } from "../../../mocks"; diff --git a/app/static/tests/unit/components/options/parameterSets.test.ts b/app/static/tests/unit/components/options/parameterSets.test.ts index 1852282fd..73a19e52c 100644 --- a/app/static/tests/unit/components/options/parameterSets.test.ts +++ b/app/static/tests/unit/components/options/parameterSets.test.ts @@ -9,7 +9,6 @@ import { ModelState } from "../../../../src/store/model/state"; import { getters } from "../../../../src/store/run/getters"; import { RunAction } from "../../../../src/store/run/actions"; import { RunMutation } from "../../../../src/store/run/mutations"; -import { nextTick } from "vue"; describe("ParameterSets", () => { const mockNewParameterSet = vi.fn(); diff --git a/app/static/tests/unit/components/options/parameterValues.test.ts b/app/static/tests/unit/components/options/parameterValues.test.ts index 7a9dac571..476038347 100644 --- a/app/static/tests/unit/components/options/parameterValues.test.ts +++ b/app/static/tests/unit/components/options/parameterValues.test.ts @@ -9,7 +9,7 @@ import { RunMutation, mutations as runMutations } from "../../../../src/store/ru import { AppType, VisualisationTab } from "../../../../src/store/appState/state"; import { Mock } from "vitest"; import { ModelFitMutation } from "../../../../src/store/modelFit/mutations"; -import { BaseSensitivityMutation, SensitivityMutation } from "../../../../src/store/sensitivity/mutations"; +import { BaseSensitivityMutation } from "../../../../src/store/sensitivity/mutations"; import { ModelState } from "../../../../src/store/model/state"; const mockTooltipDirective = vi.fn(); diff --git a/app/static/tests/unit/components/options/sensitivityPlotOptions.test.ts b/app/static/tests/unit/components/options/sensitivityPlotOptions.test.ts index d8e8b1689..d58df587a 100644 --- a/app/static/tests/unit/components/options/sensitivityPlotOptions.test.ts +++ b/app/static/tests/unit/components/options/sensitivityPlotOptions.test.ts @@ -158,7 +158,7 @@ describe("SensitivityPlotOptions", () => { }); it("on mounted, initialises time to model end if null", () => { - const wrapper = getWrapper({ plotType: SensitivityPlotType.ValueAtTime, time: null }); + getWrapper({ plotType: SensitivityPlotType.ValueAtTime, time: null }); expect(mockSetPlotTime).toHaveBeenCalledTimes(1); expect(mockSetPlotTime.mock.calls[0][1]).toBe(100); }); diff --git a/app/static/tests/unit/components/sensitivity/support.test.ts b/app/static/tests/unit/components/sensitivity/support.test.ts index d81adaf72..5225b384a 100644 --- a/app/static/tests/unit/components/sensitivity/support.test.ts +++ b/app/static/tests/unit/components/sensitivity/support.test.ts @@ -120,7 +120,7 @@ describe("verifies valid plot settings time", () => { }); it("does not update time if already valid", () => { - const state = getState(50, 100); + getState(50, 100); expect(commit).not.toHaveBeenCalled(); }); }); diff --git a/app/static/tests/unit/components/wodinSession.test.ts b/app/static/tests/unit/components/wodinSession.test.ts index 51830835d..e01759307 100644 --- a/app/static/tests/unit/components/wodinSession.test.ts +++ b/app/static/tests/unit/components/wodinSession.test.ts @@ -15,8 +15,6 @@ import { localStorageManager } from "../../../src/localStorageManager"; import { LanguageState } from "../../../translationPackage/store/state"; import { MockInstance } from "vitest"; -const realLocation = window.location; - describe("WodinSession", () => { const mockInitialiseApp = vi.fn(); const mockAddError = vi.fn(); diff --git a/app/static/tests/unit/components/wodinTabs.test.ts b/app/static/tests/unit/components/wodinTabs.test.ts index ed485284d..0b2fc2c29 100644 --- a/app/static/tests/unit/components/wodinTabs.test.ts +++ b/app/static/tests/unit/components/wodinTabs.test.ts @@ -47,7 +47,7 @@ describe("WodinTabs", () => { // can click back too await tabLinks.at(0)!.trigger("click"); expect(tabLinks.at(0)!.classes()).toContain("active"); - expect(slotContainer.html())!.toContain("
ONE
"); + expect(slotContainer.html()).toContain("
ONE
"); expect(wrapper.emitted("tabSelected")!.length).toBe(2); expect(wrapper.emitted("tabSelected")![1]).toStrictEqual(["one"]); }); diff --git a/app/static/tests/unit/palette.test.ts b/app/static/tests/unit/palette.test.ts index d5b0ab30f..2f3fe9e62 100644 --- a/app/static/tests/unit/palette.test.ts +++ b/app/static/tests/unit/palette.test.ts @@ -26,7 +26,6 @@ describe("interpolate colours", () => { it("interpolates down", () => { const p = interpolateColours(cols, 4); - const res = [p(0), p(1), p(2), p(3)]; expect(p(0)).toEqual(cols[0]); // lower bound expect(p(3)).toEqual(cols[4]); // upper bound expect(p(1)).toEqual("#6ab74d"); diff --git a/app/static/tests/unit/store/appState/actions.test.ts b/app/static/tests/unit/store/appState/actions.test.ts index d6de6580e..05b61ddd0 100644 --- a/app/static/tests/unit/store/appState/actions.test.ts +++ b/app/static/tests/unit/store/appState/actions.test.ts @@ -14,7 +14,7 @@ import { AppStateAction, appStateActions } from "../../../../src/store/appState/ import { AppStateMutation, appStateMutations } from "../../../../src/store/appState/mutations"; import { RunMutation } from "../../../../src/store/run/mutations"; import { ErrorsMutation } from "../../../../src/store/errors/mutations"; -import { CodeMutation, mutations as codeMutations } from "../../../../src/store/code/mutations"; +import { CodeMutation } from "../../../../src/store/code/mutations"; import { BasicState } from "../../../../src/store/basic/state"; import { ModelAction } from "../../../../src/store/model/actions"; import { serialiseState } from "../../../../src/serialise"; @@ -22,7 +22,6 @@ import { SessionsAction } from "../../../../src/store/sessions/actions"; import { localStorageManager } from "../../../../src/localStorageManager"; import { AppStateGetter } from "../../../../src/store/appState/getters"; import { Language } from "../../../../src/types/languageTypes"; -import { nextTick } from "vue"; import { flushPromises } from "@vue/test-utils"; describe("AppState actions", () => { diff --git a/app/static/tests/unit/store/appState/getters.test.ts b/app/static/tests/unit/store/appState/getters.test.ts index 7c6fa45d6..dfdf48cb1 100644 --- a/app/static/tests/unit/store/appState/getters.test.ts +++ b/app/static/tests/unit/store/appState/getters.test.ts @@ -1,4 +1,4 @@ -import { AppStateGetter, getters } from "../../../../src/store/appState/getters"; +import { getters } from "../../../../src/store/appState/getters"; import { mockBasicState } from "../../../mocks"; describe("AppState getters", () => { diff --git a/app/static/tests/unit/store/model/actions.test.ts b/app/static/tests/unit/store/model/actions.test.ts index 9fb3ff748..72ae26aef 100644 --- a/app/static/tests/unit/store/model/actions.test.ts +++ b/app/static/tests/unit/store/model/actions.test.ts @@ -7,8 +7,7 @@ import { mockModelState, mockRunState, mockRunnerOde, - mockSuccess, - mockFitState + mockSuccess } from "../../../mocks"; import { actions, ModelAction } from "../../../../src/store/model/actions"; import { ModelMutation, mutations } from "../../../../src/store/model/mutations"; @@ -22,7 +21,6 @@ import { ModelFitMutation } from "../../../../src/store/modelFit/mutations"; import { BaseSensitivityMutation, SensitivityMutation } from "../../../../src/store/sensitivity/mutations"; import { MultiSensitivityMutation } from "../../../../src/store/multiSensitivity/mutations"; import { defaultSensitivityParamSettings } from "../../../../src/store/sensitivity/sensitivity"; -import { GraphsMutation } from "../../../../src/store/graphs/mutations"; import { GraphsAction } from "../../../../src/store/graphs/actions"; describe("Model actions", () => { diff --git a/app/static/tests/unit/store/modelFit/actions.test.ts b/app/static/tests/unit/store/modelFit/actions.test.ts index be59d556e..cef01857b 100644 --- a/app/static/tests/unit/store/modelFit/actions.test.ts +++ b/app/static/tests/unit/store/modelFit/actions.test.ts @@ -2,7 +2,7 @@ import { ModelFitMutation } from "../../../../src/store/modelFit/mutations"; import { mockFitDataState, mockModelFitState, mockModelState, mockRunState } from "../../../mocks"; import { actions, ModelFitAction } from "../../../../src/store/modelFit/actions"; import { RunMutation } from "../../../../src/store/run/mutations"; -import { BaseSensitivityMutation, SensitivityMutation } from "../../../../src/store/sensitivity/mutations"; +import { BaseSensitivityMutation } from "../../../../src/store/sensitivity/mutations"; import { AdvancedOptions } from "../../../../src/types/responseTypes"; import { AdvancedComponentType } from "../../../../src/store/run/state"; import { nextTick } from "vue"; @@ -333,7 +333,6 @@ describe("ModelFit actions", () => { it("UpdateSumOfSquares does nothing if fitting", () => { const commit = vi.fn(); const testState = mockModelFitState({ fitting: true }); - const rootGetters = null; const context = { commit, state: testState, diff --git a/app/static/tests/unit/store/sensitivity/actions.test.ts b/app/static/tests/unit/store/sensitivity/actions.test.ts index 87d2beb7c..32b27225e 100644 --- a/app/static/tests/unit/store/sensitivity/actions.test.ts +++ b/app/static/tests/unit/store/sensitivity/actions.test.ts @@ -1,4 +1,4 @@ -import { Action, ActionTree } from "vuex"; +import { Action } from "vuex"; import { actions, BaseSensitivityAction, SensitivityAction } from "../../../../src/store/sensitivity/actions"; import { BaseSensitivityMutation, SensitivityMutation } from "../../../../src/store/sensitivity/mutations"; import { ModelGetter } from "../../../../src/store/model/getters"; diff --git a/app/static/tests/unit/store/sensitivity/mutations.test.ts b/app/static/tests/unit/store/sensitivity/mutations.test.ts index 92cb9377f..4582f2d10 100644 --- a/app/static/tests/unit/store/sensitivity/mutations.test.ts +++ b/app/static/tests/unit/store/sensitivity/mutations.test.ts @@ -147,7 +147,7 @@ describe("Sensitivity mutations", () => { expect(state.running).toBe(true); }); - it("sets running", () => { + it("sets loading", () => { const state = mockSensitivityState(); mutations.SetLoading(state, true); expect(state.loading).toBe(true); diff --git a/app/static/translationPackage/src/LanguageSwitcher.vue b/app/static/translationPackage/src/LanguageSwitcher.vue index 923f420e6..ee700c34f 100644 --- a/app/static/translationPackage/src/LanguageSwitcher.vue +++ b/app/static/translationPackage/src/LanguageSwitcher.vue @@ -12,7 +12,6 @@