chore(eslint): add same plugin id suggestion

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-10-10 10:36:26 +03:00
parent a1dae7180d
commit cba3cd5203
@@ -64,6 +64,7 @@ module.exports = {
messages: {
forbidden:
'{{sourcePackage}} ({{sourceRole}}) uses forbidden import from {{targetPackage}} ({{targetRole}}).',
useSamePluginId: `Import of {{targetPackage}} ({{targetRole}}) from {{sourceRole}} is forbidden unless you are overriding the plugin, in which case the \`backstage.pluginId\` in {{sourcePackage}}/package.json must be the same as in {{targetPackage}}`,
useReactPlugin:
'Use web library {{targetPackage}}-react or common library instead.',
useNodePlugin:
@@ -178,6 +179,19 @@ module.exports = {
(sourceRole === 'frontend-plugin' || sourceRole === 'web-library') &&
targetRole === 'frontend-plugin'
) {
suggest.push({
messageId: 'useSamePluginId',
data: {
targetPackage: targetName,
targetRole: targetRole,
sourcePackage: sourceName,
sourceRole: sourceRole,
},
/** @param {import('eslint').Rule.RuleFixer} _fixer */
fix(_fixer) {
// Not a fixable case, just give a suggestion to change plugin id
},
});
suggest.push({
messageId: 'useReactPlugin',
data: {