Skip to content

Commit e94c2fa

Browse files
Update prettier to 2.3 (#3094)
1 parent 11d71e4 commit e94c2fa

22 files changed

+71
-76
lines changed

benchmark/benchmark.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ async function collectSamples(modulePath) {
117117

118118
// T-Distribution two-tailed critical values for 95% confidence.
119119
// See http://www.itl.nist.gov/div898/handbook/eda/section3/eda3672.htm.
120-
const tTable = /* prettier-ignore */ {
120+
// prettier-ignore
121+
const tTable = {
121122
'1': 12.706, '2': 4.303, '3': 3.182, '4': 2.776, '5': 2.571, '6': 2.447,
122123
'7': 2.365, '8': 2.306, '9': 2.262, '10': 2.228, '11': 2.201, '12': 2.179,
123124
'13': 2.16, '14': 2.145, '15': 2.131, '16': 2.12, '17': 2.11, '18': 2.101,

integrationTests/ts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ declare module 'graphql' {
2121
interface GraphQLFieldExtensions<
2222
_TSource,
2323
_TContext,
24-
_TArgs = { [argName: string]: any }
24+
_TArgs = { [argName: string]: any },
2525
> {
2626
someFieldExtension?: SomeExtension;
2727
}

package-lock.json

Lines changed: 7 additions & 7 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
@@ -62,7 +62,7 @@
6262
"flow-bin": "0.150.0",
6363
"mocha": "8.3.2",
6464
"nyc": "15.1.0",
65-
"prettier": "2.2.1",
65+
"prettier": "2.3.0",
6666
"typescript": "4.2.4"
6767
}
6868
}

resources/gen-changelog.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ if (!packageJSON.repository || typeof packageJSON.repository.url !== 'string') {
4747
process.exit(1);
4848
}
4949

50-
const repoURLMatch = /https:\/\/github.com\/(?<githubOrg>[^/]+)\/(?<githubRepo>[^/]+).git/.exec(
51-
packageJSON.repository.url,
52-
);
50+
const repoURLMatch =
51+
/https:\/\/github.com\/(?<githubOrg>[^/]+)\/(?<githubRepo>[^/]+).git/.exec(
52+
packageJSON.repository.url,
53+
);
5354
if (repoURLMatch == null) {
5455
console.error('Cannot extract organization and repo name from repo URL!');
5556
process.exit(1);

src/error/formatError.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function formatError(error: GraphQLError): GraphQLFormattedError;
1212
* @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors
1313
*/
1414
export interface GraphQLFormattedError<
15-
TExtensions extends Record<string, unknown> = Record<string, unknown>
15+
TExtensions extends Record<string, unknown> = Record<string, unknown>,
1616
> {
1717
/**
1818
* A short, human-readable summary of the problem that **SHOULD NOT** change

src/execution/execute.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export interface ExecutionContext {
7070
*/
7171
export interface ExecutionResult<
7272
TData = { [key: string]: any },
73-
TExtensions = { [key: string]: any }
73+
TExtensions = { [key: string]: any },
7474
> {
7575
errors?: ReadonlyArray<GraphQLError>;
7676
// TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229
@@ -80,7 +80,7 @@ export interface ExecutionResult<
8080

8181
export interface FormattedExecutionResult<
8282
TData = { [key: string]: any },
83-
TExtensions = { [key: string]: any }
83+
TExtensions = { [key: string]: any },
8484
> {
8585
errors?: ReadonlyArray<GraphQLFormattedError>;
8686
// TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229

src/execution/execute.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,19 +1140,17 @@ export const defaultTypeResolver: GraphQLTypeResolver<mixed, mixed> = function (
11401140
* and returns it as the result, or if it's a function, returns the result
11411141
* of calling that function while passing along args and context value.
11421142
*/
1143-
export const defaultFieldResolver: GraphQLFieldResolver<
1144-
mixed,
1145-
mixed,
1146-
> = function (source: any, args, contextValue, info) {
1147-
// ensure source is a value for which property access is acceptable.
1148-
if (isObjectLike(source) || typeof source === 'function') {
1149-
const property = source[info.fieldName];
1150-
if (typeof property === 'function') {
1151-
return source[info.fieldName](args, contextValue, info);
1143+
export const defaultFieldResolver: GraphQLFieldResolver<mixed, mixed> =
1144+
function (source: any, args, contextValue, info) {
1145+
// ensure source is a value for which property access is acceptable.
1146+
if (isObjectLike(source) || typeof source === 'function') {
1147+
const property = source[info.fieldName];
1148+
if (typeof property === 'function') {
1149+
return source[info.fieldName](args, contextValue, info);
1150+
}
1151+
return property;
11521152
}
1153-
return property;
1154-
}
1155-
};
1153+
};
11561154

11571155
/**
11581156
* This method looks up the field on the given type definition.

src/jsutils/memoize3.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export function memoize3<
66
A1 extends object,
77
A2 extends object,
88
A3 extends object,
9-
R
9+
R,
1010
>(fn: (a1: A1, a2: A2, a3: A3) => R): (a1: A1, a2: A2, a3: A3) => R;

src/language/directiveLocation.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ export const DirectiveLocation: Readonly<{
2929
/**
3030
* The enum type representing the directive location values.
3131
*/
32-
export type DirectiveLocationEnum = typeof DirectiveLocation[keyof typeof DirectiveLocation];
32+
export type DirectiveLocationEnum =
33+
typeof DirectiveLocation[keyof typeof DirectiveLocation];

0 commit comments

Comments
 (0)