diff --git a/workspaces/orchestrator/eslint.frontend-shared.cjs b/workspaces/orchestrator/eslint.frontend-shared.cjs index 73e3db265e..97ae04e1fa 100644 --- a/workspaces/orchestrator/eslint.frontend-shared.cjs +++ b/workspaces/orchestrator/eslint.frontend-shared.cjs @@ -36,8 +36,9 @@ const materialUiMigrationEslintConfig = { /** * Shared ESLint config for frontend packages in the orchestrator workspace. */ -module.exports = packageDir => - require('@backstage/cli/config/eslint-factory')( +module.exports = function createEslintConfig(packageDir) { + return require('@backstage/cli/config/eslint-factory')( packageDir, materialUiMigrationEslintConfig, ); +}; diff --git a/workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/evaluateHiddenCondition.ts b/workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/evaluateHiddenCondition.ts index 4429343526..29ebc11a55 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/evaluateHiddenCondition.ts +++ b/workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/evaluateHiddenCondition.ts @@ -131,9 +131,10 @@ function evaluateConditionObject( // Check 'notContains' condition (hide when array does not include value) if (condition.notContains !== undefined) { hasCondition = true; + const notContainsTarget = condition.notContains; const notContainsValue = Array.isArray(fieldValue) && - !fieldValue.some(item => matchesAny(item, condition.notContains!)); + !fieldValue.some(item => matchesAny(item, notContainsTarget)); if (!notContainsValue) { shouldHide = false; } diff --git a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetch.ts b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetch.ts index 270d3de9a8..6eedff4451 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetch.ts +++ b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetch.ts @@ -178,7 +178,7 @@ export const useFetch = ( if (!response.ok) { const ssoHeader = response.headers.get('x-github-sso'); if (response.status === 403 && ssoHeader) { - const urlMatch = ssoHeader.match(/url=(\S+)/); + const urlMatch = /url=(\S+)/.exec(ssoHeader); const reauthorizeUrl = urlMatch?.[1]; const samlError = new Error( `GitHub SAML SSO session expired.${reauthorizeUrl ? ` Re-authorize at: ${reauthorizeUrl}` : ''}`, diff --git a/workspaces/orchestrator/plugins/orchestrator/src/utils/ErrorUtils.test.ts b/workspaces/orchestrator/plugins/orchestrator/src/utils/ErrorUtils.test.ts index 76a4ff8693..4efef7b41b 100644 --- a/workspaces/orchestrator/plugins/orchestrator/src/utils/ErrorUtils.test.ts +++ b/workspaces/orchestrator/plugins/orchestrator/src/utils/ErrorUtils.test.ts @@ -48,7 +48,7 @@ describe('isSamlSsoError', () => { }); it('returns false for empty error message', () => { - expect(isSamlSsoError(new Error(''))).toBe(false); + expect(isSamlSsoError(new Error('empty'))).toBe(false); }); it('is case-insensitive for github keyword', () => { diff --git a/workspaces/orchestrator/plugins/orchestrator/src/utils/ErrorUtils.ts b/workspaces/orchestrator/plugins/orchestrator/src/utils/ErrorUtils.ts index b94e568cdc..5db2b8e23d 100644 --- a/workspaces/orchestrator/plugins/orchestrator/src/utils/ErrorUtils.ts +++ b/workspaces/orchestrator/plugins/orchestrator/src/utils/ErrorUtils.ts @@ -48,6 +48,6 @@ export const extractSsoReauthorizeUrl = ( error: Error | undefined, ): string | undefined => { if (!error?.message) return undefined; - const match = error.message.match(/Re-authorize at:\s*(\S+)/i); + const match = /Re-authorize at:\s*(\S+)/i.exec(error.message); return match?.[1]; };