Skip to content

Commit 2061fcf

Browse files
committed
fix: strict typecheck
1 parent cf1b385 commit 2061fcf

File tree

11 files changed

+15
-17
lines changed

11 files changed

+15
-17
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepal",
3-
"version": "2.6.0",
3+
"version": "3.0.0-alpha.1",
44
"description": "Nuxt+Vue Drupal Integration",
55
"license": "MIT",
66
"homepage": "https://github.com/liip/vuepal",

playground/app/composables/useInitData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { computed, useState, type ComputedRef } from '#imports'
2-
import type { InitData, MenuLink } from '~/types'
2+
import type { InitData, MenuLink } from '~~/types'
33

44
type UseInitData = {
55
menuLinks: ComputedRef<MenuLink[]>

playground/server/api/initData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineEventHandler, getQuery } from 'h3'
2-
import type { InitData, MenuLink } from '~/types'
2+
import type { InitData, MenuLink } from '~~/types'
33

44
const menuLinks = (language: string): MenuLink[] =>
55
[

src/module.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export default defineNuxtModule<ModuleOptions>({
4242
// manually install them. Note that this code is never executed on actual
4343
// installations of this module.
4444
if (isModuleBuild) {
45+
nuxt.options.typescript.strict = true
46+
nuxt.options.typescript.tsConfig.compilerOptions ||= {}
47+
nuxt.options.typescript.tsConfig.compilerOptions.noUncheckedIndexedAccess =
48+
true
4549
await installModule('nuxt-graphql-middleware', {
4650
downloadSchema: false,
4751
graphqlEndpoint: 'http://starterkit.ddev.site/de/graphql',
@@ -91,11 +95,6 @@ export default defineNuxtModule<ModuleOptions>({
9195
fileURLToPath(new URL('./runtime', import.meta.url)),
9296
)
9397

94-
helper.addAlias(
95-
'#vuepal/types',
96-
helper.resolvers.module.resolve('runtime/types'),
97-
)
98-
9998
helper.addAlias('#vuepal-build', helper.paths.moduleBuildDir)
10099

101100
helper.addAlias(

src/runtime/components/VuepalAdminToolbar/Palette/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
</template>
3636

3737
<script lang="ts" setup>
38-
import type { AdminMenuLinkFragment } from '#vuepal/types'
38+
import type { AdminMenuLinkFragment } from './../../../types'
3939
import Highlight from './Highlight.vue'
4040
import { computed, onMounted, ref, watch, nextTick } from '#imports'
4141
import { Fzf } from 'fzf'

src/runtime/components/VuepalAdminToolbar/Subtree.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<script lang="ts" setup>
4141
import { ref, watch, computed } from '#imports'
4242
import { adminToolbarIcons } from '#vuepal-build/admin-config'
43-
import type { AdminMenuLinkFragment } from '#vuepal/types'
43+
import type { AdminMenuLinkFragment } from './../../types'
4444
4545
defineOptions({
4646
name: 'AdminToolbarSubtree',

src/runtime/components/VuepalLocalTasks/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<script lang="ts" setup>
2020
import { useRoute, computed, useLazyAsyncData } from '#imports'
2121
import { createAdapter } from '#vuepal-build/adapter'
22-
import type { LocalTask } from '#vuepal/types'
22+
import type { LocalTask } from './../../types'
2323
import { nonNullable } from '../../helpers/type'
2424
2525
const adapter = createAdapter()

src/runtime/composables/buildDrupalMetatags/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function buildDrupalMetatags(
7575

7676
if (tags && Array.isArray(tags)) {
7777
for (let i = 0; i < tags.length; i++) {
78-
const tag = tags[i]
78+
const tag = tags[i]!
7979
const tagTitle = getTitle(tag)
8080
if (tagTitle) {
8181
title = tagTitle

src/runtime/helpers/url.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ export function getUrlExtension(url: string): string | undefined {
4848
}
4949
try {
5050
const parts = url.split(/[#?]/)
51-
return parts[0].split('.').pop()?.trim().toLowerCase() || ''
52-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
53-
} catch (_e) {
51+
return parts[0]?.split('.').pop()?.trim().toLowerCase() || ''
52+
} catch {
5453
// Noop.
5554
}
5655
}

0 commit comments

Comments
 (0)