diff --git a/src/modules/README.md b/src/modules/README.md index 4504250..ccb7340 100644 --- a/src/modules/README.md +++ b/src/modules/README.md @@ -3,7 +3,7 @@ A custom user module system. Place a `.ts` file with the following template, it will be installed automatically. ```ts -import { type UserModule } from '~/types' +import type { UserModule } from '~/types' export const install: UserModule = ({ app, router, isClient }) => { // do something diff --git a/src/modules/i18n.ts b/src/modules/i18n.ts index 16bc3ab..f87b3c0 100644 --- a/src/modules/i18n.ts +++ b/src/modules/i18n.ts @@ -1,6 +1,6 @@ import type { Locale } from 'vue-i18n' import { createI18n } from 'vue-i18n' -import { type UserModule } from '~/types' +import type { UserModule } from '~/types' // Import i18n resources // https://vitejs.dev/guide/features.html#glob-import diff --git a/src/modules/nprogress.ts b/src/modules/nprogress.ts index 7354682..655e9d5 100644 --- a/src/modules/nprogress.ts +++ b/src/modules/nprogress.ts @@ -1,5 +1,5 @@ import NProgress from 'nprogress' -import { type UserModule } from '~/types' +import type { UserModule } from '~/types' export const install: UserModule = ({ isClient, router }) => { if (isClient) { diff --git a/src/modules/pinia.ts b/src/modules/pinia.ts index b27907a..6fb0a5b 100644 --- a/src/modules/pinia.ts +++ b/src/modules/pinia.ts @@ -1,5 +1,5 @@ import { createPinia } from 'pinia' -import { type UserModule } from '~/types' +import type { UserModule } from '~/types' // Setup Pinia // https://pinia.vuejs.org/ diff --git a/src/modules/pwa.ts b/src/modules/pwa.ts index e3c3499..f3c3842 100644 --- a/src/modules/pwa.ts +++ b/src/modules/pwa.ts @@ -1,4 +1,4 @@ -import { type UserModule } from '~/types' +import type { UserModule } from '~/types' // https://github.com/antfu/vite-plugin-pwa#automatic-reload-when-new-content-available export const install: UserModule = ({ isClient, router }) => { diff --git a/src/shims.d.ts b/src/shims.d.ts index ba35046..c1bffb0 100644 --- a/src/shims.d.ts +++ b/src/shims.d.ts @@ -4,14 +4,14 @@ declare interface Window { // with unplugin-vue-markdown, markdown files can be treated as Vue components declare module '*.md' { - import { type DefineComponent } from 'vue' + import type { DefineComponent } from 'vue' const component: DefineComponent export default component } declare module '*.vue' { - import { type DefineComponent } from 'vue' + import type { DefineComponent } from 'vue' const component: DefineComponent export default component diff --git a/src/types.ts b/src/types.ts index 8fa90dc..09d2492 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,3 +1,3 @@ -import { type ViteSSGContext } from 'vite-ssg' +import type { ViteSSGContext } from 'vite-ssg' export type UserModule = (ctx: ViteSSGContext) => void diff --git a/test/component.test.ts b/test/component.test.ts index a5bc63e..afe3041 100644 --- a/test/component.test.ts +++ b/test/component.test.ts @@ -2,7 +2,7 @@ import { mount } from '@vue/test-utils' import { describe, expect, it } from 'vitest' import TheCounter from '../src/components/TheCounter.vue' -describe('TheCounter.vue', () => { +describe('component TheCounter.vue', () => { it('should render', () => { const wrapper = mount(TheCounter, { props: { initial: 10 } }) expect(wrapper.text()).toContain('10') diff --git a/tsconfig.json b/tsconfig.json index 497d6e4..e037b7e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,15 @@ { "compilerOptions": { "target": "ESNext", - "lib": ["DOM", "ESNext"], "jsx": "preserve", + "lib": ["DOM", "ESNext"], + "baseUrl": ".", "module": "ESNext", "moduleResolution": "node", - "baseUrl": ".", "paths": { "~/*": ["src/*"] }, + "resolveJsonModule": true, "types": [ "vitest", "vite/client", @@ -18,14 +19,13 @@ "vite-plugin-pwa/client", "unplugin-vue-macros/macros-global" ], - "resolveJsonModule": true, "allowJs": true, - "isolatedModules": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, "strict": true, "strictNullChecks": true, "noUnusedLocals": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, "skipLibCheck": true }, "vueCompilerOptions": {