feat(eslint): relax frontend imports for nfs

allow frontend plugins to import from other frontend plugins with same
plugin id to allow plugin overrides without unnecessary eslint warning.

relates to #31372

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-10-09 15:11:17 +03:00
parent 9f6f46d234
commit a1dae7180d
7 changed files with 65 additions and 4 deletions
@@ -146,11 +146,24 @@ module.exports = {
}
const sourceRole = pkg.packageJson.backstage?.role;
const sourcePluginId = pkg.packageJson.backstage?.pluginId;
const targetRole = targetPackage.packageJson.backstage?.role;
const targetPluginId = targetPackage.packageJson.backstage?.pluginId;
if (!sourceRole || !targetRole) {
return;
}
// Allow frontend plugins to import from other frontend plugins with the same pluginId for NFS
if (
sourceRole === 'frontend-plugin' &&
targetRole === 'frontend-plugin' &&
sourcePluginId &&
targetPluginId &&
sourcePluginId === targetPluginId
) {
return;
}
if (
roleRules.some(
rule =>