Skip to content

Commit

Permalink
chore: remove biome lint rule noAssignInExpressions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkaxis committed Oct 3, 2023
1 parent 0073edf commit bb8059f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
3 changes: 1 addition & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"noEmptyInterface": "off",
"noExplicitAny": "off",
"noArrayIndexKey": "off",
"noShadowRestrictedNames": "off",
"noAssignInExpressions": "off"
"noShadowRestrictedNames": "off"
},
"a11y": {
"noSvgWithoutTitle": "off"
Expand Down
12 changes: 8 additions & 4 deletions packages/docs/src/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ export const Menu: FC<MenuProps> = ({ 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<ComponentGroup>,
[location.pathname, components, selectTab]
Expand Down
12 changes: 8 additions & 4 deletions packages/ui-tests/src/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ export const Menu: FC<MenuProps> = ({ 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<ComponentGroup>,
[location.pathname, components, selectTab]
Expand Down

0 comments on commit bb8059f

Please sign in to comment.