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:
@@ -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 =>
|
||||
|
||||
Reference in New Issue
Block a user