diff --git a/eslint.config.js b/eslint.config.js
index 914e842..ec906bf 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -20,6 +20,7 @@ const config = [
{
rules: {
"vue/attributes-order": ["warn", { alphabetical: true }],
+ "no-undef": "off",
},
},
];
diff --git a/nuxt.config.ts b/nuxt.config.ts
index a9db973..4ecbe7c 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -42,7 +42,7 @@ export default defineNuxtConfig({
},
pinia: {
- // @ts-ignore
+ // @ts-expect-error somehow there is no types for this
autoImports: ["defineStore", "acceptHMRUpdate"],
},
diff --git a/playwright.config.ts b/playwright.config.ts
index 43b5249..55e304e 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -3,7 +3,7 @@
import { defineConfig, devices } from "@playwright/test";
const port = process.env.PORT ?? 3000;
-const baseUrl = `http://localhost:${port}`;
+const baseUrl = `http://localhost:${String(port)}`;
export default defineConfig({
testDir: "./e2e",
diff --git a/src/components/CombinedMapChart.vue b/src/components/CombinedMapChart.vue
index 85c5b76..5cd440e 100644
--- a/src/components/CombinedMapChart.vue
+++ b/src/components/CombinedMapChart.vue
@@ -85,7 +85,7 @@ function pointFormatter() {
// @ts-expect-error todo find out how to type this function correctly
.map((query) => [query.userInput, this[query.userInput], query.color])
.sort((a, b) => b[1] - a[1]);
- // @ts-expect-error
+ // @ts-expect-error once again highcharts interal funciton, this is okay
return `${this.id}
${queryArray
.map(
diff --git a/src/components/DataDisplay/DataDisplayCollocations.vue b/src/components/DataDisplay/DataDisplayCollocations.vue
index 4606d33..9b66cd0 100644
--- a/src/components/DataDisplay/DataDisplayCollocations.vue
+++ b/src/components/DataDisplay/DataDisplayCollocations.vue
@@ -139,23 +139,23 @@ function pointFormatter() {
this.name +
"
" +
"Frequency: " +
- // @ts-expect-error
+ // @ts-expect-error this is used inside the table rendering.
this.freq +
"
" +
"Collocational Frequency: " +
- // @ts-expect-error
+ // @ts-expect-error this is used inside the table rendering.
this.coll_freq +
"
" +
"D: " +
- // @ts-expect-error
+ // @ts-expect-error this is used inside the table rendering.
this.d +
"
" +
"M: " +
- // @ts-expect-error
+ // @ts-expect-error this is used inside the table rendering.
this.m +
"
" +
"T: " +
- // @ts-expect-error
+ // @ts-expect-error this is used inside the table rendering.
this.t
);
}
diff --git a/src/components/DataDisplay/DataDisplayKeywordInContext.vue b/src/components/DataDisplay/DataDisplayKeywordInContext.vue
index 0628389..ce0d592 100644
--- a/src/components/DataDisplay/DataDisplayKeywordInContext.vue
+++ b/src/components/DataDisplay/DataDisplayKeywordInContext.vue
@@ -51,10 +51,9 @@ const q = computed(() =>
date: Tbl_refs![1] ?? "",
source: Tbl_refs![4] ?? "",
region: Tbl_refs![2] ?? "",
- // @ts-ignore wrong types in api lib
+ // @ts-expect-error wrong types in api lib
left: Left!.map(({ str, strc }) => str || strc).join(" "),
word: typeof Kwic![0] !== "undefined" ? Kwic![0].str : "",
- // @ts-ignore wrong types in api lib
right: Right!.map(({ str }: { str: string }) => str).join(" "),
docid: Tbl_refs![0] ?? "",
topic: Tbl_refs![3] ?? "",
diff --git a/src/components/DataDisplay/DataDisplayMediaSource.vue b/src/components/DataDisplay/DataDisplayMediaSource.vue
index 5e04b54..44c789a 100644
--- a/src/components/DataDisplay/DataDisplayMediaSource.vue
+++ b/src/components/DataDisplay/DataDisplayMediaSource.vue
@@ -8,7 +8,7 @@ const t = useTranslations("Corpsum");
const queryStore = useQueryStore();
const { queries } = storeToRefs(queryStore);
-const mode = ref("relative");
+const mode: Ref<"absolute" | "relative"> = ref("relative");
const expand = ref(false);
const api = useApiClient();
@@ -105,7 +105,7 @@ const isStacked = computed(() => chartMode.value === "stack");
{
return {
accessorKey: key,
header: () => h("div", { class: "text-right" }, key),
- // @ts-ignore this comes from tanstack-table
+ // @ts-expect-error this comes from tanstack-table
cell: ({ row }) => {
const value = row.getValue(key);
return h("div", { class: "text-right font-medium" }, value as string);
diff --git a/src/components/Media/MediaStackedBarChart.vue b/src/components/Media/MediaStackedBarChart.vue
index 472b2db..bb68e1a 100644
--- a/src/components/Media/MediaStackedBarChart.vue
+++ b/src/components/Media/MediaStackedBarChart.vue
@@ -33,7 +33,6 @@ const series = computed(() => {
}`,
data: categories.value
.map((category) => props.sourceDistributions[i]?.find(({ media }) => category === media))
- // @ts-ignore
.map((a) => (a ? a[props.mode] : 0)),
};
});
diff --git a/src/components/Search/CorpusSelection.vue b/src/components/Search/CorpusSelection.vue
index 75b52d2..5a3cc5e 100644
--- a/src/components/Search/CorpusSelection.vue
+++ b/src/components/Search/CorpusSelection.vue
@@ -23,7 +23,6 @@ const { data: subCorpora, isPending: subCorporaLoading } = useQuery({
queryKey: ["get-corp-info", selectedCorpus] as const,
queryFn: async () => {
const response = await api.search.getCorpInfo({
- /** @ts-ignore undefined prevented through subCorpFetchingIsEnabled **/
corpname: selectedCorpus.value?.name,
subcorpora: 1,
});
diff --git a/src/components/Search/QueryItem.vue b/src/components/Search/QueryItem.vue
index 77055ce..68fec01 100644
--- a/src/components/Search/QueryItem.vue
+++ b/src/components/Search/QueryItem.vue
@@ -16,7 +16,6 @@ const setFilters = computed(() => {
// @ts-expect-error just counts the set filters. if it is undefined that's falsy.
(key) => props.query.facettingValues[key]?.length || props.query.facettingValues[key]?.value,
);
- keys;
return keys;
});
diff --git a/src/plugins/highcharts.client.ts b/src/plugins/highcharts.client.ts
index b44dbb4..616d337 100644
--- a/src/plugins/highcharts.client.ts
+++ b/src/plugins/highcharts.client.ts
@@ -17,6 +17,6 @@ export default defineNuxtPlugin((nuxtApp) => {
// overwrites the excel download to work propperly. this part is copied and adapted from a highcharts fiddle using that library. could be adapted to use a more maintained one, but would only recomend, if issues surface
HighchartsExcelDownload(Highcharts);
- // @ts-ignore
+ // @ts-expect-error this works and is like in the documentation
nuxtApp.vueApp.use(HighchartsVue, { tagName: "HighCharts" });
});
diff --git a/src/plugins/jsonViewer.ts b/src/plugins/jsonViewer.ts
index 3d158f1..c4a296d 100644
--- a/src/plugins/jsonViewer.ts
+++ b/src/plugins/jsonViewer.ts
@@ -1,7 +1,7 @@
import "vue-json-viewer/style.css";
// esilint-ignore-next-line @typescript-eslint/ban-ts-comment
-// @ts-ignore
+// @ts-expect-error sadly has no types
import JsonViewer from "vue-json-viewer/ssr";
export default defineNuxtPlugin((nuxtApp) => {
diff --git a/src/stores/corpora.ts b/src/stores/corpora.ts
index b72dbf9..89d6014 100644
--- a/src/stores/corpora.ts
+++ b/src/stores/corpora.ts
@@ -21,13 +21,11 @@ export const useCorporaStore = defineStore(
const corporaForSearch = computed(
() =>
- `corpname=${selectedCorpus.value?.corpname}${
- selectedSubCorpus.value ? `;usesubcorp=${selectedSubCorpus.value.n}` : ""
- }`,
+ `corpname=${selectedCorpus.value?.corpname ?? ""}${selectedSubCorpus.value ? `;usesubcorp=${selectedSubCorpus.value.n}` : ""}`,
);
const corporaForSearchWithoutSubCorpus = computed(
- () => `corpname=${selectedCorpus.value?.corpname}`,
+ () => `corpname=${selectedCorpus.value?.corpname ?? ""}`,
);
const corporaForSearchKeys = computed(() => {
diff --git a/src/stores/query.ts b/src/stores/query.ts
index 49adca8..f8eaddf 100644
--- a/src/stores/query.ts
+++ b/src/stores/query.ts
@@ -29,7 +29,7 @@ export const useQueryStore = defineStore(
const concordance_query: Partial = {};
- // @ts-ignore
+ // @ts-expect-error this is okay, because we set the correct key
concordance_query[keyToKey[type]] = userInput;
concordance_query.queryselector = type;
@@ -90,14 +90,13 @@ export const useQueryStore = defineStore(
});
const getQueryWithFacetting = (query: CorpusQuery) => {
- const result: Record = { ...query.concordance_query };
+ const result: Record> = { ...query.concordance_query };
for (const key in query.facettingValues) {
const elem = query.facettingValues[key];
if (!elem) continue;
// console.log({ key, elem })
if (Array.isArray(elem)) {
if (!elem.length) continue;
- // @ts-ignore
result[`sca_${key}`] = elem;
} else result[elem.key] = elem.value;
}
diff --git a/vitest.config.ts b/vitest.config.ts
index 38981b0..c7e5637 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -1,7 +1,6 @@
import { defineVitestConfig } from "@nuxt/test-utils/config";
export default defineVitestConfig({
- // @ts-ignore this is exactly as in the documentation
test: {
environment: "nuxt",
environmentOptions: {