Skip to content

Commit a19aabc

Browse files
Andre Quispesaraviafacebook-github-bot
authored andcommitted
run prettier
Summary: as title Differential Revision: D60856257 fbshipit-source-id: ef6b646d36878eefc6577caee6b149e16000367a
1 parent b784ca0 commit a19aabc

32 files changed

+178
-97
lines changed

babel.config.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ module.exports = api => {
4949
}
5050
return {
5151
plugins,
52-
sourceType: "unambiguous",
53-
ignore: [
54-
/\/node_modules\//,
55-
],
52+
sourceType: 'unambiguous',
53+
ignore: [/\/node_modules\//],
5654
presets: [
57-
['@babel/preset-env', {
58-
useBuiltIns: 'entry',
59-
targets,
60-
}],
55+
[
56+
'@babel/preset-env',
57+
{
58+
useBuiltIns: 'entry',
59+
targets,
60+
},
61+
],
6162
'@babel/preset-react',
6263
'@babel/preset-flow',
6364
],

packages/relay-devtools-core/src/backend.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ installHook(window);
2828

2929
const hook: DevToolsHook = window.__RELAY_DEVTOOLS_HOOK__;
3030

31-
function debug(methodName: string, ...args: [] | [any] | [string] | [Array<WallEvent>]) {
31+
function debug(
32+
methodName: string,
33+
...args: [] | [any] | [string] | [Array<WallEvent>]
34+
) {
3235
if (__DEBUG__) {
3336
console.log(
3437
`%c[core/backend] %c${methodName}`,
@@ -40,7 +43,12 @@ function debug(methodName: string, ...args: [] | [any] | [string] | [Array<WallE
4043
}
4144

4245
export function connectToDevTools(options: ?ConnectOptions) {
43-
const {host = 'localhost', port = 8097, websocket, isAppActive = () => true} = options || {};
46+
const {
47+
host = 'localhost',
48+
port = 8097,
49+
websocket,
50+
isAppActive = () => true,
51+
} = options || {};
4452

4553
let retryTimeoutID: TimeoutID | null = null;
4654

packages/relay-devtools-core/webpack.backend.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ module.exports = {
3939

4040
// This name is important; standalone references it in order to connect.
4141
library: {
42-
name:'RelayDevToolsBackend',
42+
name: 'RelayDevToolsBackend',
4343
type: 'umd',
44-
}
44+
},
4545
},
4646
resolve: {
4747
alias: {

shells/dev/relay-app/FriendsList/createInBrowserNetwork.js

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
* @flow
88
*/
99

10-
import type { INetwork } from "../../../../node_modules/relay-runtime/network/RelayNetworkTypes";import type { Variables } from "../../../../node_modules/relay-runtime/util/RelayRuntimeTypes";
11-
import type { RequestParameters } from "../../../../node_modules/relay-runtime/util/RelayConcreteNode";/**
10+
import type { INetwork } from '../../../../node_modules/relay-runtime/network/RelayNetworkTypes';
11+
import type { Variables } from '../../../../node_modules/relay-runtime/util/RelayRuntimeTypes';
12+
import type { RequestParameters } from '../../../../node_modules/relay-runtime/util/RelayConcreteNode';
13+
/**
1214
* This file implements the Relay "network" as a server running in the browser.
1315
* This allows the test app to send network requests that can be observed without
1416
* running a separate server.
@@ -102,17 +104,17 @@ function createInBrowserNetwork(): INetwork {
102104
}
103105

104106
friends(): {
105-
count: number,
106-
edges: Array<{ cursor: number, node: User, ... }>,
107-
pageInfo: () => {
108-
endCursor: string,
109-
hasNextPage: boolean,
110-
hasPreviousPage: boolean,
111-
startCursor: string,
112-
...
113-
},
114-
...
115-
} {
107+
count: number,
108+
edges: Array<{ cursor: number, node: User, ... }>,
109+
pageInfo: () => {
110+
endCursor: string,
111+
hasNextPage: boolean,
112+
hasPreviousPage: boolean,
113+
startCursor: string,
114+
...
115+
},
116+
...
117+
} {
116118
if (!this._friends) {
117119
this._friends = [];
118120
for (let i = 0; i < 4; i++) {
@@ -146,25 +148,35 @@ function createInBrowserNetwork(): INetwork {
146148
}
147149

148150
const userMap = new Map<string, User>();
149-
function createUser(id: string |void) {
151+
function createUser(id: string | void) {
150152
const user = new User(id);
151153
userMap.set(user.id, user);
152154
return user;
153155
}
154156

155157
const root = {
156-
node: ({ id }: {id : string | void}) => {
158+
node: ({ id }: { id: string | void }) => {
157159
if (id == null || !userMap.has(id)) {
158160
return createUser(id);
159161
}
160162
return userMap.get(id);
161163
},
162164
};
163165

164-
function fetchQuery(request: RequestParameters, variables: Variables): $FlowFixMe {
166+
function fetchQuery(
167+
request: RequestParameters,
168+
variables: Variables
169+
): $FlowFixMe {
165170
return new Promise(resolve => {
166171
setTimeout(() => {
167-
resolve(graphql({schema, source: request.text, rootValue:root, variableValues: variables}));
172+
resolve(
173+
graphql({
174+
schema,
175+
source: request.text,
176+
rootValue: root,
177+
variableValues: variables,
178+
})
179+
);
168180
}, 1000 + Math.round(Math.random() * 1000));
169181
});
170182
}

shells/dev/relay-app/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import './styles.css';
2020

2121
const roots = [];
2222

23-
function mountHelper(App: ((_: mixed) => React$MixedElement)) {
23+
function mountHelper(App: (_: mixed) => React$MixedElement) {
2424
const container = document.createElement('div');
2525

2626
((document.body: any): HTMLBodyElement).appendChild(container);

shells/dev/src/devtools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ inject('dist/app.js', () => {
5050
connect(cb) {
5151
const bridge = new Bridge<any, any>({
5252
listen(fn) {
53-
const listener = ({data}: any) => {
53+
const listener = ({ data }: any) => {
5454
fn(data);
5555
};
5656
// Preserve the reference to the window we subscribe to, so we can unsubscribe from it when required.

shells/dev/webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ const config = {
4444
resolve: {
4545
alias: {
4646
src: path.resolve(__dirname, '../../src'),
47-
'@babel/runtime': path.resolve(__dirname, '../../node_modules/@babel/runtime'),
47+
'@babel/runtime': path.resolve(
48+
__dirname,
49+
'../../node_modules/@babel/runtime'
50+
),
4851
},
4952
},
5053
plugins: [
@@ -93,7 +96,7 @@ config.output = {
9396
if (TARGET === 'local') {
9497
config.devServer = {
9598
static: {
96-
directory:path.join(__dirname, '/'),
99+
directory: path.join(__dirname, '/'),
97100
},
98101
hot: true,
99102
port: 8080,

src/__tests__/bridge-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
* @flow
88
*/
99

10-
import type { WallEvent } from "../types";describe('Bridge', () => {
10+
import type { WallEvent } from '../types';
11+
describe('Bridge', () => {
1112
let Bridge;
1213

1314
beforeEach(() => {

src/__tests__/store-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
* @flow
88
*/
99

10-
import type { WallEvent } from "../types";describe('Store', () => {
10+
import type { WallEvent } from '../types';
11+
describe('Store', () => {
1112
let Store;
1213
let Bridge;
1314

src/backend/EnvironmentWrapper.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,14 @@ export function attach(
9090
function flushInitialOperations() {
9191
// TODO(damassart): Make this a modular function
9292
if (pendingEventsQueue != null) {
93-
pendingEventsQueue.forEach(
94-
pendingEvent => {
95-
hook.emit(
96-
'environment.event',
97-
{
98-
id: rendererID,
99-
envName: environment.configName,
100-
data: pendingEvent,
101-
eventType: 'environment',
102-
},
103-
);
104-
},
105-
);
93+
pendingEventsQueue.forEach(pendingEvent => {
94+
hook.emit('environment.event', {
95+
id: rendererID,
96+
envName: environment.configName,
97+
data: pendingEvent,
98+
eventType: 'environment',
99+
});
100+
});
106101
pendingEventsQueue = null;
107102
}
108103
sendStoreRecords();
@@ -111,6 +106,6 @@ export function attach(
111106
return {
112107
cleanup,
113108
sendStoreRecords,
114-
flushInitialOperations
109+
flushInitialOperations,
115110
};
116111
}

0 commit comments

Comments
 (0)