Explicit Return Types
Every function or method that is exported from a module, or is a public class method, must have an explicit return type annotation.…
$ aoe install @team/rule-explicit-return-types Projection
Always in _index.xml · the agent never has to ask for this.
ExplicitReturnTypes [rule] v1.0.0
Every function or method that is exported from a module, or is a public class method, must have an explicit return type annotation. Type inference is welcome inside function bodies, but the contract at the boundary must be stated explicitly.
Loaded when retrieval picks the atom as adjacent / supporting.
ExplicitReturnTypes [rule] v1.0.0
Every function or method that is exported from a module, or is a public class method, must have an explicit return type annotation. Type inference is welcome inside function bodies, but the contract at the boundary must be stated explicitly.
Checks
- Exported functions:
export function foo(): string { ... }— notexport function foo() { ... }. - Public class methods:
public bar(): Promise<User> { ... }— not inferred. - Arrow functions assigned to exported consts:
export const fn = (): void => { ... }. - Internal/private functions: inferred return type is acceptable.
Label
Explicit return types on all public functions
Loaded when retrieval picks the atom as a focal / direct hit.
ExplicitReturnTypes [rule] v1.0.0
Every function or method that is exported from a module, or is a public class method, must have an explicit return type annotation. Type inference is welcome inside function bodies, but the contract at the boundary must be stated explicitly.
Checks
- Exported functions:
export function foo(): string { ... }— notexport function foo() { ... }. - Public class methods:
public bar(): Promise<User> { ... }— not inferred. - Arrow functions assigned to exported consts:
export const fn = (): void => { ... }. - Internal/private functions: inferred return type is acceptable.
Label
Explicit return types on all public functions
Relations
related: [@team/rule-no-default-export, @team/tradeoff-strict-types-vs-iteration-speed, @team/principle-readability-over-cleverness] supplies-to: [@team/tradeoff-strict-types-vs-iteration-speed]
Label
Explicit return types on all public functions
Supplies To
- @team/tradeoff-strict-types-vs-iteration-speed
Source
aoe-engine/examples/coding-style/primes/compiled/@team/rule-explicit-return-types/atom.yaml