What the linter reports:
onSuccess return values are ignored. Use return; or remove it.
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 returning a value from onSuccess in Gadget actions.
| Recommended | Strict | Auto-fixable | Scope |
|---|---|---|---|
| warn | error | true | Gadget action files |
onSuccess return values are ignored. Use return; or remove it.
export const onSuccess: ActionOnSuccess = async ({ record }) => {
await notify(record);
// return values in onSuccess are silently ignored by Gadget
return someVariable;
};
export const onSuccess: ActionOnSuccess = async ({ record }) => {
await notify(record);
// no return value - onSuccess results are always discarded
};
Was this page helpful?