Rules
no-sync-decode
Keep Schema decoding in Effect or Exit rather than Sync or Promise.
Purpose and behavior
Keep Schema decoding in Effect or Exit rather than Sync or Promise.
Reports Schema.decodeSync, decodePromise, decodeUnknownSync and decodeUnknownPromise calls. Use decodeEffect or decodeUnknownEffect, or decodeExit where appropriate. Other namespace names are ignored.
Options
No configurable options. Enable with "rules/no-sync-decode": "error".
Invalid example
Schema.decodeSync(schema)(input)Valid example
Schema.decodeEffect(schema)(input)Fixes and exceptions
This rule reports diagnostics without an automatic fix. Rewrite the code deliberately rather than guessing its intended semantics.
For a genuine boundary exception, use an oxlint-disable-next-line rules/no-sync-decode -- reason comment. Examples illustrate this rule alone and may omit imports and declarations.
Source and tests
Enabled by the Effect preset.