Skip to content

Commit a19aabc

Browse files
Andre Quispesaraviafacebook-github-bot
Andre Quispesaravia
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

+9-8
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

+10-2
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

+2-2
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

+29-17
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

+1-1
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

+1-1
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

+5-2
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

+2-1
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

+2-1
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

+9-14
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
}

src/devtools/cache.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ function getEntriesForResource(
9090
if (entriesForResource === undefined) {
9191
const config = resourceConfigs.get(resource);
9292
entriesForResource =
93-
config !== undefined && config.useWeakMap ? (new WeakMap(): $FlowFixMe) : new Map();
93+
config !== undefined && config.useWeakMap
94+
? (new WeakMap(): $FlowFixMe)
95+
: new Map();
9496
entries.set(resource, entriesForResource);
9597
}
9698
return entriesForResource;

src/devtools/views/ButtonIcon.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ function getPathData(type: IconType) {
103103
}
104104
}
105105

106-
export default function ButtonIcon({ className = '', type }: Props): React$MixedElement {
106+
export default function ButtonIcon({
107+
className = '',
108+
type,
109+
}: Props): React$MixedElement {
107110
const pathData = getPathData(type);
108111
return (
109112
<svg

src/devtools/views/Components/KeyValue.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
* @flow
88
*/
99

10-
import type { Element as $IMPORTED_TYPE$_Element } from "react";import React, { useState } from 'react';
10+
import type { Element as $IMPORTED_TYPE$_Element } from 'react';
11+
import React, { useState } from 'react';
1112
import type { Element } from 'react';
1213
// import EditableValue from './EditableValue';
1314
import ExpandCollapseToggle from './ExpandCollapseToggle';
@@ -32,9 +33,9 @@ export default function KeyValue({
3233
value,
3334
}: KeyValueProps):
3435
| any
35-
| $IMPORTED_TYPE$_Element<"div">
36+
| $IMPORTED_TYPE$_Element<'div'>
3637
| Array<Element<any>>
37-
| Array<any | $IMPORTED_TYPE$_Element<"div">> {
38+
| Array<any | $IMPORTED_TYPE$_Element<'div'>> {
3839
const [isOpen, setIsOpen] = useState<boolean>(false);
3940
const [wasOpen, setWasOpen] = useState<boolean>(isOpen);
4041
if (isOpen && !wasOpen) {
@@ -77,7 +78,9 @@ export default function KeyValue({
7778
if (Array.isArray(value)) {
7879
const hasChildren = value.length > 0;
7980

80-
const children: any | Array<any | $IMPORTED_TYPE$_Element<"div">> = wasOpen
81+
const children:
82+
| any
83+
| Array<any | $IMPORTED_TYPE$_Element<'div'>> = wasOpen
8184
? value.map((innerValue, index) => (
8285
<KeyValue
8386
key={index}
@@ -125,7 +128,9 @@ export default function KeyValue({
125128
const hasChildren = entries.length > 0;
126129
const displayName = 'Object';
127130

128-
const children: Array<Element<any>> | Array<any | $IMPORTED_TYPE$_Element<"div">> = wasOpen
131+
const children:
132+
| Array<Element<any>>
133+
| Array<any | $IMPORTED_TYPE$_Element<'div'>> = wasOpen
129134
? entries.map(([entriesName, entriesVal]) => (
130135
<KeyValue
131136
key={entriesName}

src/devtools/views/Icon.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ function getPathData(type: IconType) {
5959
}
6060
}
6161

62-
export default function Icon({ className = '', type }: Props): React$MixedElement {
62+
export default function Icon({
63+
className = '',
64+
type,
65+
}: Props): React$MixedElement {
6366
const pathData = getPathData(type);
6467
const circlePathData =
6568
pathData === PATH_GITHUB_FEEDBACK ? PATH_GITHUB_CIRCLE : null;

src/devtools/views/ModalDialog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function ModalDialogContextController({ children }: Props): React$MixedElement {
9696
);
9797
}
9898

99-
function ModalDialog(_: {||}): React$MixedElement | null {
99+
function ModalDialog(_: {||}): React$MixedElement | null {
100100
const { isVisible } = useContext(ModalDialogContext);
101101
return isVisible ? <ModalDialogImpl /> : null;
102102
}

src/devtools/views/Network/Network.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ function appearsInResponse(searchText: string, response: Object): boolean {
9393
return false;
9494
}
9595

96-
function Network(props: {| +portalContainer: mixed, currentEnvID: ?number |}): React$MixedElement | null {
96+
function Network(props: {|
97+
+portalContainer: mixed,
98+
currentEnvID: ?number,
99+
|}): React$MixedElement | null {
97100
const store = useContext(StoreContext);
98101

99102
const [, forceUpdate] = useState({});

src/devtools/views/Settings/GeneralSettings.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ export default function GeneralSettings(_: {||}): React$MixedElement {
1818
);
1919

2020
const updateDisplayDensity = useCallback(
21-
({currentTarget}: any) => {
21+
({ currentTarget }: any) => {
2222
setDisplayDensity(currentTarget.value);
2323
},
2424
[setDisplayDensity]
2525
);
2626
const updateTheme = useCallback(
27-
({currentTarget}: any) => {
27+
({ currentTarget }: any) => {
2828
setTheme(currentTarget.value);
2929
},
3030
[setTheme]

src/devtools/views/Settings/SettingsContext.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ type Context = {|
2727
setTheme(value: Theme): void,
2828
|};
2929

30-
const SettingsContext: $FlowFixMe = createContext<Context>(((null: any): Context));
30+
const SettingsContext: $FlowFixMe = createContext<Context>(
31+
((null: any): Context)
32+
);
3133
SettingsContext.displayName = 'SettingsContext';
3234

3335
type DocumentElements = Array<HTMLElement>;

src/devtools/views/Settings/SettingsModalContext.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ type Context = {
1717
setIsModalShowing: (value: boolean) => void,
1818
};
1919

20-
const SettingsModalContext: $FlowFixMe = createContext<Context>(((null: any): Context));
20+
const SettingsModalContext: $FlowFixMe = createContext<Context>(
21+
((null: any): Context)
22+
);
2123
SettingsModalContext.displayName = 'SettingsModalContext';
2224

2325
function SettingsModalContextController({

src/devtools/views/StoreInspector/EventLogger/AllEventsList.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ const networkEventNames = [
2929
'network.unsubscribe',
3030
];
3131

32-
function eventsAreLinked(events: any | $ReadOnlyArray<LogEvent>, selectedEventID: any | number, index: any | number) {
32+
function eventsAreLinked(
33+
events: any | $ReadOnlyArray<LogEvent>,
34+
selectedEventID: any | number,
35+
index: any | number
36+
) {
3337
const currentEvent = events[index];
3438
const selectedEvent = events[selectedEventID];
3539
return (
@@ -81,7 +85,7 @@ function StoreEventDisplay({
8185
events: $ReadOnlyArray<LogEvent>,
8286
index: number,
8387
selectedEventID: number,
84-
setSelectedEventID: (number) => void,
88+
setSelectedEventID: number => void,
8589
|}) {
8690
return (
8791
<div

0 commit comments

Comments
 (0)