link-no-cross-module-relationship - ESLint plugin rules
This rule requires that data model relationships (hasOne, belongsTo, hasMany, manyToMany) reference a data model defined in the same module.
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 relationship method that references a data model imported from another module.
The following code is reported by the rule:
Instead, reference a same-module data model and use a module link for cross-module references:
Why it's Important#
Modules are isolated and can't have direct database relationships across module boundaries. Cross-module references are defined with module links instead, which keeps modules decoupled.
Learn more in the Module Links documentation.
Fixable#
This rule isn't auto-fixable.