This rule requires that when an action exports onSuccess, it must also export run. Gadget will error at runtime if an action has onSuccess but no run function.
Rule Details
This rule checks if the action file exports onSuccess and reports an error if there is no corresponding run export.
Severity: Error
Auto-fixable: No
Examples
Incorrect
Correct
Why This Matters
The onSuccess function is called after the run function completes successfully. Without a run function, there is nothing for onSuccess to run after, and Gadget will throw a runtime error.
Gadget will error at runtime if you export onSuccess without run. This rule catches the problem at development time.
When to Use
This rule is included in the recommended config and should always be enabled for Gadget projects. It prevents a common configuration error that causes runtime failures.