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.
The rule reports Schema.decodeUnknownEffect and Schema.decodeUnknownExit calls. Use decodeEffect or decodeExit. The rule does not infer input types. Give a suppression reason for unknown external data.
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 provides no automatic fix. Rewrite the code to preserve its intended behavior.
For a boundary exception, use oxlint-disable-next-line rules/prefer-non-unknown-decode -- reason. Examples cover this rule only and may omit imports or declarations.
Source and tests
Enabled by the Effect preset.