Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion packages/twoslash/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function createTransformerFactory(
catch (error) {
const result = onTwoslashError(error, code, lang, this.options)
if (typeof result === 'string')
return code
return result
}
}
},
Expand Down
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