oxc/crates/oxc_isolated_declarations/tests/fixtures/async-function.ts
overlookmotel dc924892cc test: add trailing line breaks to conformance fixtures (#5541)
Continuation of #5537. Ensure all conformance fixture files have a trailing line break.
2024-09-06 12:55:17 +00:00

28 lines
470 B
TypeScript

// Correct
async function asyncFunctionGood(): Promise<number> {}
const asyncFunctionGoo2 = async (): Promise<number> => {
return Promise.resolve(0);
}
class AsyncClassGood {
async method(): number {
return 42;
}
}
// Need to explicit return type for async functions
// Incorrect
async function asyncFunction() {
return 42;
}
const asyncFunction2 = async () => {
return "Hello, World!";
}
class AsyncClassBad {
async method() {
return 42;
}
}