Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit bb8059f

Browse files
committed
chore: remove biome lint rule noAssignInExpressions
1 parent 0073edf commit bb8059f

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

biome.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"noEmptyInterface": "off",
1212
"noExplicitAny": "off",
1313
"noArrayIndexKey": "off",
14-
"noShadowRestrictedNames": "off",
15-
"noAssignInExpressions": "off"
14+
"noShadowRestrictedNames": "off"
1615
},
1716
"a11y": {
1817
"noSvgWithoutTitle": "off"

packages/docs/src/Menu.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,14 @@ export const Menu: FC<MenuProps> = ({ components }) => {
9797
label: c.name,
9898
icon: () => c.icon ?? null,
9999
selected: matchPath(location.pathname, c.route) !== null,
100-
onClick: () =>
101-
/^https?:\/\//.test(c.route)
102-
? (window.location.href = c.route)
103-
: selectTab(c.route),
100+
onClick: () => {
101+
const routeMatches = /^https?:\/\//.test(c.route)
102+
if (routeMatches) {
103+
window.location.href = c.route
104+
return
105+
}
106+
selectTab(c.route)
107+
},
104108
...c,
105109
})) as unknown as ReadonlyArray<ComponentGroup>,
106110
[location.pathname, components, selectTab]

packages/ui-tests/src/Menu.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ export const Menu: FC<MenuProps> = ({ components }) => {
7979
label: c.name,
8080
icon: () => null,
8181
selected: c.route === location.pathname,
82-
onClick: () =>
83-
/^https?:\/\//.test(c.route)
84-
? (window.location.href = c.route)
85-
: selectTab(c.route),
82+
onClick: () => {
83+
const routeMatches = /^https?:\/\//.test(c.route)
84+
if (routeMatches) {
85+
window.location.href = c.route
86+
return
87+
}
88+
selectTab(c.route)
89+
},
8690
...c,
8791
})) as unknown as ReadonlyArray<ComponentGroup>,
8892
[location.pathname, components, selectTab]

0 commit comments

Comments
 (0)