oxc icon indicating copy to clipboard operation
oxc copied to clipboard

isolatedDeclarations doesn't support `tsconfig` options

Open tombl opened this issue 7 months ago • 2 comments

Some tsconfig options are relevant for declaration emit, but there's currently no way to pass these.

> code = "/** @internal */ export function hello() {}"

> require("oxc-transform").isolatedDeclaration("example.ts", code)
{ errors: ['TS9007: Function must have an explicit return type annotation with --isolatedDeclarations.'] }

> require("typescript").transpileDeclaration(code, {})
{
  diagnostics: [{
    messageText: 'Function must have an explicit return type annotation with --isolatedDeclarations.',
  }]
}

> require("typescript").transpileDeclaration(code, { compilerOptions: { stripInternal: true } })
{ outputText: 'export {};\n' }

tombl avatar Jun 28 '24 16:06 tombl