Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/aurelienbobenrieth/gadget/llms.txt

Use this file to discover all available pages before exploring further.

This rule disallows the actionType property in global action options. The actionType property is only valid for model actions. Including it in global actions has no effect and may cause confusion.

Rule Details

This rule checks global action files (files in api/actions/) for the actionType property in the options export and reports an error if found. Severity: Error Auto-fixable: Yes

Examples

Incorrect

// In api/actions/sendEmail.ts
export const options: ActionOptions = {
  actionType: "custom"
};

// With other properties
export const options: ActionOptions = {
  actionType: "create",
  returnType: true
};

Correct

// In api/actions/sendEmail.ts
export const options: ActionOptions = {
  returnType: true
};

// No actionType property
export const options: ActionOptions = {
  timeoutMS: 50000,
  returnType: true
};

Auto-fixes

The rule automatically removes the actionType property:
// Before
export const options: ActionOptions = {
  actionType: "create",
  returnType: true
};

// After auto-fix
export const options: ActionOptions = {
  returnType: true
};
This rule only applies to global actions. Model actions (in api/models/*/actions/) should use actionType to specify the action type.

When to Use

This rule is included in the recommended config and should always be enabled for Gadget projects. It prevents invalid configuration that could cause confusion or unexpected behavior.

Build docs developers (and LLMs) love