scheduled-job-name-unique - ESLint plugin rules

This rule requires a scheduled job's config.name to be unique across all scheduled jobs in the project.

Severity#

error. This rule is enabled in the strict preset.

By default, Medusa projects use the recommended preset, which doesn't enable this rule. To use it, switch to the strict preset.

What it Targets#

This rule targets files in your project's src/jobs directory. It reports a config.name that's already used by another scheduled job file.

The following code is reported by the rule when another job already uses the name sync-products:

src/jobs/sync-products-copy.ts
1export default async function () {}2
3export const config = {4  name: "sync-products",5  schedule: "0 0 * * *",6}

Instead, give the job a unique name:

src/jobs/sync-products-copy.ts
1export default async function () {}2
3export const config = {4  name: "sync-products-copy",5  schedule: "0 0 * * *",6}

Why it's Important#

Medusa identifies each scheduled job by its name. Two jobs sharing a name conflict with each other, so only one is registered.

Learn more in the Scheduled Jobs documentation.

Fixable#

This rule isn't auto-fixable.

Was this page helpful?
Ask Bloom
For assistance in your development, use Claude Code Plugins or Docs MCP server in Cursor, VSCode, etc...FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break
⇧↵