From 48dc41e815d804824d14ee9e389fab7f093d4c81 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Thu, 18 Jul 2024 16:39:25 +0100 Subject: [PATCH] Update a.tsx --- apps/frontpage/components/docs/mdx/a.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/frontpage/components/docs/mdx/a.tsx b/apps/frontpage/components/docs/mdx/a.tsx index e5aea875..e0ddc726 100644 --- a/apps/frontpage/components/docs/mdx/a.tsx +++ b/apps/frontpage/components/docs/mdx/a.tsx @@ -24,7 +24,7 @@ function getParentPartOfPath( return indexPagePath.length === 1 ? activeVersion.id === latestVersion.id ? 'docs' - : activeVersion.inSlug ?? activeVersion.id + : (activeVersion.inSlug ?? activeVersion.id) : indexPagePath[indexPagePath.length - 1]; } @@ -45,13 +45,12 @@ export const A: FC = ({ } let href = hrefIn - ?.replace(/^(?:(?!http).*)\.mdx/, '$1') + // eslint-disable-next-line prefer-named-capture-group -- TODO: Fix regex with new eslint rules + ?.replace(/^((?!http).*)\.mdx/, '$1') .replace(/\/index$/, '') // ../../release-7-6/docs/migration-guide.mdx#major-breaking-changes -> ../../docs/7/migration-guide#major-breaking-changes - .replace( - /^(?:(?!http).*)(?:release-)(?:\d+)-\d+\/docs(?:.*)/, - '$1docs/$2$3', - ); + // eslint-disable-next-line prefer-named-capture-group -- TODO: Fix regex with new eslint rules + .replace(/^((?!http).*)(?:release-)(\d+)-\d+\/docs(.*)/, '$1docs/$2$3'); if (indexPagePath && href?.startsWith('./')) { href = href.replace(