这是indexloc提供的服务,不要输入任何密码
Skip to content

Add ability to not fail on dts errors. #1339

@sanex3339

Description

@sanex3339

It would be really nice to have the ability to not fail on type errors during dts generation.

For example, add the ability to force set "noEmitOnError": false

Context:

  • we have a lot of type-errors during d.ts generation only but these errors don't affect the result d.ts file.

Right now the noEmitOnError: true overrides the one passed by a user:

 ...compilerOptions,
noEmitOnError: true,

tsup/src/rollup.ts

Lines 106 to 123 in 92ee842

plugins: [
tsupCleanPlugin,
tsResolveOptions && tsResolvePlugin(tsResolveOptions),
jsonPlugin(),
ignoreFiles,
dtsPlugin.default({
tsconfig: options.tsconfig,
compilerOptions: {
...compilerOptions,
baseUrl: compilerOptions.baseUrl || '.',
// Ensure ".d.ts" modules are generated
declaration: true,
// Skip ".js" generation
noEmit: false,
emitDeclarationOnly: true,
// Skip code generation when error occurs
noEmitOnError: true,
// Avoid extra work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions