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.
The rule reports Schema.decodeSync, decodePromise, decodeUnknownSync and decodeUnknownPromise calls. Use decodeEffect or decodeUnknownEffect, or decodeExit when appropriate. The rule ignores other namespaces.
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 provides no automatic fix. Rewrite the code to preserve its intended behavior.
For a boundary exception, use oxlint-disable-next-line rules/no-sync-decode -- reason. Examples cover this rule only and may omit imports or declarations.
Source and tests
Enabled by the Effect preset.