What the linter reports:
Remove empty onSuccess.
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.
Disallow empty onSuccess exports in Gadget actions.
| Recommended | Strict | Auto-fixable | Scope |
|---|---|---|---|
| warn | error | true | Gadget action files |
Remove empty onSuccess.
// empty onSuccess adds overhead without doing anything
export const onSuccess: ActionOnSuccess = async () => {};
export const onSuccess: ActionOnSuccess = async ({ record }) => {
// onSuccess must contain at least one statement, or be omitted entirely
await doSomething(record);
};
Was this page helpful?