| Recommended | Strict | Auto-fixable | Scope |
|---|
| warn | error | true | Gadget action files |
What the linter reports:
- Use ActionOnSuccess for onSuccess.
- Use ActionRun for run.
- Type onSuccess as ActionOnSuccess.
- Type run as ActionRun.
Examples
api/models/widget/actions/create.ts
import { applyParams, save } from "gadget-server";
// missing ActionRun type annotation
export const run = async ({ params, record }) => {
await applyParams(record, params);
await save(record);
};
api/models/widget/actions/create.ts
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);
};
Last modified on March 10, 2026