Skip to content
This repository was archived by the owner on Sep 2, 2020. It is now read-only.

Commit 1e161ea

Browse files
Divyendu Singhasiandrummer
authored andcommitted
Fix build: bump prettier (#235)
* fix typo in pretty.js * bump prettier to fix the build
1 parent 52845aa commit 1e161ea

File tree

11 files changed

+74
-67
lines changed

11 files changed

+74
-67
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@
6060
"graphql-language-service-utils": "^1.0.0-0",
6161
"lerna": "^2.0.0",
6262
"mocha": "4.1.0",
63-
"prettier": "^1.5.3"
63+
"prettier": "1.13"
6464
}
6565
}

packages/interface/src/getAutocompleteSuggestions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ function getSuggestionsForFragmentSpread(
304304
relevantFrags.map(frag => ({
305305
label: frag.name.value,
306306
detail: String(typeMap[frag.typeCondition.name.value]),
307-
documentation: `fragment ${frag.name.value} on ${frag.typeCondition.name
308-
.value}`,
307+
documentation: `fragment ${frag.name.value} on ${
308+
frag.typeCondition.name.value
309+
}`,
309310
})),
310311
);
311312
}

packages/interface/src/getDefinition.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ export async function getDefinitionQueryResultForFragmentSpread(
5252
process.stderr.write(`Definition not found for GraphQL fragment ${name}`);
5353
return {queryRange: [], definitions: []};
5454
}
55-
const definitions: Array<
56-
Definition,
57-
> = defNodes.map(({filePath, content, definition}) =>
58-
getDefinitionForFragmentDefinition(filePath || '', content, definition),
55+
const definitions: Array<Definition> = defNodes.map(
56+
({filePath, content, definition}) =>
57+
getDefinitionForFragmentDefinition(filePath || '', content, definition),
5958
);
6059
return {
6160
definitions,

packages/interface/src/getDiagnostics.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ function annotations(
106106
const highlightNode =
107107
node.kind !== 'Variable' && node.name
108108
? node.name
109-
: node.variable ? node.variable : node;
109+
: node.variable
110+
? node.variable
111+
: node;
110112

111113
invariant(error.locations, 'GraphQL validation error requires locations.');
112114
const loc = error.locations[0];

packages/parser/src/Rules.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import type {
1818
import {opt, list, butNot, t, p} from './RuleHelpers';
1919

2020
/**
21-
* Whitespace tokens defined in GraphQL spec.
22-
*/
21+
* Whitespace tokens defined in GraphQL spec.
22+
*/
2323
export const isIgnored = (ch: string) =>
2424
ch === ' ' ||
2525
ch === '\t' ||
@@ -120,7 +120,9 @@ export const ParseRules: {[name: string]: ParseRule} = {
120120
? stream.match(/[\s\u00a0,]*(on\b|@|{)/, false)
121121
? 'InlineFragment'
122122
: 'FragmentSpread'
123-
: stream.match(/[\s\u00a0,]*:/, false) ? 'AliasedField' : 'Field';
123+
: stream.match(/[\s\u00a0,]*:/, false)
124+
? 'AliasedField'
125+
: 'Field';
124126
},
125127
// Note: this minor deviation of "AliasedField" simplifies the lookahead.
126128
AliasedField: [

packages/parser/src/onlineParser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ function getToken(
149149
// the current token, otherwise expect based on the current step.
150150
let expected: any =
151151
typeof state.rule === 'function'
152-
? state.step === 0 ? state.rule(token, stream) : null
152+
? state.step === 0
153+
? state.rule(token, stream)
154+
: null
153155
: state.rule[state.step];
154156

155157
// Seperator between list elements if necessary.

packages/server/src/GraphQLCache.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,9 @@ export class GraphQLCache implements GraphQLCacheInterface {
544544
}
545545

546546
/**
547-
* Given a list of GraphQL file metadata, read all files collected from watchman
548-
* and create fragmentDefinitions and GraphQL files cache.
549-
*/
547+
* Given a list of GraphQL file metadata, read all files collected from watchman
548+
* and create fragmentDefinitions and GraphQL files cache.
549+
*/
550550
readAllGraphQLFiles = async (
551551
list: Array<GraphQLFileMetadata>,
552552
): Promise<{
@@ -561,13 +561,13 @@ export class GraphQLCache implements GraphQLCacheInterface {
561561
this.promiseToReadGraphQLFile(fileInfo.filePath)
562562
.catch(error => {
563563
/**
564-
* fs emits `EMFILE | ENFILE` error when there are too many
565-
* open files - this can cause some fragment files not to be
566-
* processed. Solve this case by implementing a queue to save
567-
* files failed to be processed because of `EMFILE` error,
568-
* and await on Promises created with the next batch from the
569-
* queue.
570-
*/
564+
* fs emits `EMFILE | ENFILE` error when there are too many
565+
* open files - this can cause some fragment files not to be
566+
* processed. Solve this case by implementing a queue to save
567+
* files failed to be processed because of `EMFILE` error,
568+
* and await on Promises created with the next batch from the
569+
* queue.
570+
*/
571571
if (error.code === 'EMFILE' || error.code === 'ENFILE') {
572572
queue.push(fileInfo);
573573
}
@@ -587,9 +587,9 @@ export class GraphQLCache implements GraphQLCacheInterface {
587587
};
588588

589589
/**
590-
* Takes an array of GraphQL File information and batch-processes into a
591-
* map of fragmentDefinitions and GraphQL file cache.
592-
*/
590+
* Takes an array of GraphQL File information and batch-processes into a
591+
* map of fragmentDefinitions and GraphQL file cache.
592+
*/
593593
processGraphQLFiles = (
594594
responses: Array<GraphQLFileInfo>,
595595
): {
@@ -630,9 +630,9 @@ export class GraphQLCache implements GraphQLCacheInterface {
630630
};
631631

632632
/**
633-
* Returns a Promise to read a GraphQL file and return a GraphQL metadata
634-
* including a parsed AST.
635-
*/
633+
* Returns a Promise to read a GraphQL file and return a GraphQL metadata
634+
* including a parsed AST.
635+
*/
636636
promiseToReadGraphQLFile = (
637637
filePath: Uri,
638638
): Promise<{

packages/server/src/Logger.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ export class Logger implements VSCodeLogger {
3838

3939
this._logFilePath = join(
4040
dir,
41-
`graphql-language-service-log-${os.userInfo()
42-
.username}-${getDateString()}.log`,
41+
`graphql-language-service-log-${
42+
os.userInfo().username
43+
}-${getDateString()}.log`,
4344
);
4445

4546
this._stream = null;

packages/types/src/index.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,26 @@ import type {GraphQLConfig, GraphQLProjectConfig} from 'graphql-config';
3030
export type TokenPattern = string | ((char: string) => boolean) | RegExp;
3131

3232
export interface CharacterStream {
33-
getStartOfToken: () => number,
34-
getCurrentPosition: () => number,
35-
eol: () => boolean,
36-
sol: () => boolean,
37-
peek: () => string | null,
38-
next: () => string,
39-
eat: (pattern: TokenPattern) => string | void,
40-
eatWhile: (match: TokenPattern) => boolean,
41-
eatSpace: () => boolean,
42-
skipToEnd: () => void,
43-
skipTo: (position: number) => void,
33+
getStartOfToken: () => number;
34+
getCurrentPosition: () => number;
35+
eol: () => boolean;
36+
sol: () => boolean;
37+
peek: () => string | null;
38+
next: () => string;
39+
eat: (pattern: TokenPattern) => string | void;
40+
eatWhile: (match: TokenPattern) => boolean;
41+
eatSpace: () => boolean;
42+
skipToEnd: () => void;
43+
skipTo: (position: number) => void;
4444
match: (
4545
pattern: TokenPattern,
4646
consume: ?boolean,
4747
caseFold: ?boolean,
48-
) => Array<string> | boolean,
49-
backUp: (num: number) => void,
50-
column: () => number,
51-
indentation: () => number,
52-
current: () => string,
48+
) => Array<string> | boolean;
49+
backUp: (num: number) => void;
50+
column: () => number;
51+
indentation: () => number;
52+
current: () => string;
5353
}
5454

5555
// Cache and config-related.
@@ -80,56 +80,56 @@ export type GraphQLConfigurationExtension = {
8080
};
8181

8282
export interface GraphQLCache {
83-
getGraphQLConfig: () => GraphQLConfig,
83+
getGraphQLConfig: () => GraphQLConfig;
8484

8585
getFragmentDependencies: (
8686
query: string,
8787
fragmentDefinitions: ?Map<string, FragmentInfo>,
88-
) => Promise<Array<FragmentInfo>>,
88+
) => Promise<Array<FragmentInfo>>;
8989

9090
getFragmentDependenciesForAST: (
9191
parsedQuery: ASTNode,
9292
fragmentDefinitions: Map<string, FragmentInfo>,
93-
) => Promise<Array<FragmentInfo>>,
93+
) => Promise<Array<FragmentInfo>>;
9494

9595
getFragmentDefinitions: (
9696
graphQLConfig: GraphQLProjectConfig,
97-
) => Promise<Map<string, FragmentInfo>>,
97+
) => Promise<Map<string, FragmentInfo>>;
9898

9999
+updateFragmentDefinition: (
100100
rootDir: Uri,
101101
filePath: Uri,
102102
contents: Array<CachedContent>,
103-
) => Promise<void>,
103+
) => Promise<void>;
104104

105105
+updateFragmentDefinitionCache: (
106106
rootDir: Uri,
107107
filePath: Uri,
108108
exists: boolean,
109-
) => Promise<void>,
109+
) => Promise<void>;
110110

111111
getSchema: (
112112
appName: ?string,
113113
queryHasExtensions?: ?boolean,
114-
) => Promise<?GraphQLSchema>,
114+
) => Promise<?GraphQLSchema>;
115115

116116
handleWatchmanSubscribeEvent: (
117117
rootDir: string,
118118
projectConfig: GraphQLProjectConfig,
119-
) => (result: Object) => void,
119+
) => (result: Object) => void;
120120
}
121121

122122
// online-parser related
123123
export interface Position {
124-
line: number,
125-
character: number,
126-
lessThanOrEqualTo: (position: Position) => boolean,
124+
line: number;
125+
character: number;
126+
lessThanOrEqualTo: (position: Position) => boolean;
127127
}
128128

129129
export interface Range {
130-
start: Position,
131-
end: Position,
132-
containsPosition: (position: Position) => boolean,
130+
start: Position;
131+
end: Position;
132+
containsPosition: (position: Position) => boolean;
133133
}
134134

135135
export type CachedContent = {
@@ -280,11 +280,11 @@ export type Outline = {
280280
};
281281

282282
export interface DidChangeWatchedFilesParams {
283-
changes: FileEvent[],
283+
changes: FileEvent[];
284284
}
285285
export interface FileEvent {
286-
uri: string,
287-
type: FileChangeType,
286+
uri: string;
287+
type: FileChangeType;
288288
}
289289
export const FileChangeTypeKind = {
290290
Created: 1,

resources/pretty.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const {stdout, stderr, status, error} = spawnSync(executable, [
3333
glob,
3434
]);
3535
const out = stdout.toString().trim();
36-
const err = stdout.toString().trim();
36+
const err = stderr.toString().trim();
3737

3838
function print(message) {
3939
if (message) {

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,9 +2673,9 @@ preserve@^0.2.0:
26732673
version "0.2.0"
26742674
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
26752675

2676-
prettier@^1.5.3:
2677-
version "1.7.0"
2678-
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.0.tgz#47481588f41f7c90f63938feb202ac82554e7150"
2676+
prettier@1.13:
2677+
version "1.13.3"
2678+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.3.tgz#e74c09a7df6519d472ca6febaa37cf7addb48a20"
26792679

26802680
private@^0.1.6, private@^0.1.7:
26812681
version "0.1.7"

0 commit comments

Comments
 (0)