Skip to content

Commit

Permalink
fix: add syntactic and semantic diagnostics (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcaaa31928 committed Mar 20, 2024
1 parent 39606bd commit 7c10782
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/plugin.ts
Expand Up @@ -365,7 +365,11 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
entryRoot = entryRoot || publicRoot
entryRoot = ensureAbsolute(entryRoot, root)

const diagnostics = program.getDeclarationDiagnostics()
const diagnostics = [
...program.getDeclarationDiagnostics(),
...program.getSemanticDiagnostics(),
...program.getSyntacticDiagnostics()
]

if (diagnostics?.length) {
logger.error(ts.formatDiagnosticsWithColorAndContext(diagnostics, host))
Expand Down

0 comments on commit 7c10782

Please sign in to comment.