Skip to content

Commit 4818ae8

Browse files
chore(deps): update dependency prettier to v3 (#487)
1 parent c067d9c commit 4818ae8

File tree

11 files changed

+51
-49
lines changed

11 files changed

+51
-49
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const { repository } = await graphql(
7676
headers: {
7777
authorization: `token secret123`,
7878
},
79-
}
79+
},
8080
);
8181
```
8282

@@ -131,7 +131,7 @@ const { repository } = await graphqlWithAuth(
131131
}
132132
}
133133
}
134-
}`
134+
}`,
135135
);
136136
```
137137

@@ -160,7 +160,7 @@ const { lastIssues } = await graphql(
160160
headers: {
161161
authorization: `token secret123`,
162162
},
163-
}
163+
},
164164
);
165165
```
166166

@@ -396,7 +396,7 @@ graphql("{ viewer { login } }", {
396396
assert.strictEqual(
397397
options.body,
398398
'{"query":"{ viewer { login } }"}',
399-
"Sends correct query"
399+
"Sends correct query",
400400
);
401401
return { data: {} };
402402
}),

package-lock.json

Lines changed: 9 additions & 9 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
@@ -35,7 +35,7 @@
3535
"fetch-mock": "npm:@gr2m/fetch-mock@9.11.0-pull-request-644.1",
3636
"glob": "^10.2.6",
3737
"jest": "^29.0.0",
38-
"prettier": "2.8.8",
38+
"prettier": "3.0.0",
3939
"semantic-release-plugin-update-version-in-files": "^1.0.0",
4040
"ts-jest": "^29.0.0",
4141
"typescript": "^5.0.0"

src/error.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { GraphQlEndpointOptions, GraphQlQueryResponse } from "./types";
44
type ServerResponseData<T> = Required<GraphQlQueryResponse<T>>;
55

66
function _buildMessageForResponseErrors(
7-
data: ServerResponseData<unknown>
7+
data: ServerResponseData<unknown>,
88
): string {
99
return (
1010
`Request failed due to following response errors:\n` +
@@ -21,7 +21,7 @@ export class GraphqlResponseError<ResponseData> extends Error {
2121
constructor(
2222
readonly request: GraphQlEndpointOptions,
2323
readonly headers: ResponseHeaders,
24-
readonly response: ServerResponseData<ResponseData>
24+
readonly response: ServerResponseData<ResponseData>,
2525
) {
2626
super(_buildMessageForResponseErrors(response));
2727

src/graphql.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,22 @@ const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
2525
export function graphql<ResponseData = GraphQlQueryResponseData>(
2626
request: typeof Request,
2727
query: string | RequestParameters,
28-
options?: RequestParameters
28+
options?: RequestParameters,
2929
): Promise<ResponseData> {
3030
if (options) {
3131
if (typeof query === "string" && "query" in options) {
3232
return Promise.reject(
33-
new Error(`[@octokit/graphql] "query" cannot be used as variable name`)
33+
new Error(`[@octokit/graphql] "query" cannot be used as variable name`),
3434
);
3535
}
3636

3737
for (const key in options) {
3838
if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;
3939

4040
return Promise.reject(
41-
new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)
41+
new Error(
42+
`[@octokit/graphql] "${key}" cannot be used as variable name`,
43+
),
4244
);
4345
}
4446
}
@@ -47,7 +49,7 @@ export function graphql<ResponseData = GraphQlQueryResponseData>(
4749
typeof query === "string" ? Object.assign({ query }, options) : query;
4850

4951
const requestOptions = Object.keys(
50-
parsedOptions
52+
parsedOptions,
5153
).reduce<GraphQlEndpointOptions>((result, key) => {
5254
if (NON_VARIABLE_OPTIONS.includes(key)) {
5355
result[key] = parsedOptions[key];
@@ -79,7 +81,7 @@ export function graphql<ResponseData = GraphQlQueryResponseData>(
7981
throw new GraphqlResponseError(
8082
requestOptions,
8183
headers,
82-
response.data as Required<GraphQlQueryResponse<ResponseData>>
84+
response.data as Required<GraphQlQueryResponse<ResponseData>>,
8385
);
8486
}
8587

src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface graphql {
3030
*/
3131
<ResponseData>(
3232
query: Query,
33-
parameters?: RequestParameters
33+
parameters?: RequestParameters,
3434
): GraphQlResponse<ResponseData>;
3535

3636
/**
@@ -65,8 +65,8 @@ export type GraphQlQueryResponse<ResponseData> = {
6565
{
6666
line: number;
6767
column: number;
68-
}
68+
},
6969
];
70-
}
70+
},
7171
];
7272
};

src/with-defaults.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { graphql } from "./graphql";
88

99
export function withDefaults(
1010
request: typeof Request,
11-
newDefaults: RequestParameters
11+
newDefaults: RequestParameters,
1212
): ApiInterface {
1313
const newRequest = request.defaults(newDefaults);
1414
const newApi = <ResponseData>(
1515
query: Query | RequestParameters,
16-
options?: RequestParameters
16+
options?: RequestParameters,
1717
) => {
1818
return graphql<ResponseData>(newRequest, query, options);
1919
};

test/defaults.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe("graphql.defaults()", () => {
4848
headers: {
4949
authorization: "token secret123",
5050
},
51-
}
51+
},
5252
),
5353
},
5454
});
@@ -104,7 +104,7 @@ describe("graphql.defaults()", () => {
104104
headers: {
105105
authorization: "token secret123",
106106
},
107-
}
107+
},
108108
),
109109
},
110110
});
@@ -140,7 +140,7 @@ describe("graphql.defaults()", () => {
140140
headers: {
141141
authorization: "token secret123",
142142
},
143-
}
143+
},
144144
),
145145
},
146146
});
@@ -189,7 +189,7 @@ describe("graphql.defaults()", () => {
189189
headers: {
190190
authorization: "token secret123",
191191
},
192-
}
192+
},
193193
),
194194
},
195195
});

test/error.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ describe("errors", () => {
4141
.catch((error) => {
4242
expect(error.message).toEqual(
4343
"Request failed due to following response errors:\n" +
44-
" - Field 'bioHtml' doesn't exist on type 'User'"
44+
" - Field 'bioHtml' doesn't exist on type 'User'",
4545
);
4646
expect(JSON.stringify(error.errors)).toStrictEqual(
47-
JSON.stringify(mockResponse.errors)
47+
JSON.stringify(mockResponse.errors),
4848
);
4949
expect(error.request.query).toEqual(query);
5050
});
@@ -150,18 +150,18 @@ describe("errors", () => {
150150
.catch((error) => {
151151
expect(error.message).toEqual(
152152
"Request failed due to following response errors:\n" +
153-
" - `invalid cursor` does not appear to be a valid cursor."
153+
" - `invalid cursor` does not appear to be a valid cursor.",
154154
);
155155
expect(JSON.stringify(error.errors)).toStrictEqual(
156-
JSON.stringify(mockResponse.errors)
156+
JSON.stringify(mockResponse.errors),
157157
);
158158
expect(error.request.query).toEqual(query);
159159
expect(JSON.stringify(error.data)).toStrictEqual(
160-
JSON.stringify(mockResponse.data)
160+
JSON.stringify(mockResponse.data),
161161
);
162162
expect(error.headers).toHaveProperty("x-github-request-id");
163163
expect(error.headers["x-github-request-id"]).toEqual(
164-
"C5E6:259A:1351B40:2E88B87:5F1F9C41"
164+
"C5E6:259A:1351B40:2E88B87:5F1F9C41",
165165
);
166166
});
167167
});

test/graphql.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ describe("graphql()", () => {
6666
authorization: "token secret123",
6767
"user-agent": userAgent,
6868
},
69-
}
69+
},
7070
),
7171
},
72-
}
72+
},
7373
).then((result) => {
7474
expect(JSON.stringify(result)).toStrictEqual(JSON.stringify(mockData));
7575
});
@@ -108,7 +108,7 @@ describe("graphql()", () => {
108108
});
109109

110110
return { data: {} };
111-
}
111+
},
112112
),
113113
},
114114
});
@@ -147,12 +147,12 @@ describe("graphql()", () => {
147147
repo: "graphql.js",
148148
});
149149
expect(options.headers["authorization"]).toEqual(
150-
"token secret123"
150+
"token secret123",
151151
);
152152
expect(options.headers["x-custom"]).toEqual("value");
153153

154154
return { data: {} };
155-
}
155+
},
156156
),
157157
},
158158
};
@@ -194,7 +194,7 @@ describe("graphql()", () => {
194194
});
195195

196196
return { data: {} };
197-
}
197+
},
198198
),
199199
},
200200
};
@@ -220,7 +220,7 @@ describe("graphql()", () => {
220220
expect(body.variables).toEqual(undefined);
221221

222222
return { data: {} };
223-
}
223+
},
224224
),
225225
},
226226
});
@@ -245,7 +245,7 @@ describe("graphql()", () => {
245245
expect(options.headers.accept).toContain("antiope-preview");
246246
expect(options.headers.accept).toContain("testpkg-preview");
247247
return { data: {} };
248-
}
248+
},
249249
),
250250
},
251251
});
@@ -273,7 +273,7 @@ describe("graphql()", () => {
273273
query: "test",
274274
}).catch((error) => {
275275
expect(error.message).toEqual(
276-
`[@octokit/graphql] "query" cannot be used as variable name`
276+
`[@octokit/graphql] "query" cannot be used as variable name`,
277277
);
278278
});
279279
});
@@ -295,7 +295,7 @@ describe("graphql()", () => {
295295
url: "https://example.com",
296296
}).catch((error) => {
297297
expect(error.message).toEqual(
298-
`[@octokit/graphql] "url" cannot be used as variable name`
298+
`[@octokit/graphql] "url" cannot be used as variable name`,
299299
);
300300
});
301301
});
@@ -313,7 +313,7 @@ describe("graphql()", () => {
313313
method: "test",
314314
}).catch((error) => {
315315
expect(error.message).toEqual(
316-
`[@octokit/graphql] "method" cannot be used as variable name`
316+
`[@octokit/graphql] "method" cannot be used as variable name`,
317317
);
318318
});
319319
});

0 commit comments

Comments
 (0)