Skip to content

Commit eabc28d

Browse files
CCM-11886: Fix linting
1 parent 5a517e1 commit eabc28d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

packages/event-schemas/scripts/generate-json-schemas.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import {
77
$TemplateDeletedEventV1,
88
$TemplateDraftedEventV1,
99
} from '../src';
10-
import { keyof, toJSONSchema, type ZodType } from 'zod';
10+
import { toJSONSchema, type ZodType } from 'zod';
1111
import { JSONSchema } from 'zod/v4/core';
1212

13-
const fixIdFieldInDefs = (jsonSchema: JSONSchema.JSONSchema): JSONSchema.JSONSchema => {
13+
const removeIdFieldFromDefs = (
14+
jsonSchema: JSONSchema.JSONSchema
15+
): JSONSchema.JSONSchema => {
1416
const defs = jsonSchema.$defs ?? {};
1517

1618
const newDefs = Object.entries(defs).map(([key, value]) => {
@@ -21,9 +23,9 @@ const fixIdFieldInDefs = (jsonSchema: JSONSchema.JSONSchema): JSONSchema.JSONSch
2123

2224
return {
2325
...jsonSchema,
24-
'$defs': Object.fromEntries(newDefs),
26+
$defs: Object.fromEntries(newDefs),
2527
};
26-
}
28+
};
2729

2830
// Converts Zod Schema to JSON Schema and writes to JSON file
2931
function writeSchema(
@@ -37,15 +39,13 @@ function writeSchema(
3739

3840
const jsonSchema = toJSONSchema(schema, { io: 'input' });
3941

40-
41-
4242
const outPath = path.resolve(outDir, `v${majorVersion}.json`);
4343
fs.writeFileSync(
4444
outPath,
4545
`${JSON.stringify(
4646
{
47-
...fixIdFieldInDefs(jsonSchema),
48-
'$id': id,
47+
...removeIdFieldFromDefs(jsonSchema),
48+
$id: id,
4949
},
5050
null,
5151
2

packages/event-schemas/src/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const $SmsTemplateEventV1Data = $TemplateEventV1BaseData
154154
}),
155155
})
156156
.meta({
157-
'id': 'SmsTemplateEventData',
157+
id: 'SmsTemplateEventData',
158158
});
159159

160160
export const $TemplateEventV1Data = z.discriminatedUnion('templateType', [

0 commit comments

Comments
 (0)