Merge pull request #33590 from jonkoops/fix/eslint-plugin-ts6-compat

This commit is contained in:
Fredrik Adelöw
2026-03-26 13:36:09 +01:00
committed by GitHub
2 changed files with 11 additions and 9 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/eslint-plugin': patch
---
Fixed `no-mixed-plugin-imports` rule to return `null` from non-fixable suggestion handlers and added an explicit `SuggestionReportDescriptor[]` type annotation, matching the stricter type checking in TypeScript 6.0.
@@ -173,6 +173,7 @@ module.exports = {
!ignoreTargetPackages.includes(targetName),
)
) {
/** @type {import('eslint').Rule.SuggestionReportDescriptor[]} */
const suggest = [];
if (
@@ -187,9 +188,9 @@ module.exports = {
sourcePackage: sourceName,
sourceRole: sourceRole,
},
/** @param {import('eslint').Rule.RuleFixer} _fixer */
fix(_fixer) {
fix() {
// Not a fixable case, just give a suggestion to change plugin id
return null;
},
});
suggest.push({
@@ -197,7 +198,6 @@ module.exports = {
data: {
targetPackage: targetName,
},
/** @param {import('eslint').Rule.RuleFixer} fixer */
fix(fixer) {
const source = context.sourceCode;
const nodeSource = source.getText(imp.node);
@@ -210,7 +210,6 @@ module.exports = {
data: {
targetPackage: targetName,
},
/** @param {import('eslint').Rule.RuleFixer} fixer */
fix(fixer) {
const source = context.sourceCode;
const nodeSource = source.getText(imp.node);
@@ -228,7 +227,6 @@ module.exports = {
data: {
targetPackage: targetName,
},
/** @param {import('eslint').Rule.RuleFixer} fixer */
fix(fixer) {
const source = context.sourceCode;
const nodeSource = source.getText(imp.node);
@@ -241,7 +239,6 @@ module.exports = {
data: {
targetPackage: targetName,
},
/** @param {import('eslint').Rule.RuleFixer} fixer */
fix(fixer) {
const source = context.sourceCode;
const nodeSource = source.getText(imp.node);
@@ -252,9 +249,9 @@ module.exports = {
} else {
suggest.push({
messageId: 'removeImport',
/** @param {import('eslint').Rule.RuleFixer} _fixer */
fix(_fixer) {
// Not a fixable case, just give a suggestion to remove the import
fix() {
// Not a fixable case, just give a suggestion to change plugin id
return null;
},
});
}