Skip to content

Commit 1e5d360

Browse files
authored
deps: upgrade prettier (#567)
1 parent a9493de commit 1e5d360

File tree

7 files changed

+32
-27
lines changed

7 files changed

+32
-27
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Optional: If you prefer to use your own OAuth credentials, you can do so by pass
3535

3636
To watch for changes(`webpack`) in the `src` directory:
3737

38-
pnpm run watch
38+
pnpm watch
3939

4040
To run the **electron app**:
4141

@@ -54,15 +54,17 @@ The release process is automated. Follow the steps below.
5454
### Tests
5555

5656
There are 2 checks - one for prettier and one for the unit tests with `jest`.
57-
57+
```
5858
// Run prettier to check
59-
pnpm run prettier:check
59+
pnpm prettier:check
6060
6161
// Run linter & unit tests with coverage
62-
pnpm run test
62+
pnpm test
6363
64-
// Run jest directly - allows to pass arguments like `--watch`
65-
pnpm run jest
64+
// If you want to pass arguments to jest (or other `pnpm` commands)
65+
// like `--watch`, you can prepend `--` to the command
66+
pnpm test -- --watch
67+
```
6668

6769
### FAQ
6870

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"jest": "^26.6.3",
144144
"nock": "^13.0.5",
145145
"postcss-loader": "^4.1.0",
146-
"prettier": "=2.2.1",
146+
"prettier": "^2.8.8",
147147
"react-test-renderer": "=16.13.1",
148148
"style-loader": "^2.0.0",
149149
"ts-jest": "^26.4.4",

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/Notifications.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ import { Oops } from '../components/Oops';
88
export const NotificationsRoute: React.FC = (props) => {
99
const { notifications, requestFailed } = useContext(AppContext);
1010

11-
const hasMultipleAccounts = useMemo(() => notifications.length > 1, [
12-
notifications,
13-
]);
11+
const hasMultipleAccounts = useMemo(
12+
() => notifications.length > 1,
13+
[notifications]
14+
);
1415
const notificationsCount = useMemo(
1516
() =>
1617
notifications.reduce((memo, acc) => memo + acc.notifications.length, 0),
1718
[notifications]
1819
);
19-
const hasNotifications = useMemo(() => notificationsCount > 0, [
20-
notificationsCount,
21-
]);
20+
const hasNotifications = useMemo(
21+
() => notificationsCount > 0,
22+
[notificationsCount]
23+
);
2224

2325
if (requestFailed) {
2426
return <Oops />;

src/utils/github-api.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ const DESCRIPTIONS = {
1818
UNKNOWN: 'The reason for this notification is not supported by the app.',
1919
};
2020

21-
export function formatReason(
22-
reason: Reason
23-
): { type: string; description: string } {
21+
export function formatReason(reason: Reason): {
22+
type: string;
23+
description: string;
24+
} {
2425
// prettier-ignore
2526
switch (reason) {
2627
case 'assign':

src/utils/notifications.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ describe('utils/notifications.ts', () => {
104104
it('should click on a native notification (with 1 notification)', () => {
105105
spyOn(comms, 'openExternalLink');
106106

107-
const nativeNotification: Notification = notificationsHelpers.raiseNativeNotification(
108-
[mockedGithubNotifications[0]],
109-
mockedUser.id
110-
);
107+
const nativeNotification: Notification =
108+
notificationsHelpers.raiseNativeNotification(
109+
[mockedGithubNotifications[0]],
110+
mockedUser.id
111+
);
111112
nativeNotification.onclick(null);
112113

113114
const notif = mockedGithubNotifications[0];

src/utils/notifications.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ export const triggerNativeNotifications = (
3131
return account.notifications;
3232
}
3333

34-
const accountPreviousNotificationsIds = accountPreviousNotifications.notifications.map(
35-
(item) => item.id
36-
);
34+
const accountPreviousNotificationsIds =
35+
accountPreviousNotifications.notifications.map((item) => item.id);
3736

3837
const accountNewNotifications = account.notifications.filter((item) => {
3938
return !accountPreviousNotificationsIds.includes(`${item.id}`);

0 commit comments

Comments
 (0)