Skip to main content
This rule enforces that the actionType property in model action options is set to one of the valid values: create, update, delete, or custom. Invalid action types will cause runtime errors in Gadget.

Rule Details

This rule checks the actionType property in model action options and reports an error if the value is not one of the supported types. Valid action types:
  • "create"
  • "update"
  • "delete"
  • "custom"
Severity: Error Auto-fixable: No

Examples

Incorrect

Correct

This rule only applies to model actions (files in api/models/*/actions/). Global actions should not have an actionType property at all.

When to Use

This rule is included in the recommended config and should always be enabled for Gadget projects. It prevents runtime errors by catching invalid action types at development time.