mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
dc924892cc
Continuation of #5537. Ensure all conformance fixture files have a trailing line break.
29 lines
470 B
TypeScript
29 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;
|
|
}
|
|
}
|