Skip to content

oxc-transform does not return declaration ever since after the v0.30 version #7010

@tunnckoCore

Description

@tunnckoCore

I use it to convert typescript files, but any version after the 0.30.0 version it doesn't have declaration in the result that the method returns

const xform = oxc.transform(filepath, source, {
  cwd: opts.cwd,
  typescript: {
    // if `--dts` flag emit types, otherwise don't
    declaration: opts.dts ? { stripInternal: false } : {},
    rewriteImportExtensions: true,
  },
});

console.log(xform); // => in 0.30.0: { code, declaration, errors }

if (xform.errors.length > 0) {
  throw new Error('oxc-transform failure: ' + xform.errors.join(';'));
}
if (typeof xform.declaration !== 'string') {
  throw new Error('oxc-transform failure: no declaration');
}

Does it stopped extracting declarations or what?

Metadata

Metadata

Assignees

Labels

C-bugCategory - BugP-highPriority - High

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions