Skip to content

Isolated declaration leaves async keyword in methods #4120

@sheremet-va

Description

@sheremet-va

async keyword is not allowed in isolated declarations.

Repro:

import { isolatedDeclaration } from 'oxc-transform'
import { transpileDeclaration } from 'typescript'

const code = `
class Test {
  async getValue(): Promise<string> {
    return 'Hello World';
  }
}
`

const oxc = isolatedDeclaration('test.ts', code)
const ts = transpileDeclaration(code, {})

console.log(
  oxc.sourceText,
  ts.outputText
)

Output:

declare class Test {
        async getValue(): Promise<string>;
}
 declare class Test {
    getValue(): Promise<string>;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions