oxc
oxc copied to clipboard
isolatedDeclarations doesn't support `tsconfig` options
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' }