Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(vitepress-twoslash): Add missing return statement in onError func…
…tion
  • Loading branch information
Karibash committed Sep 1, 2025
commit 1442449765c13b80cc0997b6160ed3de24433cc6
4 changes: 2 additions & 2 deletions packages/vitepress-twoslash/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function transformerTwoslash(options: VitePressPluginTwoslashOptions = {}
explicitTrigger = true,
} = options

const onError = (error: any, code: string): void => {
const onError = (error: any, code: string): string | void => {
const isCI = typeof process !== 'undefined' && process?.env?.CI
const isDev = typeof process !== 'undefined' && process?.env?.NODE_ENV === 'development'
const shouldThrow = (options.throws || isCI || !isDev) && options.throws !== false
Expand All @@ -28,7 +28,7 @@ export function transformerTwoslash(options: VitePressPluginTwoslashOptions = {}
throw error
else
console.error(error)
removeTwoslashNotations(code)
return removeTwoslashNotations(code)
}

const twoslash = createTransformerFactory(
Expand Down
Loading