Skip to content

Conversation

@zthxxx
Copy link

@zthxxx zthxxx commented Dec 17, 2025

Summary

  • pass abortOnError through dts pipeline (tsc/tsgo) instead of always failing when type-check has error
  • allow bundling to proceed when abortOnError is false despite diagnostics

Related Links

N/A

Checklist

  • Tests updated (not required).
  • Documentation updated (not required).

- pass `abortOnError` through dts pipeline (tsc/tsgo) instead of always failing
- allow bundling to proceed when `abortOnError` is `false` despite diagnostics
Copilot AI review requested due to automatic review settings December 17, 2025 12:27
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the DTS generation pipeline to properly honor the abortOnError configuration option. Previously, the TypeScript compilation would always abort when encountering type errors, regardless of the abortOnError setting. The changes ensure that when abortOnError is set to false, the build continues and bundling proceeds even when type-check errors are present.

Key changes:

  • Thread abortOnError parameter through both tsc and tsgo compilation pipelines
  • Conditionally throw errors based on abortOnError setting instead of always aborting
  • Allow bundling to proceed when errors exist but abortOnError is false

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/plugin-dts/src/tsc.ts Added abortOnError to EmitDtsOptions type and modified error handling in handleDiagnosticsAndProcessFiles and solution builder path to conditionally throw based on this flag
packages/plugin-dts/src/tsgo.ts Modified handleDiagnosticsAndProcessFiles to accept and use abortOnError parameter, passing it through from emitDtsTsgo function
packages/plugin-dts/src/dts.ts Extracted abortOnError from options, passed it to emit functions, and updated tsgo bundling condition to allow bundling when errors exist but abortOnError is false

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// do not log the stack trace, diagnostic messages are enough
error.stack = '';
throw error;
if (abortOnError) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When bundle: false with abortOnError: false, the error should still be throwed I think. abortOnError means not exit the process instead of not throwing error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants