What the linter reports:
- Use ActionOnSuccess for onSuccess.
- Use ActionRun for run.
- Type onSuccess as ActionOnSuccess.
- Type run as ActionRun.
Examples
- Incorrect
- Correct
api/models/widget/actions/create.ts
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Require Gadget action run and onSuccess exports to use generated type annotations.
| Recommended | Strict | Auto-fixable | Scope |
|---|---|---|---|
| warn | error | true | Gadget action files |
import { applyParams, save } from "gadget-server";
// missing ActionRun type annotation
export const run = async ({ params, record }) => {
await applyParams(record, params);
await save(record);
};
import { applyParams, save } from "gadget-server";
// ActionRun provides type-safe params and record
export const run: ActionRun = async ({ params, record }) => {
await applyParams(record, params);
await save(record);
};
Was this page helpful?