UNPKG

typesafe-ts

Version:

TypeScript utilities for type-safe error handling and optional values

21 lines 889 B
import { ESLintUtils } from "@typescript-eslint/utils"; type Options = [ { allowExceptions?: string[]; allowTestFiles?: boolean; autoFix?: boolean; } ]; type MessageIds = "noThrowStatement" | "noTryCatchBlock" | "useResultTry" | "useResultTryAsync"; /** * ESLint rule that enforces Result usage patterns instead of throw statements and try/catch blocks. * * This rule: * - Disallows `throw` statements, suggesting `result.error()` instead * - Disallows `try/catch` blocks, suggesting `result.try()` or `result.try_async()` * - Detects calls to functions that throw and requires wrapping with `result.try()` * - Provides auto-fix suggestions where possible */ export declare const enforceResultUsage: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>; export default enforceResultUsage; //# sourceMappingURL=lint.d.ts.map