www/apps/resources/app/lint/rules/scheduled-job-config-required/page.mdx
export const metadata = {
title: scheduled-job-config-required - ESLint plugin rules,
}
This rule requires scheduled job files to export a config object with name and schedule properties.
error. This rule is enabled in the recommended preset.
This rule targets files in your project's src/jobs directory. It reports a scheduled job file that's missing the named config export, or whose config object doesn't declare both a name and a schedule property.
The following code is reported by the rule:
export default async function () {}
export const config = {}
Instead, export a config object with name and schedule:
export default async function () {}
export const config = {
name: "sync-products",
schedule: "0 0 * * *",
}
The name uniquely identifies the job, and the schedule tells Medusa when to run it. Without both, Medusa can't register the job.
Learn more in the Scheduled Jobs documentation.
This rule isn't auto-fixable.