Skip to content

Commit 2fd243a

Browse files
chore(deps): update dependency prettier to v3.9.4 (#504)
* chore(deps): update dependency prettier to v3.9.4 * liiint --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Moreno Feltscher <moreno@smartive.ch>
1 parent 258c922 commit 2fd243a

28 files changed

Lines changed: 1575 additions & 994 deletions

migrations/20230912185644_setup.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ export const up = async (knex: Knex) => {
1010
await knex.schema.createTable('User', (table) => {
1111
table.uuid('id').notNullable().primary();
1212
table.string('username', undefined).nullable();
13-
table.enum('role', null, {
14-
useNative: true,
15-
existingType: true,
16-
enumName: 'role',
17-
}).notNullable();
13+
table
14+
.enum('role', null, {
15+
useNative: true,
16+
existingType: true,
17+
enumName: 'role',
18+
})
19+
.notNullable();
1820
});
1921

2022
await knex.schema.createTable('AnotherObject', (table) => {
@@ -74,11 +76,13 @@ export const up = async (knex: Knex) => {
7476

7577
await knex.schema.createTable('Reaction', (table) => {
7678
table.uuid('id').notNullable().primary();
77-
table.enum('type', null, {
78-
useNative: true,
79-
existingType: true,
80-
enumName: 'reactionType',
81-
}).notNullable();
79+
table
80+
.enum('type', null, {
81+
useNative: true,
82+
existingType: true,
83+
enumName: 'reactionType',
84+
})
85+
.notNullable();
8286
table.uuid('parentId').nullable();
8387
table.index('parentId');
8488
table.foreign('parentId').references('id').inTable('Reaction').onDelete('CASCADE');
@@ -122,7 +126,6 @@ export const up = async (knex: Knex) => {
122126
table.uuid('id').notNullable().primary();
123127
table.decimal('rating', undefined, undefined);
124128
});
125-
126129
};
127130

128131
export const down = async (knex: Knex) => {
@@ -146,4 +149,3 @@ export const down = async (knex: Knex) => {
146149
await knex.raw('DROP TYPE "role"');
147150
await knex.raw('DROP TYPE "someEnum"');
148151
};
149-

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"eslint-import-resolver-typescript": "4.4.5",
8080
"jest": "30.4.2",
8181
"mock-knex": "0.4.13",
82-
"prettier": "3.8.5",
82+
"prettier": "3.9.4",
8383
"ts-jest": "29.4.11",
8484
"ts-node": "10.9.2",
8585
"typescript": "6.0.3"

src/bin/gqm/visitor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const visit = <T, C>(node: Node | undefined, context: C, visitor: Visitor
3131
throw new Error(
3232
`Cannot handle kind ${get(
3333
Object.entries(SyntaxKind).find(([, val]) => val === kind),
34-
0
35-
)}`
34+
0,
35+
)}`,
3636
);
3737
};

src/schema/utils.ts

Lines changed: 39 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@ export type Field = {
3939
};
4040

4141
export type DirectiveLocation =
42-
| 'ARGUMENT_DEFINITION'
43-
| 'INPUT_FIELD_DEFINITION'
44-
| 'FIELD'
45-
| 'FIELD_DEFINITION'
46-
| 'OBJECT'
47-
| 'INTERFACE'
48-
| 'INPUT_OBJECT';
42+
'ARGUMENT_DEFINITION' | 'INPUT_FIELD_DEFINITION' | 'FIELD' | 'FIELD_DEFINITION' | 'OBJECT' | 'INTERFACE' | 'INPUT_OBJECT';
4943

5044
export const document = (definitions: DefinitionNode[]): DocumentNode => ({
5145
kind: Kind.DOCUMENT,
@@ -95,31 +89,27 @@ export const iface = (nme: string, fds: Field[], interfaces?: string[], dvs?: Di
9589
});
9690

9791
export const inputValues = (fields: Field[]): InputValueDefinitionNode[] =>
98-
fields.map(
99-
(field): InputValueDefinitionNode => ({
100-
kind: Kind.INPUT_VALUE_DEFINITION,
101-
name: name(field.name),
102-
type: fieldType(field),
103-
defaultValue: field.defaultValue === undefined ? undefined : value(field.defaultValue),
104-
directives: directives(field.directives),
105-
}),
106-
);
92+
fields.map((field): InputValueDefinitionNode => ({
93+
kind: Kind.INPUT_VALUE_DEFINITION,
94+
name: name(field.name),
95+
type: fieldType(field),
96+
defaultValue: field.defaultValue === undefined ? undefined : value(field.defaultValue),
97+
directives: directives(field.directives),
98+
}));
10799

108100
export const fields = (fields: Field[]): FieldDefinitionNode[] =>
109-
fields.map(
110-
(field): FieldDefinitionNode => ({
111-
kind: Kind.FIELD_DEFINITION,
112-
name: name(field.name),
113-
type: fieldType(field),
114-
arguments: field.args?.map((arg) => ({
115-
kind: Kind.INPUT_VALUE_DEFINITION,
116-
name: name(arg.name),
117-
type: fieldType(arg),
118-
defaultValue: arg.defaultValue === undefined ? undefined : value(arg.defaultValue),
119-
})),
120-
directives: directives(field.directives),
121-
}),
122-
);
101+
fields.map((field): FieldDefinitionNode => ({
102+
kind: Kind.FIELD_DEFINITION,
103+
name: name(field.name),
104+
type: fieldType(field),
105+
arguments: field.args?.map((arg) => ({
106+
kind: Kind.INPUT_VALUE_DEFINITION,
107+
name: name(arg.name),
108+
type: fieldType(arg),
109+
defaultValue: arg.defaultValue === undefined ? undefined : value(arg.defaultValue),
110+
})),
111+
directives: directives(field.directives),
112+
}));
123113

124114
export const inputValue = (
125115
nme: string,
@@ -137,32 +127,26 @@ export const inputValue = (
137127
});
138128

139129
export const directives = (directives?: Directive[]): ConstDirectiveNode[] | undefined =>
140-
directives?.map(
141-
(directive): ConstDirectiveNode => ({
142-
kind: Kind.DIRECTIVE,
143-
name: name(directive.name),
144-
arguments: args(directive.values),
145-
}),
146-
);
130+
directives?.map((directive): ConstDirectiveNode => ({
131+
kind: Kind.DIRECTIVE,
132+
name: name(directive.name),
133+
arguments: args(directive.values),
134+
}));
147135

148136
export const args = (ags: Values | undefined): readonly ConstArgumentNode[] | undefined =>
149-
ags?.map(
150-
(argument): ConstArgumentNode => ({
151-
kind: Kind.ARGUMENT,
152-
name: name(argument.name),
153-
value: value(argument.values),
154-
}),
155-
);
137+
ags?.map((argument): ConstArgumentNode => ({
138+
kind: Kind.ARGUMENT,
139+
name: name(argument.name),
140+
value: value(argument.values),
141+
}));
156142

157143
export const enm = (nme: string, values: string[]): EnumTypeDefinitionNode => ({
158144
name: name(nme),
159145
kind: Kind.ENUM_TYPE_DEFINITION,
160-
values: values.map(
161-
(v): EnumValueDefinitionNode => ({
162-
kind: Kind.ENUM_VALUE_DEFINITION,
163-
name: name(v),
164-
}),
165-
),
146+
values: values.map((v): EnumValueDefinitionNode => ({
147+
kind: Kind.ENUM_VALUE_DEFINITION,
148+
name: name(v),
149+
})),
166150
});
167151

168152
export const nonNull = (type: NamedTypeNode | ListTypeNode): NonNullTypeNode => ({
@@ -240,13 +224,11 @@ export const value = (val: Value = null): ConstValueNode =>
240224
: typeof val === 'object'
241225
? {
242226
kind: Kind.OBJECT,
243-
fields: Object.keys(val).map(
244-
(nme): ConstObjectFieldNode => ({
245-
kind: Kind.OBJECT_FIELD,
246-
name: name(nme),
247-
value: value((val as Record<string, Value>)[nme]),
248-
}),
249-
),
227+
fields: Object.keys(val).map((nme): ConstObjectFieldNode => ({
228+
kind: Kind.OBJECT_FIELD,
229+
name: name(nme),
230+
value: value((val as Record<string, Value>)[nme]),
231+
})),
250232
}
251233
: doThrow(`Unsupported value ${val}`);
252234

tests/api/delete.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('delete', () => {
1010
mutation DeleteAnotherObject {
1111
deleteAnotherObject(where: { id: "${ANOTHER_ID}" })
1212
}
13-
`)
13+
`),
1414
).toMatchSnapshot();
1515

1616
expect(
@@ -21,7 +21,7 @@ describe('delete', () => {
2121
deleted
2222
}
2323
}
24-
`)
24+
`),
2525
).toMatchSnapshot();
2626
});
2727
});

tests/api/inheritance.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('inheritance', () => {
1818
}
1919
}
2020
}
21-
`)
21+
`),
2222
).toMatchSnapshot();
2323
});
2424
});
@@ -36,7 +36,7 @@ describe('inheritance', () => {
3636
}
3737
}
3838
}
39-
`)
39+
`),
4040
).toMatchSnapshot();
4141
});
4242
});
@@ -52,7 +52,7 @@ describe('inheritance', () => {
5252
rating
5353
}
5454
}
55-
`)
55+
`),
5656
).toMatchSnapshot();
5757
});
5858
});
@@ -68,7 +68,7 @@ describe('inheritance', () => {
6868
rating
6969
}
7070
}
71-
`)
71+
`),
7272
).toMatchSnapshot();
7373
});
7474
});
@@ -95,8 +95,8 @@ describe('inheritance', () => {
9595
}
9696
}
9797
`,
98-
{ data: { content: 'A review', rating: 5 } }
99-
)
98+
{ data: { content: 'A review', rating: 5 } },
99+
),
100100
).toMatchSnapshot();
101101
});
102102
});
@@ -113,8 +113,8 @@ describe('inheritance', () => {
113113
}
114114
}
115115
`,
116-
{ id: REVIEW_ID, data: { content: 'A review', rating: 5 } }
117-
)
116+
{ id: REVIEW_ID, data: { content: 'A review', rating: 5 } },
117+
),
118118
).toMatchSnapshot();
119119
});
120120
});

tests/api/query.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('query', () => {
2222
}
2323
}
2424
}
25-
`)
25+
`),
2626
).toMatchSnapshot();
2727
});
2828
});
@@ -85,7 +85,7 @@ describe('query', () => {
8585
}
8686
}
8787
}
88-
`)
88+
`),
8989
).toMatchSnapshot();
9090
});
9191
});
@@ -99,7 +99,7 @@ describe('query', () => {
9999
id
100100
}
101101
}
102-
`)
102+
`),
103103
).toMatchSnapshot();
104104
});
105105
});
@@ -113,7 +113,7 @@ describe('query', () => {
113113
id
114114
}
115115
}
116-
`)
116+
`),
117117
).toMatchSnapshot();
118118
});
119119
});
@@ -127,7 +127,7 @@ describe('query', () => {
127127
id
128128
}
129129
}
130-
`)
130+
`),
131131
).toMatchSnapshot();
132132
});
133133
});
@@ -168,7 +168,7 @@ describe('query', () => {
168168
}
169169
}
170170
}
171-
`)
171+
`),
172172
).toMatchSnapshot();
173173
});
174174
});
@@ -197,7 +197,7 @@ describe('query', () => {
197197
}
198198
}
199199
}
200-
`)
200+
`),
201201
).toMatchSnapshot();
202202
});
203203
});

0 commit comments

Comments
 (0)