aboutsummaryrefslogtreecommitdiffstats
path: root/packages/service-shared
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-27 00:17:22 +0100
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-02-08 21:43:17 +0100
commit9546dc2aa39ab096ccc723786e718a739d0bdaf9 (patch)
tree9c3afc6155cc59f6dd1235397230aaa15a5f8cec /packages/service-shared
parentrefactor: Apply shared store patches in batches (diff)
downloadsophie-9546dc2aa39ab096ccc723786e718a739d0bdaf9.tar.gz
sophie-9546dc2aa39ab096ccc723786e718a739d0bdaf9.tar.zst
sophie-9546dc2aa39ab096ccc723786e718a739d0bdaf9.zip
refactor: Coding conventions
Make sure that files have a default import with the same name as the file whenever possible to reduce surprise. Also shuffles around some file names for better legibility. Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/service-shared')
-rw-r--r--packages/service-shared/src/index.ts3
-rw-r--r--packages/service-shared/src/schemas.ts16
2 files changed, 13 insertions, 6 deletions
diff --git a/packages/service-shared/src/index.ts b/packages/service-shared/src/index.ts
index 94be734..a2e5ee5 100644
--- a/packages/service-shared/src/index.ts
+++ b/packages/service-shared/src/index.ts
@@ -20,5 +20,4 @@
20 20
21export { MainToServiceIpcMessage, ServiceToMainIpcMessage } from './ipc'; 21export { MainToServiceIpcMessage, ServiceToMainIpcMessage } from './ipc';
22 22
23export type { UnreadCount, WebSource } from './schemas'; 23export { UnreadCount, WebSource } from './schemas';
24export { unreadCount, webSource } from './schemas';
diff --git a/packages/service-shared/src/schemas.ts b/packages/service-shared/src/schemas.ts
index 586750c..0b31eb7 100644
--- a/packages/service-shared/src/schemas.ts
+++ b/packages/service-shared/src/schemas.ts
@@ -20,16 +20,24 @@
20 20
21import { z } from 'zod'; 21import { z } from 'zod';
22 22
23export const unreadCount = z.object({ 23export const UnreadCount = z.object({
24 direct: z.number().nonnegative().optional(), 24 direct: z.number().nonnegative().optional(),
25 indirect: z.number().nonnegative().optional(), 25 indirect: z.number().nonnegative().optional(),
26}); 26});
27 27
28export type UnreadCount = z.infer<typeof unreadCount>; 28/*
29 eslint-disable-next-line @typescript-eslint/no-redeclare --
30 Intentionally naming the type the same as the schema definition.
31*/
32export type UnreadCount = z.infer<typeof UnreadCount>;
29 33
30export const webSource = z.object({ 34export const WebSource = z.object({
31 code: z.string(), 35 code: z.string(),
32 url: z.string().nonempty(), 36 url: z.string().nonempty(),
33}); 37});
34 38
35export type WebSource = z.infer<typeof webSource>; 39/*
40 eslint-disable-next-line @typescript-eslint/no-redeclare --
41 Intentionally naming the type the same as the schema definition.
42*/
43export type WebSource = z.infer<typeof WebSource>;