Rules
prefer-non-unknown-decode
Use typed Schema decoders when the input type is already known.
Purpose and behavior
Use typed Schema decoders when the input type is already known.
Reports Schema.decodeUnknownEffect and Schema.decodeUnknownExit calls in favor of decodeEffect/decodeExit. The check does not infer the actual input type. Truly unknown external data is a valid reasoned exception.
Options
No configurable options. Enable with "rules/prefer-non-unknown-decode": "error".
Invalid example
Schema.decodeUnknownEffect(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/prefer-non-unknown-decode -- reason comment. Examples illustrate this rule alone and may omit imports and declarations.
Source and tests
Enabled by the Effect preset.