Skip to content

Commit c29fedb

Browse files
authored
refactor: biome config imports (#2179)
chore: update biome formatter config Signed-off-by: Adam Setch <[email protected]>
1 parent ef3811b commit c29fedb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+515
-481
lines changed

biome.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
":BLANK_LINE:",
1818
":PACKAGE:",
1919
":BLANK_LINE:",
20+
"**/shared/**",
21+
":BLANK_LINE:",
2022
"**"
2123
]
2224
}
23-
}
25+
},
26+
"useSortedAttributes": "on"
2427
}
2528
}
2629
},
@@ -41,7 +44,12 @@
4144
"useExhaustiveDependencies": {
4245
"level": "warn",
4346
"options": {
44-
"hooks": [{ "name": "useNavigate", "stableResult": true }]
47+
"hooks": [
48+
{
49+
"name": "useNavigate",
50+
"stableResult": true
51+
}
52+
]
4553
}
4654
},
4755
"useUniqueElementIds": "warn"

src/main/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { APPLICATION } from '../shared/constants';
66
import { namespacedEvent } from '../shared/events';
77
import { logInfo, logWarn } from '../shared/logger';
88
import { isLinux, isWindows } from '../shared/platform';
9+
910
import { onFirstRunMaybe } from './first-run';
1011
import { TrayIcons } from './icons';
1112
import MenuBuilder from './menu';

src/main/menu.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Menubar } from 'menubar';
44

55
import { APPLICATION } from '../shared/constants';
66
import { isMacOS, isWindows } from '../shared/platform';
7+
78
import { openLogsDirectory, resetApp, takeScreenshot } from './utils';
89

910
export default class MenuBuilder {

src/main/updater.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { Menubar } from 'menubar';
55

66
import { APPLICATION } from '../shared/constants';
77
import { logError, logInfo } from '../shared/logger';
8+
89
import type MenuBuilder from './menu';
910

1011
/**

src/renderer/App.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function RequireAuth({ children }) {
2828
return isLoggedIn ? (
2929
children
3030
) : (
31-
<Navigate to="/login" replace state={{ from: location }} />
31+
<Navigate replace state={{ from: location }} to="/login" />
3232
);
3333
}
3434

@@ -41,45 +41,45 @@ export const App = () => {
4141
<AppLayout>
4242
<Routes>
4343
<Route
44-
path="/"
4544
element={
4645
<RequireAuth>
4746
<NotificationsRoute />
4847
</RequireAuth>
4948
}
49+
path="/"
5050
/>
5151
<Route
52-
path="/filters"
5352
element={
5453
<RequireAuth>
5554
<FiltersRoute />
5655
</RequireAuth>
5756
}
57+
path="/filters"
5858
/>
5959
<Route
60-
path="/settings"
6160
element={
6261
<RequireAuth>
6362
<SettingsRoute />
6463
</RequireAuth>
6564
}
65+
path="/settings"
6666
/>
6767
<Route
68-
path="/accounts"
6968
element={
7069
<RequireAuth>
7170
<AccountsRoute />
7271
</RequireAuth>
7372
}
73+
path="/accounts"
7474
/>
75-
<Route path="/login" element={<LoginRoute />} />
75+
<Route element={<LoginRoute />} path="/login" />
7676
<Route
77-
path="/login-personal-access-token"
7877
element={<LoginWithPersonalAccessTokenRoute />}
78+
path="/login-personal-access-token"
7979
/>
8080
<Route
81-
path="/login-oauth-app"
8281
element={<LoginWithOAuthAppRoute />}
82+
path="/login-oauth-app"
8383
/>
8484
</Routes>
8585
</AppLayout>

src/renderer/components/AllRead.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ export const AllRead: FC<IAllRead> = ({ fullHeight = true }: IAllRead) => {
2525
const heading = `No new ${hasFilters ? 'filtered ' : ''} notifications`;
2626

2727
return (
28-
<EmojiSplash emoji={emoji} heading={heading} fullHeight={fullHeight} />
28+
<EmojiSplash emoji={emoji} fullHeight={fullHeight} heading={heading} />
2929
);
3030
};

src/renderer/components/Oops.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export const Oops: FC<IOops> = ({ error, fullHeight = true }: IOops) => {
2020
return (
2121
<EmojiSplash
2222
emoji={emoji}
23+
fullHeight={fullHeight}
2324
heading={err.title}
2425
subHeadings={err.descriptions}
25-
fullHeight={fullHeight}
2626
/>
2727
);
2828
};

src/renderer/components/Sidebar.tsx

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import { IconButton, Stack } from '@primer/react';
1414

1515
import { APPLICATION } from '../../shared/constants';
16+
1617
import { AppContext } from '../context/App';
1718
import { quitApp } from '../utils/comms';
1819
import { Constants } from '../utils/constants';
@@ -72,129 +73,129 @@ export const Sidebar: FC = () => {
7273

7374
return (
7475
<Stack
76+
className="fixed left-sidebar -ml-sidebar w-sidebar h-full bg-gitify-sidebar text-white"
7577
direction="vertical"
7678
justify="space-between"
77-
className="fixed left-sidebar -ml-sidebar w-sidebar h-full bg-gitify-sidebar text-white"
7879
>
7980
<Stack
80-
direction="vertical"
8181
align="center"
82+
direction="vertical"
8283
gap="condensed"
8384
padding="normal"
8485
>
8586
<IconButton
86-
icon={LogoIcon}
8787
aria-label={APPLICATION.NAME}
88+
data-testid="sidebar-home"
8889
description="Home"
89-
unsafeDisableTooltip={false}
90+
icon={LogoIcon}
91+
onClick={() => navigate('/', { replace: true })}
9092
size="small"
91-
variant="invisible"
9293
tooltipDirection="e"
93-
onClick={() => navigate('/', { replace: true })}
94-
data-testid="sidebar-home"
94+
unsafeDisableTooltip={false}
95+
variant="invisible"
9596
/>
9697

9798
<IconButton
98-
icon={BellIcon}
9999
aria-label="Notifications"
100+
data-testid="sidebar-notifications"
100101
description={`${notificationsCount} unread notifications`}
101-
unsafeDisableTooltip={false}
102-
size="small"
103-
variant={notificationsCount > 0 ? 'primary' : 'invisible'}
104-
tooltipDirection="e"
102+
icon={BellIcon}
105103
onClick={() => openGitHubNotifications(primaryAccountHostname)}
106-
data-testid="sidebar-notifications"
104+
size="small"
107105
sx={sidebarButtonStyle}
106+
tooltipDirection="e"
107+
unsafeDisableTooltip={false}
108+
variant={notificationsCount > 0 ? 'primary' : 'invisible'}
108109
/>
109110

110111
{isLoggedIn && (
111112
<IconButton
112-
icon={FilterIcon}
113113
aria-label="Filters"
114+
data-testid="sidebar-filter-notifications"
114115
description="Filter notifications"
115-
unsafeDisableTooltip={false}
116-
size="small"
117-
variant={hasAnyFiltersSet(settings) ? 'primary' : 'invisible'}
118-
tooltipDirection="e"
116+
icon={FilterIcon}
119117
onClick={() => toggleFilters()}
120-
data-testid="sidebar-filter-notifications"
118+
size="small"
121119
sx={sidebarButtonStyle}
120+
tooltipDirection="e"
121+
unsafeDisableTooltip={false}
122+
variant={hasAnyFiltersSet(settings) ? 'primary' : 'invisible'}
122123
/>
123124
)}
124125

125126
<IconButton
126-
icon={IssueOpenedIcon}
127127
aria-label="My issues"
128-
unsafeDisableTooltip={false}
129-
size="small"
130-
variant="invisible"
131-
tooltipDirection="e"
132-
onClick={() => openGitHubIssues(primaryAccountHostname)}
133128
data-testid="sidebar-my-issues"
129+
icon={IssueOpenedIcon}
130+
onClick={() => openGitHubIssues(primaryAccountHostname)}
131+
size="small"
134132
sx={sidebarButtonStyle}
133+
tooltipDirection="e"
134+
unsafeDisableTooltip={false}
135+
variant="invisible"
135136
/>
136137

137138
<IconButton
138-
icon={GitPullRequestIcon}
139139
aria-label="My pull requests"
140-
unsafeDisableTooltip={false}
141-
size="small"
142-
variant="invisible"
143-
tooltipDirection="e"
144-
onClick={() => openGitHubPulls(primaryAccountHostname)}
145140
data-testid="sidebar-my-pull-requests"
141+
icon={GitPullRequestIcon}
142+
onClick={() => openGitHubPulls(primaryAccountHostname)}
143+
size="small"
146144
sx={sidebarButtonStyle}
145+
tooltipDirection="e"
146+
unsafeDisableTooltip={false}
147+
variant="invisible"
147148
/>
148149
</Stack>
149150

150151
<Stack
151-
direction="vertical"
152152
align="center"
153+
direction="vertical"
153154
gap="condensed"
154155
padding="normal"
155156
>
156157
{isLoggedIn && (
157158
<>
158159
<IconButton
159-
icon={SyncIcon}
160160
aria-label="Refresh"
161+
data-testid="sidebar-refresh"
161162
description="Refresh notifications"
162-
unsafeDisableTooltip={false}
163-
size="small"
164-
variant="invisible"
165-
tooltipDirection="e"
166-
loading={status === 'loading'}
167163
disabled={status === 'loading'}
164+
icon={SyncIcon}
165+
loading={status === 'loading'}
168166
onClick={() => refreshNotifications()}
169-
data-testid="sidebar-refresh"
167+
size="small"
170168
sx={sidebarButtonStyle}
169+
tooltipDirection="e"
170+
unsafeDisableTooltip={false}
171+
variant="invisible"
171172
/>
172173

173174
<IconButton
174-
icon={GearIcon}
175175
aria-label="Settings"
176-
unsafeDisableTooltip={false}
177-
size="small"
178-
variant="invisible"
179-
tooltipDirection="e"
180-
onClick={() => toggleSettings()}
181176
data-testid="sidebar-settings"
177+
icon={GearIcon}
178+
onClick={() => toggleSettings()}
179+
size="small"
182180
sx={sidebarButtonStyle}
181+
tooltipDirection="e"
182+
unsafeDisableTooltip={false}
183+
variant="invisible"
183184
/>
184185
</>
185186
)}
186187

187188
{!isLoggedIn && (
188189
<IconButton
189-
icon={XCircleIcon}
190190
aria-label={`Quit ${APPLICATION.NAME}`}
191-
unsafeDisableTooltip={false}
192-
size="small"
193-
variant="invisible"
194-
tooltipDirection="e"
195-
onClick={() => quitApp()}
196191
data-testid="sidebar-quit"
192+
icon={XCircleIcon}
193+
onClick={() => quitApp()}
194+
size="small"
197195
sx={sidebarButtonStyle}
196+
tooltipDirection="e"
197+
unsafeDisableTooltip={false}
198+
variant="invisible"
198199
/>
199200
)}
200201
</Stack>

src/renderer/components/avatars/AvatarWithFallback.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ export const AvatarWithFallback: React.FC<IAvatarWithFallback> = ({
3131
// TODO explore using AnchoredOverlay component (https://primer.style/components/anchored-overlay/react/alpha) to render Avatar Card on hover
3232
return (
3333
<Stack
34-
direction="horizontal"
3534
align="center"
36-
gap="condensed"
3735
data-testid="avatar"
36+
direction="horizontal"
37+
gap="condensed"
3838
>
3939
{!src || isBroken ? (
4040
<DefaultUserIcon size={size} />
4141
) : (
4242
<Avatar
43-
src={src}
4443
alt={alt}
44+
onError={() => setIsBroken(true)}
4545
size={size}
4646
square={isNonHuman}
47-
onError={() => setIsBroken(true)}
47+
src={src}
4848
/>
4949
)}
5050
{name && (
51-
<Truncate title={name} inline maxWidth={280}>
51+
<Truncate inline maxWidth={280} title={name}>
5252
{name}
5353
</Truncate>
5454
)}

src/renderer/components/fields/Checkbox.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ describe('renderer/components/fields/Checkbox.tsx', () => {
3333
});
3434

3535
it('should render - positive counter unselected', () => {
36-
const tree = render(<Checkbox {...props} counter={5} checked={false} />);
36+
const tree = render(<Checkbox {...props} checked={false} counter={5} />);
3737
expect(tree).toMatchSnapshot();
3838
});
3939

4040
it('should render - positive counter selected', () => {
41-
const tree = render(<Checkbox {...props} counter={5} checked={true} />);
41+
const tree = render(<Checkbox {...props} checked={true} counter={5} />);
4242
expect(tree).toMatchSnapshot();
4343
});
4444

0 commit comments

Comments
 (0)