Skip to content

Commit 902a27d

Browse files
committed
chore: update typecheck
1 parent 5c43abe commit 902a27d

File tree

10 files changed

+162
-56
lines changed

10 files changed

+162
-56
lines changed

components/CommandPalette.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ useEventListener('keydown', (e) => {
8080
e.preventDefault()
8181
return
8282
case 'Enter': {
83-
runCommand(commands.commandsResult[selected.value])
83+
const command = commands.commandsResult[selected.value]
84+
if (command)
85+
runCommand(command)
8486
e.preventDefault()
8587
break
8688
}

components/MainPlayground.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,24 @@ function startDragging() {
1515
1616
function endDraggingVertical(e: { size: number }[]) {
1717
ui.isPanelDragging = false
18-
ui.panelDocs = e[0].size
18+
if (e) {
19+
ui.panelDocs = e[0]?.size || 0
20+
}
1921
}
2022
2123
function endDraggingHorizontal(e: { size: number }[]) {
2224
ui.isPanelDragging = false
23-
ui.panelEditor = e[0].size
24-
ui.panelPreview = e[1].size
25+
if (e) {
26+
ui.panelEditor = e[0]?.size || 0
27+
ui.panelPreview = e[1]?.size || 0
28+
}
2529
}
2630
2731
function draggingEmbeddedDocs(e: { size: number }[]) {
2832
ui.isPanelDragging = true
29-
ui.panelDocs = e[0].size
33+
if (e) {
34+
ui.panelDocs = e[0]?.size || 0
35+
}
3036
}
3137
3238
const terminalPaneProps = computed(() => {

components/PanelDocs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ interface BreadcrumbItem {
4040
4141
function findNavItemFromPath(
4242
path: string,
43-
items: ContentNavigationItem[] | null = navigation.value,
43+
items: ContentNavigationItem[] | null | undefined = navigation.value,
4444
): ContentNavigationItem | undefined {
4545
const item = items?.find(i => i.path === path)
4646
if (item)

components/PanelEditor.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function startDragging() {
3434
3535
function endDragging(e: { size: number }[]) {
3636
ui.isPanelDragging = false
37-
ui.panelFileTree = e[0].size
37+
ui.panelFileTree = e[0]?.size || 0
3838
}
3939
4040
// For panes size initialization on SSR
@@ -95,7 +95,7 @@ const panelInitEditor = computed(() => isMounted.value || {
9595
bg-faded px4 py2
9696
>
9797
<FileIcon :path="play.fileSelected?.filepath || ''" />
98-
<span flex-auto text-sm>{{ play.fileSelected?.filepath || 'Editor' }}</span>
98+
<span flex-auto text-sm>{{ play.fileSelected?.filepath || $t('editor') }}</span>
9999
<ButtonShowSolution
100100
my--1 mr--3 flex-none rounded px2 py1 text-sm op50
101101
hover="bg-active op100"

i18n/locales/en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ preview: Preview
2828
built: Built
2929
vueVersion: Vue version
3030
nuxtVersion: Nuxt version
31+
editor: Editor

i18n/locales/ja.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ preview: プレビュー
2828
built: ビルド
2929
vueVersion: Vueバージョン
3030
nuxtVersion: Nuxtバージョン
31+
editor: エディタ

monaco/vue.worker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ self.onmessage = () => {
8585
asFileName,
8686
),
8787
],
88-
languageServicePlugins: getFullLanguageServicePlugins(ts),
88+
languageServicePlugins: getFullLanguageServicePlugins(ts) as any,
8989
setup({ project }) {
90+
// @ts-expect-error missing types
9091
project.vue = { compilerOptions: vueCompilerOptions }
9192
},
9293
})

nuxt.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,14 @@ export default defineNuxtConfig({
141141
file: 'ja.yaml',
142142
},
143143
],
144-
lazy: true,
145144
strategy: 'prefix',
146145
defaultLocale: 'en',
147146
detectBrowserLanguage: {
148147
useCookie: true,
149148
cookieKey: 'i18n_redirected',
150149
redirectOn: 'root',
151150
},
152-
experimental: {
153-
autoImportTranslationFunctions: true,
154-
},
151+
autoDeclare: true,
155152
},
156153

157154
ogImage: {

0 commit comments

Comments
 (0)