Closed AntonioVentilii-DFINITY closed 1 month ago
We want to introduce a new custom rule that enforces the declaration of non-void return types
function foo() { return 42; } const foo = function() { return "hello"; } const foo = () => { return true; } const bar = async function() { return 42; } async function bar() { return true; }
function foo(): number { return 42; } const foo = function(): string { return "hello"; } const foo = (): boolean => true; const bar = async function(): Promise<number> { return Promise.resolve(42); } async function bar(): Promise<boolean> { return Promise.resolve(true); } function foo() { // No return value } const foo = function() { // No return value } const foo = () => { // No return value } const bar = async function() { // No return value } async function bar() { // No return value }
Motivation
We want to introduce a new custom rule that enforces the declaration of non-void return types
Incorrect
Correct