Skip to content

Commit 0af3822

Browse files
committed
Switched tsc for vue-tsc and fixed remaining errors
1 parent c8ee6ad commit 0af3822

35 files changed

Lines changed: 425 additions & 417 deletions

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"publish-win": "quasar build --mode electron -T win32 --publish always",
2424
"publish-linux": "quasar build --mode electron -T linux --publish always",
2525
"test": "vitest run ./test/vitest",
26-
"typecheck": "tsc"
26+
"typecheck": "vue-tsc"
2727
},
2828
"dependencies": {
2929
"@node-steam/vdf": "^2.1.0",
@@ -100,12 +100,12 @@
100100
"sass": "^1.70.0",
101101
"sass-loader": "^16.0.5",
102102
"sinon": "^11.1.1",
103-
"tsc": "^2.0.4",
104103
"tsx": "^4.20.5",
105104
"typescript": "^5.9.2",
106105
"vite-plugin-node-polyfills": "^0.23.0",
107106
"vitest": "^3.2.4",
108107
"vue": "^3.5.16",
108+
"vue-tsc": "^3.3.5",
109109
"wallaby-vue-compiler": "^1.0.3"
110110
},
111111
"engines": {

src-electron/ipc/node-path-impl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export function hookPathIpc(browserWindow: BrowserWindow) {
55
ipcMain.on("node:path:join", (event, ...args) => {
66
event.returnValue = path.join(...args);
77
});
8-
ipcMain.on("node:path:basename", (event, toResolve) => {
9-
event.returnValue = path.basename(toResolve);
8+
ipcMain.on("node:path:basename", (event, base, suffix) => {
9+
event.returnValue = path.basename(base, suffix);
1010
});
1111
ipcMain.on("node:path:resolve", (event, ...args) => {
1212
event.returnValue = path.resolve(...args);

src/components/DeferredInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ function emitChange(value: string): void {
2222
</script>
2323

2424
<template>
25-
<input class="input" :value="modelValue" @input="e => debounceExecutor(e.target.value)" />
25+
<input class="input" :value="modelValue" @input="e => debounceExecutor((e.target! as HTMLInputElement).value!)" />
2626
</template>

src/components/Progress.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ type ProgressProps = {
1818
1919
const props = withDefaults(defineProps<ProgressProps>(), {
2020
max: 100,
21-
value: undefined,
22-
className: []
21+
className: () => [] as string[]
2322
});
2423
</script>
2524

src/components/buttons/DonateButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<ExternalLink v-if="mod && mod.getDonationLink()"
3-
:url="mod.getDonationLink()"
3+
:url="mod.getDonationLink()!"
44
class="button"
55
v-tooltip.top="{content: 'Donate to the mod author', distance: 10}">
66
<i class='fas fa-heart margin-right margin-right--half-width'></i>

src/components/buttons/DonateIconButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<span v-if="mod && mod.getDonationLink() && extraRenderCondition" class="card-header-icon">
3-
<ExternalLink :url="mod.getDonationLink()" tag="span">
3+
<ExternalLink :url="mod.getDonationLink()!" tag="span">
44
<i class="fas fa-heart" v-tooltip.left="'Donate to the mod author'"></i>
55
</ExternalLink>
66
</span>

src/components/importing/LocalFileImportModal.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ async function selectFile() {
133133
filters: []
134134
}).then(value => {
135135
if (value.length > 0) {
136-
fileToImport.value = value[0];
136+
fileToImport.value = value[0]!;
137137
assumeDefaults();
138138
} else {
139139
waitingForSelection.value = false;
@@ -228,28 +228,28 @@ function inferFieldValuesFromFile(file: string): ImportFieldAttributes {
228228
}
229229
230230
if (hyphenSeparated.length === 3) {
231-
data.modAuthor = hyphenSeparated[0];
232-
data.modName = hyphenSeparated[1];
233-
const modVersion = santizeVersionNumber(hyphenSeparated[2]).toString().split(".");
231+
data.modAuthor = hyphenSeparated[0]!;
232+
data.modName = hyphenSeparated[1]!;
233+
const modVersion = santizeVersionNumber(hyphenSeparated[2]!).toString().split(".");
234234
data.modVersionMajor = Number(modVersion[0]);
235235
data.modVersionMinor = Number(modVersion[1]);
236236
data.modVersionPatch = Number(modVersion[2]);
237237
} else if (hyphenSeparated.length === 2) {
238-
data.modName = hyphenSeparated[0];
239-
const modVersion = santizeVersionNumber(hyphenSeparated[1]).toString().split(".");
238+
data.modName = hyphenSeparated[0]!;
239+
const modVersion = santizeVersionNumber(hyphenSeparated[1]!).toString().split(".");
240240
data.modVersionMajor = Number(modVersion[0]);
241241
data.modVersionMinor = Number(modVersion[1]);
242242
data.modVersionPatch = Number(modVersion[2]);
243243
} else if (underscoreSeparated.length === 3) {
244-
data.modAuthor = underscoreSeparated[0];
245-
data.modName = underscoreSeparated[1];
246-
const modVersion = santizeVersionNumber(underscoreSeparated[2]).toString().split(".");
244+
data.modAuthor = underscoreSeparated[0]!;
245+
data.modName = underscoreSeparated[1]!;
246+
const modVersion = santizeVersionNumber(underscoreSeparated[2]!).toString().split(".");
247247
data.modVersionMajor = Number(modVersion[0]);
248248
data.modVersionMinor = Number(modVersion[1]);
249249
data.modVersionPatch = Number(modVersion[2]);
250250
} else if (underscoreSeparated.length === 2) {
251-
data.modName = underscoreSeparated[0];
252-
const modVersion = santizeVersionNumber(underscoreSeparated[1]).toString().split(".");
251+
data.modName = underscoreSeparated[0]!;
252+
const modVersion = santizeVersionNumber(underscoreSeparated[1]!).toString().split(".");
253253
data.modVersionMajor = Number(modVersion[0]);
254254
data.modVersionMinor = Number(modVersion[1]);
255255
data.modVersionPatch = Number(modVersion[2]);

src/components/input/MultiSelect.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const visibleSelectedOptions = computed(() => {
4646
return props.selected.filter(value => value.trim().length > 0);
4747
})
4848
49-
function updateSelection(event: InputEvent) {
49+
function updateSelection(event: Event) {
5050
const target = event.target as HTMLSelectElement;
5151
emits('selection-changed', [...props.selected, target.value]);
5252
target.selectedIndex = 0;

src/components/modals/CategorySelectorModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ type CategorySelectorModalProps = {
99
const props = defineProps<CategorySelectorModalProps>();
1010
const emits = defineEmits<{
1111
'selected-category': [ev: Event];
12-
'deselectedCategory': [value: string];
12+
'deselected-category': [value: string];
1313
}>();
1414
1515
function emitSelected(event: Event) {
1616
emits('selected-category', event)
1717
}
1818
1919
function emitDeselected(key: string) {
20-
emits("deselected-category", key);
20+
emits('deselected-category', key);
2121
}
2222
</script>
2323

src/components/modals/ErrorModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ function close() {
2828
<h5 class="title is-5">Suggestion</h5>
2929
<p>{{solution}}</p>
3030
</div>
31-
<div class="mt-3 text-right" v-if="error.action">
32-
<button class="button is-white" @click="() => { error.action.function(); close(); }">
31+
<div class="mt-3 text-right" v-if="error && error.action">
32+
<button class="button is-white" @click="() => { error?.action?.function(); close(); }">
3333
{{error.action.label}}
3434
</button>
3535
</div>

0 commit comments

Comments
 (0)