Add Prettier to some files

Reviewed By: sahrens

Differential Revision: D7958196

fbshipit-source-id: 05a04380a4a1f3abd4cc3a9034fc70deaa4a444b
This commit is contained in:
Eli White 2018-05-10 15:44:53 -07:00 committed by Facebook Github Bot
parent 8f5ebe5952
commit 86b6f5d39e
10 changed files with 71 additions and 44 deletions

View File

@ -3,6 +3,8 @@
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*
* @format
*/ */
'use strict'; 'use strict';
@ -26,13 +28,15 @@ module.exports = function(options, filename) {
[ [
require('metro-babel7-plugin-react-transform'), require('metro-babel7-plugin-react-transform'),
{ {
transforms: [{ transforms: [
{
transform: transform, transform: transform,
imports: ['react'], imports: ['react'],
locals: ['module'], locals: ['module'],
}]
}, },
] ],
] },
],
],
}; };
}; };

View File

@ -3,6 +3,8 @@
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*
* @format
*/ */
'use strict'; 'use strict';
@ -31,7 +33,7 @@ const defaultPlugins = [
require('@babel/plugin-transform-modules-commonjs'), require('@babel/plugin-transform-modules-commonjs'),
{ {
strict: false, strict: false,
strictMode : false, // prevent "use strict" injections strictMode: false, // prevent "use strict" injections
allowTopLevelThis: true, // dont rewrite global `this` -> `undefined` allowTopLevelThis: true, // dont rewrite global `this` -> `undefined`
}, },
], ],

View File

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
* *
* @flow * @flow
* @format
*/ */
declare module 'metro' { declare module 'metro' {

View File

@ -5,23 +5,29 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
* *
* @flow * @flow
* @format
*/ */
// These annotations are copy/pasted from the built-in Flow definitions for // These annotations are copy/pasted from the built-in Flow definitions for
// Native Map. // Native Map.
declare module "Map" { declare module 'Map' {
// Use the name "MapPolyfill" so that we don't get confusing error // Use the name "MapPolyfill" so that we don't get confusing error
// messages about "Using Map instead of Map". // messages about "Using Map instead of Map".
declare class MapPolyfill<K, V> { declare class MapPolyfill<K, V> {
@@iterator(): Iterator<[K, V]>; @@iterator(): Iterator<[K, V]>;
constructor<Key, Value>(_: void): MapPolyfill<Key, Value>; constructor<Key, Value>(_: void): MapPolyfill<Key, Value>;
constructor<Key, Value>(_: null): MapPolyfill<Key, Value>; constructor<Key, Value>(_: null): MapPolyfill<Key, Value>;
constructor<Key, Value>(iterable: Iterable<[Key, Value]>): MapPolyfill<Key, Value>; constructor<Key, Value>(
iterable: Iterable<[Key, Value]>,
): MapPolyfill<Key, Value>;
clear(): void; clear(): void;
delete(key: K): boolean; delete(key: K): boolean;
entries(): Iterator<[K, V]>; entries(): Iterator<[K, V]>;
forEach(callbackfn: (value: V, index: K, map: MapPolyfill<K, V>) => mixed, thisArg?: any): void; forEach(
callbackfn: (value: V, index: K, map: MapPolyfill<K, V>) => mixed,
thisArg?: any,
): void;
get(key: K): V | void; get(key: K): V | void;
has(key: K): boolean; has(key: K): boolean;
keys(): Iterator<K>; keys(): Iterator<K>;

View File

@ -6,10 +6,11 @@
* *
* @flow * @flow
* @nolint * @nolint
* @format
*/ */
declare class Position { declare class Position {
coords: Coordinates, coords: Coordinates;
timestamp: number, timestamp: number;
mocked: boolean, mocked: boolean;
} }

View File

@ -5,41 +5,42 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
* *
* @flow * @flow
* @format
*/ */
// These annotations are copy/pasted from the built-in Flow definitions for // These annotations are copy/pasted from the built-in Flow definitions for
// Native Promises with some non-standard APIs added in // Native Promises with some non-standard APIs added in
declare class Promise<+R> { declare class Promise<+R> {
constructor(callback: ( constructor(
callback: (
resolve: (result?: Promise<R> | R) => void, resolve: (result?: Promise<R> | R) => void,
reject: (error?: any) => void reject: (error?: any) => void,
) => mixed): void; ) => mixed,
): void;
then<U>( then<U>(
onFulfill?: ?(value: R) => Promise<U> | ?U, onFulfill?: ?(value: R) => Promise<U> | ?U,
onReject?: ?(error: any) => Promise<U> | ?U onReject?: ?(error: any) => Promise<U> | ?U,
): Promise<U>; ): Promise<U>;
catch<U>( catch<U>(onReject?: (error: any) => ?Promise<U> | U): Promise<U>;
onReject?: (error: any) => ?Promise<U> | U
): Promise<U>;
static resolve<T>(object?: Promise<T> | T): Promise<T>; static resolve<T>(object?: Promise<T> | T): Promise<T>;
static reject<T>(error?: any): Promise<T>; static reject<T>(error?: any): Promise<T>;
static all<T: Iterable<mixed>>(promises: T): Promise<$TupleMap<T, typeof $await>>; static all<T: Iterable<mixed>>(
promises: T,
): Promise<$TupleMap<T, typeof $await>>;
static race<T>(promises: Array<Promise<T>>): Promise<T>; static race<T>(promises: Array<Promise<T>>): Promise<T>;
// Non-standard APIs // Non-standard APIs
// See https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/__forks__/Promise.native.js#L21 // See https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/__forks__/Promise.native.js#L21
finally<U>( finally<U>(onFinally?: ?(value: any) => Promise<U> | U): Promise<U>;
onFinally?: ?(value: any) => Promise<U> | U
): Promise<U>;
done<U>( done<U>(
onFulfill?: ?(value: R) => mixed, onFulfill?: ?(value: R) => mixed,
onReject?: ?(error: any) => mixed onReject?: ?(error: any) => mixed,
): void; ): void;
static cast<T>(object?: T): Promise<T>; static cast<T>(object?: T): Promise<T>;

View File

@ -6,12 +6,13 @@
* *
* @flow * @flow
* @nolint * @nolint
* @format
*/ */
// These annotations are copy/pasted from the built-in Flow definitions for // These annotations are copy/pasted from the built-in Flow definitions for
// Native Set. // Native Set.
declare module "Set" { declare module 'Set' {
// Use the name "SetPolyfill" so that we don't get confusing error // Use the name "SetPolyfill" so that we don't get confusing error
// messages about "Using Set instead of Set". // messages about "Using Set instead of Set".
declare class SetPolyfill<T> { declare class SetPolyfill<T> {
@ -21,7 +22,10 @@ declare module "Set" {
clear(): void; clear(): void;
delete(value: T): boolean; delete(value: T): boolean;
entries(): Iterator<[T, T]>; entries(): Iterator<[T, T]>;
forEach(callbackfn: (value: T, index: T, set: SetPolyfill<T>) => mixed, thisArg?: any): void; forEach(
callbackfn: (value: T, index: T, set: SetPolyfill<T>) => mixed,
thisArg?: any,
): void;
has(value: T): boolean; has(value: T): boolean;
keys(): Iterator<T>; keys(): Iterator<T>;
size: number; size: number;

View File

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
* *
* @flow * @flow
* @format
*/ */
declare module 'console' { declare module 'console' {
@ -22,17 +23,17 @@ declare module 'console' {
declare function warn(...data: any): void; declare function warn(...data: any): void;
declare class Console { declare class Console {
constructor(stdout: stream$Writable, stdin?: stream$Writable): void; constructor(stdout: stream$Writable, stdin?: stream$Writable): void;
assert(value: any, ...message: any): void, assert(value: any, ...message: any): void;
dir( dir(
obj: Object, obj: Object,
options: {showHidden: boolean, depth: number, colors: boolean}, options: {showHidden: boolean, depth: number, colors: boolean},
): void, ): void;
error(...data: any): void, error(...data: any): void;
info(...data: any): void, info(...data: any): void;
log(...data: any): void, log(...data: any): void;
time(label: any): void, time(label: any): void;
timeEnd(label: any): void, timeEnd(label: any): void;
trace(first: any, ...rest: any): void, trace(first: any, ...rest: any): void;
warn(...data: any): void, warn(...data: any): void;
} }
} }

View File

@ -3,10 +3,16 @@
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*
* @format
*/ */
declare module 'fbjs/lib/invariant' { declare module 'fbjs/lib/invariant' {
declare module.exports: <T>(condition: any, message: string, ...args: Array<any>) => void; declare module.exports: <T>(
condition: any,
message: string,
...args: Array<any>
) => void;
} }
declare module 'fbjs/lib/nullthrows' { declare module 'fbjs/lib/nullthrows' {

View File

@ -6,6 +6,7 @@
* *
* @flow * @flow
* @nolint * @nolint
* @format
*/ */
// TODO (bvaughn) Remove this file once flowtype/flow-typed/pull/773 is merged // TODO (bvaughn) Remove this file once flowtype/flow-typed/pull/773 is merged
@ -14,7 +15,7 @@ type $npm$propTypes$ReactPropsCheckType = (
props: any, props: any,
propName: string, propName: string,
componentName: string, componentName: string,
href?: string href?: string,
) => ?Error; ) => ?Error;
declare module 'prop-types' { declare module 'prop-types' {
@ -39,6 +40,6 @@ declare module 'prop-types' {
values: V, values: V,
location: string, location: string,
componentName: string, componentName: string,
getStack: ?(() => ?string) getStack: ?() => ?string,
) : void; ): void;
} }