> ## Documentation Index
> Fetch the complete documentation index at: https://gadget.aurelienbbn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rules

> All 16 rules organized by category with severity, type, and fixability.

## Options and params

Validate that `options` and `params` exports contain values Gadget can serialize and process.

<CardGroup cols={1}>
  <Card title="action-no-invalid-options" icon="file-code" href="/eslint-plugin/reference/rules/action-no-invalid-options">
    Enforce that the Gadget action options export contains only valid JSON-serializable literals.{" "}

    <Badge color="red" size="sm">
      error
    </Badge>

    {" "}

    <Badge color="green" size="sm">
      fixable
    </Badge>
  </Card>

  <Card title="action-no-invalid-params" icon="file-code" href="/eslint-plugin/reference/rules/action-no-invalid-params">
    Enforce that Gadget action params export only uses supported JSON schema types and properties.{" "}

    <Badge color="red" size="sm">
      error
    </Badge>
  </Card>

  <Card title="action-no-invalid-timeout-ms" icon="file-code" href="/eslint-plugin/reference/rules/action-no-invalid-timeout-ms">
    Enforce that timeoutMS in Gadget action options does not exceed 900000ms (15 minutes).{" "}

    <Badge color="red" size="sm">
      error
    </Badge>

    {" "}

    <Badge color="green" size="sm">
      fixable
    </Badge>
  </Card>

  <Card title="action-require-explicit-return-type" icon="file-code" href="/eslint-plugin/reference/rules/action-require-explicit-return-type">
    Require returnType to be explicitly set in the options export of Gadget actions.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>

    {" "}

    <Badge color="green" size="sm">
      fixable
    </Badge>
  </Card>

  <Card title="action-require-timeout-ms-comment" icon="file-code" href="/eslint-plugin/reference/rules/action-require-timeout-ms-comment">
    Require a trailing inline comment describing the duration on the timeoutMS property in Gadget action options.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>

    {" "}

    <Badge color="green" size="sm">
      fixable
    </Badge>
  </Card>

  <Card title="global-action-no-action-type" icon="globe" href="/eslint-plugin/reference/rules/global-action-no-action-type">
    Disallow actionType in global action options.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>

    {" "}

    <Badge color="green" size="sm">
      fixable
    </Badge>
  </Card>

  <Card title="model-action-invalid-action-type" icon="cube" href="/eslint-plugin/reference/rules/model-action-invalid-action-type">
    Disallow invalid actionType values in model action options.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>
  </Card>

  <Card title="model-action-no-invalid-trigger" icon="cube" href="/eslint-plugin/reference/rules/model-action-no-invalid-trigger">
    Disallow scheduler triggers in model action options.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>

    {" "}

    <Badge color="green" size="sm">
      fixable
    </Badge>
  </Card>

  <Card title="model-action-no-transactional-timeout-mismatch" icon="cube" href="/eslint-plugin/reference/rules/model-action-no-transactional-timeout-mismatch">
    Disallow timeoutMS above 5000ms on model actions without explicitly setting transactional: false.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>
  </Card>
</CardGroup>

## Runtime safety

Prevent empty handlers, missing types, and patterns that cause transaction timeouts or billing surprises.

<CardGroup cols={1}>
  <Card title="action-no-await-handle-result-in-action" icon="file-code" href="/eslint-plugin/reference/rules/action-no-await-handle-result-in-action">
    Disallow awaiting handle.result() inside run or onSuccess exports in Gadget actions.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>
  </Card>

  <Card title="action-no-empty-on-success" icon="file-code" href="/eslint-plugin/reference/rules/action-no-empty-on-success">
    Disallow empty onSuccess exports in Gadget actions.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>

    {" "}

    <Badge color="green" size="sm">
      fixable
    </Badge>
  </Card>

  <Card title="action-no-return-value-in-on-success" icon="file-code" href="/eslint-plugin/reference/rules/action-no-return-value-in-on-success">
    Disallow returning a value from onSuccess in Gadget actions.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>

    {" "}

    <Badge color="green" size="sm">
      fixable
    </Badge>
  </Card>

  <Card title="action-require-action-run-type" icon="file-code" href="/eslint-plugin/reference/rules/action-require-action-run-type">
    Require Gadget action run and onSuccess exports to use generated type annotations.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>

    {" "}

    <Badge color="green" size="sm">
      fixable
    </Badge>
  </Card>

  <Card title="action-require-run-with-on-success" icon="file-code" href="/eslint-plugin/reference/rules/action-require-run-with-on-success">
    Require a run export when onSuccess is exported in Gadget actions.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>
  </Card>
</CardGroup>

## Enqueue safety

Enforce explicit retries and concurrency limits on `api.enqueue()` calls.

<CardGroup cols={1}>
  <Card title="action-no-enqueue-max-concurrency-exceeded" icon="layer-group" href="/eslint-plugin/reference/rules/action-no-enqueue-max-concurrency-exceeded">
    Disallow maxConcurrency values exceeding Gadget's hard limit of 100 in api.enqueue queue options.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>
  </Card>

  <Card title="action-no-implicit-enqueue-retries" icon="layer-group" href="/eslint-plugin/reference/rules/action-no-implicit-enqueue-retries">
    Require explicit retries option on api.enqueue calls to avoid unintended retry behavior.{" "}

    <Badge color="orange" size="sm">
      warn
    </Badge>
  </Card>
</CardGroup>
