Skip to content

Commit fffbce6

Browse files
committed
fix: typecheck
1 parent ffbd13a commit fffbce6

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

docs/nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default defineNuxtConfig({
22
// https://github.com/nuxt-themes/docus
3-
extends: '@nuxt-themes/docus',
3+
extends: ['@nuxt-themes/docus'],
44

55
modules: [
66
// https://github.com/nuxt-modules/plausible

src/module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export default defineNuxtModule<ModuleOptions>({
4242
},
4343
headings: options.headings!
4444
})
45+
46+
// @ts-ignore
4547
nuxt.options.runtimeConfig.mdc = defu(nuxt.options.runtimeConfig.mdc, {
4648
highlight: options.highlight ? {
4749
theme: options.highlight!.theme!,

src/runtime/parser/toc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MDCNode, Toc, TocLink, MDCElement, MDCRoot } from '../types'
1+
import type { MDCNode, Toc, TocLink, MDCElement, MDCRoot } from '../types'
22
import { flattenNode, flattenNodeText } from '../utils/ast'
33

44
const TOC_TAGS = ['h2', 'h3', 'h4', 'h5', 'h6']

src/runtime/parser/utils/plugins.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Processor } from 'remark-rehype/lib'
2-
import { MDCParseOptions, RehypePlugin, RemarkPlugin } from '../../types'
1+
import type { Processor } from 'remark-rehype/lib'
2+
import type { MDCParseOptions, RehypePlugin, RemarkPlugin } from '../../types'
33

44
export const useProcessorPlugins = async (processor: Processor, plugins: Exclude<MDCParseOptions['rehype'] | MDCParseOptions['remark'], undefined>['plugins'] = {}) => {
55
const toUse = Object.entries(plugins).filter(p => p[1] !== false) as Array<[string, RemarkPlugin | RehypePlugin]>
@@ -8,4 +8,4 @@ export const useProcessorPlugins = async (processor: Processor, plugins: Exclude
88
const instance = plugin[1].instance || await import(/* @vite-ignore */ plugin[0] ).then(m => m.default || m)
99
processor.use(instance, plugin[1].options)
1010
}
11-
}
11+
}

src/runtime/types/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Options as RehypeOption } from 'remark-rehype'
2-
import { Theme, Highlighter } from '../shiki/types'
2+
import type { Theme, Highlighter } from '../shiki/types'
33

44
export interface RemarkPlugin {
55
instance?: any

test/markdown/xss.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect, it } from 'vitest'
22
import { parseMarkdown } from '../utils/parser'
3-
import { MDCElement } from '../../src/runtime/types'
3+
import type { MDCElement } from '../../src/runtime/types'
44
import { validateProp } from '../../src/runtime/parser/utils/props'
55

66
const md = `\

0 commit comments

Comments
 (0)