Neverthrow Return Types

Require `neverthrow`-based return types in TypeScript and JavaScript code whenever the surrounding technology allows it. Use when creating, refactoring, reviewing, or extending standalone functions, exported module functions, class methods, object methods, service methods, repository methods, and similar APIs that should expose explicit success and failure result types in their signatures. Prefer `Result<T, E>` for synchronous code and `ResultAsync<T, E>` for asynchronous code. Only skip a `neverthrow` return type when a framework, library, runtime interface, or externally imposed contract is incompatible and requires a different return shape.

code-sherpas 5560d50 5.3 KB Updated

File contents

code-sherpas/agent-skills/tree/main/skills/neverthrow-return-types commit 5560d500e4

Frequently asked questions

npx skillmds@latest add code-sherpas/neverthrow-return-types