no-reserved-default-properties-in-model - ESLint plugin rules
This rule disallows redefining the reserved default properties created_at, updated_at, and deleted_at in model.define.
Severity#
error. This rule is enabled in the recommended preset.
What it Targets#
This rule targets data model files in your project's src/modules directory. It reports a created_at, updated_at, or deleted_at property in a model.define schema, since Medusa adds these automatically.
The following code is reported by the rule:
Instead, remove the reserved property:
Why it's Important#
Medusa automatically adds , , and to every data model. Redefining them in your schema is redundant and can conflict with the auto-added columns.
Learn more in the Data Models documentation.
Fixable#
This rule is auto-fixable. Run the linter with the --fix option to apply the fix automatically.
Was this page helpful?