diff --git a/biome.json b/biome.json index 99a2dfa6..7a2e5900 100644 --- a/biome.json +++ b/biome.json @@ -11,8 +11,7 @@ "noEmptyInterface": "off", "noExplicitAny": "off", "noArrayIndexKey": "off", - "noShadowRestrictedNames": "off", - "noAssignInExpressions": "off" + "noShadowRestrictedNames": "off" }, "a11y": { "noSvgWithoutTitle": "off" diff --git a/packages/docs/src/Menu.tsx b/packages/docs/src/Menu.tsx index fd9960d2..d0f394f7 100644 --- a/packages/docs/src/Menu.tsx +++ b/packages/docs/src/Menu.tsx @@ -97,10 +97,14 @@ export const Menu: FC = ({ components }) => { label: c.name, icon: () => c.icon ?? null, selected: matchPath(location.pathname, c.route) !== null, - onClick: () => - /^https?:\/\//.test(c.route) - ? (window.location.href = c.route) - : selectTab(c.route), + onClick: () => { + const routeMatches = /^https?:\/\//.test(c.route) + if (routeMatches) { + window.location.href = c.route + return + } + selectTab(c.route) + }, ...c, })) as unknown as ReadonlyArray, [location.pathname, components, selectTab] diff --git a/packages/ui-tests/src/Menu.tsx b/packages/ui-tests/src/Menu.tsx index 988e6746..9481fc1a 100644 --- a/packages/ui-tests/src/Menu.tsx +++ b/packages/ui-tests/src/Menu.tsx @@ -79,10 +79,14 @@ export const Menu: FC = ({ components }) => { label: c.name, icon: () => null, selected: c.route === location.pathname, - onClick: () => - /^https?:\/\//.test(c.route) - ? (window.location.href = c.route) - : selectTab(c.route), + onClick: () => { + const routeMatches = /^https?:\/\//.test(c.route) + if (routeMatches) { + window.location.href = c.route + return + } + selectTab(c.route) + }, ...c, })) as unknown as ReadonlyArray, [location.pathname, components, selectTab]