Skip to content

Commit 183f96f

Browse files
author
Brian Vaughn
committed
Prettier
1 parent edc46d7 commit 183f96f

File tree

173 files changed

+3253
-3133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+3253
-3133
lines changed

fixtures/devtools/regression/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const http = require('http');
55
const serveStatic = require('serve-static');
66

77
// Serve fixtures folder
8-
const serve = serveStatic(__dirname, { index: 'index.html' });
8+
const serve = serveStatic(__dirname, {index: 'index.html'});
99

1010
// Create server
1111
const server = http.createServer(function onRequest(req, res) {

fixtures/devtools/regression/shared.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const minor =
1010
pieces[0] === '0' ? parseInt(pieces[2], 10) : parseInt(pieces[1], 10);
1111

1212
// Convenience wrapper to organize API features in DevTools.
13-
function Feature({ children, label, version }) {
13+
function Feature({children, label, version}) {
1414
return (
1515
<div className="Feature">
1616
<div className="FeatureHeader">
@@ -60,10 +60,10 @@ switch (major) {
6060
}
6161
case 6:
6262
// memo
63-
function LabelComponent({ label }) {
63+
function LabelComponent({label}) {
6464
return <label>{label}</label>;
6565
}
66-
const AnonymousMemoized = React.memo(({ label }) => (
66+
const AnonymousMemoized = React.memo(({label}) => (
6767
<label>{label}</label>
6868
));
6969
const Memoized = React.memo(LabelComponent);
@@ -91,8 +91,8 @@ switch (major) {
9191
getResourceKey
9292
);
9393
class Suspending extends React.Component {
94-
state = { useSuspense: false };
95-
useSuspense = () => this.setState({ useSuspense: true });
94+
state = {useSuspense: false};
95+
useSuspense = () => this.setState({useSuspense: true});
9696
render() {
9797
if (this.state.useSuspense) {
9898
const text = Resource.read(['loaded', 2000]);
@@ -141,9 +141,9 @@ switch (major) {
141141
case 4:
142142
// unstable_Profiler
143143
class ProfilerChild extends React.Component {
144-
state = { count: 0 };
144+
state = {count: 0};
145145
incrementCount = () =>
146-
this.setState(prevState => ({ count: prevState.count + 1 }));
146+
this.setState(prevState => ({count: prevState.count + 1}));
147147
render() {
148148
return (
149149
<div>
@@ -159,8 +159,7 @@ switch (major) {
159159
<Feature
160160
key="unstable_Profiler"
161161
label="unstable_Profiler"
162-
version="16.4+"
163-
>
162+
version="16.4+">
164163
<Profiler id="count" onRender={onRender}>
165164
<div>
166165
<ProfilerChild />
@@ -230,8 +229,7 @@ switch (major) {
230229
<Feature
231230
key="AsyncMode/ConcurrentMode"
232231
label="AsyncMode/ConcurrentMode"
233-
version="16.3+"
234-
>
232+
version="16.3+">
235233
<ConcurrentMode>
236234
<div>
237235
unstable_AsyncMode was added in 16.3, renamed to
@@ -271,13 +269,13 @@ function Even() {
271269

272270
// Simple stateful app shared by all React versions
273271
class SimpleApp extends React.Component {
274-
state = { count: 0 };
272+
state = {count: 0};
275273
incrementCount = () => {
276-
const updaterFn = prevState => ({ count: prevState.count + 1 });
274+
const updaterFn = prevState => ({count: prevState.count + 1});
277275
trace('Updating count', performance.now(), () => this.setState(updaterFn));
278276
};
279277
render() {
280-
const { count } = this.state;
278+
const {count} = this.state;
281279
return (
282280
<div>
283281
{count % 2 === 0 ? (
@@ -299,7 +297,7 @@ apps.push(
299297
);
300298

301299
// This component, with the version prop, helps organize DevTools at a glance.
302-
function TopLevelWrapperForDevTools({ version }) {
300+
function TopLevelWrapperForDevTools({version}) {
303301
let header = <h1>React {version}</h1>;
304302
if (version.includes('canary')) {
305303
const commitSha = version.match(/.+canary-(.+)/)[1];

fixtures/devtools/shell/app/DeeplyNestedComponents/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22

3-
import React, { Fragment } from 'react';
3+
import React, {Fragment} from 'react';
44

55
function wrapWithHoc(Component, index) {
66
function HOC() {

fixtures/devtools/shell/app/EditableProps/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ import React, {
1313
useState,
1414
} from 'react';
1515

16-
const initialData = { foo: 'FOO', bar: 'BAR' };
16+
const initialData = {foo: 'FOO', bar: 'BAR'};
1717

1818
function reducer(state, action) {
1919
switch (action.type) {
2020
case 'swap':
21-
return { foo: state.bar, bar: state.foo };
21+
return {foo: state.bar, bar: state.foo};
2222
default:
2323
throw new Error();
2424
}
2525
}
2626

27-
type StatefulFunctionProps = {| name: string |};
27+
type StatefulFunctionProps = {|name: string|};
2828

29-
function StatefulFunction({ name }: StatefulFunctionProps) {
29+
function StatefulFunction({name}: StatefulFunctionProps) {
3030
const [count, updateCount] = useState(0);
3131
const debouncedCount = useDebounce(count, 1000);
3232
const handleUpdateCountClick = useCallback(() => updateCount(count + 1), [
@@ -35,7 +35,7 @@ function StatefulFunction({ name }: StatefulFunctionProps) {
3535

3636
const [data, dispatch] = useReducer(reducer, initialData);
3737
const handleUpdateReducerClick = useCallback(
38-
() => dispatch({ type: 'swap' }),
38+
() => dispatch({type: 'swap'}),
3939
[]
4040
);
4141

@@ -60,8 +60,8 @@ function StatefulFunction({ name }: StatefulFunctionProps) {
6060
const BoolContext = createContext(true);
6161
BoolContext.displayName = 'BoolContext';
6262

63-
type Props = {| name: string, toggle: boolean |};
64-
type State = {| cities: Array<string>, state: string |};
63+
type Props = {|name: string, toggle: boolean|};
64+
type State = {|cities: Array<string>, state: string|};
6565

6666
class StatefulClass extends Component<Props, State> {
6767
static contextType = BoolContext;
@@ -71,7 +71,7 @@ class StatefulClass extends Component<Props, State> {
7171
state: 'California',
7272
};
7373

74-
handleChange = ({ target }) =>
74+
handleChange = ({target}) =>
7575
this.setState({
7676
state: target.value,
7777
});
@@ -94,8 +94,8 @@ class StatefulClass extends Component<Props, State> {
9494
const MemoizedStatefulClass = memo(StatefulClass);
9595
const MemoizedStatefulFunction = memo(StatefulFunction);
9696

97-
const ForwardRef = forwardRef<{| name: string |}, HTMLUListElement>(
98-
({ name }, ref) => {
97+
const ForwardRef = forwardRef<{|name: string|}, HTMLUListElement>(
98+
({name}, ref) => {
9999
const [count, updateCount] = useState(0);
100100
const debouncedCount = useDebounce(count, 1000);
101101
const handleUpdateCountClick = useCallback(() => updateCount(count + 1), [

fixtures/devtools/shell/app/Hydration/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22

3-
import React, { Fragment, useDebugValue, useState } from 'react';
3+
import React, {Fragment, useDebugValue, useState} from 'react';
44

55
const div = document.createElement('div');
66
const exmapleFunction = () => {};
@@ -110,7 +110,7 @@ export default function Hydration() {
110110
);
111111
}
112112

113-
function DehydratableProps({ array, object }: any) {
113+
function DehydratableProps({array, object}: any) {
114114
return (
115115
<ul>
116116
<li>array: {JSON.stringify(array, null, 2)}</li>

fixtures/devtools/shell/app/Iframe/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @flow */
22

3-
import React, { Fragment } from 'react';
3+
import React, {Fragment} from 'react';
44
import ReactDOM from 'react-dom';
55

66
export default function Iframe() {
@@ -16,7 +16,7 @@ export default function Iframe() {
1616
);
1717
}
1818

19-
const iframeStyle = { border: '2px solid #eee', height: 80 };
19+
const iframeStyle = {border: '2px solid #eee', height: 80};
2020

2121
function Frame(props) {
2222
const [element, setElement] = React.useState(null);

fixtures/devtools/shell/app/InspectableElements/Contexts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22

3-
import React, { createContext, Component, Fragment, useContext } from 'react';
3+
import React, {createContext, Component, Fragment, useContext} from 'react';
44
import PropTypes from 'prop-types';
55

66
function someNamedFunction() {}
@@ -10,7 +10,7 @@ const contextData = {
1010
bool: true,
1111
func: someNamedFunction,
1212
number: 123,
13-
object: { outer: { inner: {} } },
13+
object: {outer: {inner: {}}},
1414
string: 'abc',
1515
symbol: Symbol.for('symbol'),
1616
null: null,

fixtures/devtools/shell/app/InspectableElements/CustomHooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const object = {
1717
null: null,
1818
undefined: undefined,
1919
array: ['a', 'b', 'c'],
20-
object: { foo: 1, bar: 2, baz: 3 },
20+
object: {foo: 1, bar: 2, baz: 3},
2121
};
2222

2323
function useNestedInnerHook() {

fixtures/devtools/shell/app/InspectableElements/InspectableElements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22

3-
import React, { Fragment } from 'react';
3+
import React, {Fragment} from 'react';
44
import Contexts from './Contexts';
55
import CustomHooks from './CustomHooks';
66
import CustomObject from './CustomObject';

fixtures/devtools/shell/app/InspectableElements/NestedProps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function ObjectProps() {
2222
}}
2323
array={['first', 'second', 'third']}
2424
objectInArray={[object]}
25-
arrayInObject={{ array: ['first', 'second', 'third'] }}
25+
arrayInObject={{array: ['first', 'second', 'third']}}
2626
deepObject={{
2727
// Known limitation: we won't go deeper than several levels.
2828
// In the future, we might offer a way to request deeper access on demand.

0 commit comments

Comments
 (0)