diff --git a/babel-preset/configs/hmr.js b/babel-preset/configs/hmr.js index e2b4a0f3d..05b305c09 100644 --- a/babel-preset/configs/hmr.js +++ b/babel-preset/configs/hmr.js @@ -3,6 +3,8 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @format */ 'use strict'; @@ -13,8 +15,8 @@ var transformPath = require.resolve(hmrTransform); module.exports = function(options, filename) { var transform = filename - ? './' + path.relative(path.dirname(filename), transformPath) // packager can't handle absolute paths - : hmrTransform; + ? './' + path.relative(path.dirname(filename), transformPath) // packager can't handle absolute paths + : hmrTransform; // Fix the module path to use '/' on Windows. if (path.sep === '\\') { @@ -26,13 +28,15 @@ module.exports = function(options, filename) { [ require('metro-babel7-plugin-react-transform'), { - transforms: [{ - transform: transform, - imports: ['react'], - locals: ['module'], - }] + transforms: [ + { + transform: transform, + imports: ['react'], + locals: ['module'], + }, + ], }, - ] - ] + ], + ], }; }; diff --git a/babel-preset/configs/main.js b/babel-preset/configs/main.js index e6aeeec39..526d6f7f9 100644 --- a/babel-preset/configs/main.js +++ b/babel-preset/configs/main.js @@ -3,6 +3,8 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @format */ 'use strict'; @@ -31,7 +33,7 @@ const defaultPlugins = [ require('@babel/plugin-transform-modules-commonjs'), { strict: false, - strictMode : false, // prevent "use strict" injections + strictMode: false, // prevent "use strict" injections allowTopLevelThis: true, // dont rewrite global `this` -> `undefined` }, ], diff --git a/flow-github/metro.js b/flow-github/metro.js index ff06b4277..db5dbdc28 100644 --- a/flow-github/metro.js +++ b/flow-github/metro.js @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. * * @flow + * @format */ declare module 'metro' { diff --git a/flow/Map.js b/flow/Map.js index f2021affd..0723ea426 100644 --- a/flow/Map.js +++ b/flow/Map.js @@ -5,23 +5,29 @@ * LICENSE file in the root directory of this source tree. * * @flow + * @format */ // These annotations are copy/pasted from the built-in Flow definitions for // Native Map. -declare module "Map" { +declare module 'Map' { // Use the name "MapPolyfill" so that we don't get confusing error // messages about "Using Map instead of Map". declare class MapPolyfill { @@iterator(): Iterator<[K, V]>; constructor(_: void): MapPolyfill; constructor(_: null): MapPolyfill; - constructor(iterable: Iterable<[Key, Value]>): MapPolyfill; + constructor( + iterable: Iterable<[Key, Value]>, + ): MapPolyfill; clear(): void; delete(key: K): boolean; entries(): Iterator<[K, V]>; - forEach(callbackfn: (value: V, index: K, map: MapPolyfill) => mixed, thisArg?: any): void; + forEach( + callbackfn: (value: V, index: K, map: MapPolyfill) => mixed, + thisArg?: any, + ): void; get(key: K): V | void; has(key: K): boolean; keys(): Iterator; diff --git a/flow/Position.js b/flow/Position.js index 58e3330b0..5bd2717c0 100644 --- a/flow/Position.js +++ b/flow/Position.js @@ -6,10 +6,11 @@ * * @flow * @nolint + * @format */ declare class Position { - coords: Coordinates, - timestamp: number, - mocked: boolean, + coords: Coordinates; + timestamp: number; + mocked: boolean; } diff --git a/flow/Promise.js b/flow/Promise.js index d69944eb4..64350cabc 100644 --- a/flow/Promise.js +++ b/flow/Promise.js @@ -5,41 +5,42 @@ * LICENSE file in the root directory of this source tree. * * @flow + * @format */ // These annotations are copy/pasted from the built-in Flow definitions for // Native Promises with some non-standard APIs added in declare class Promise<+R> { - constructor(callback: ( - resolve: (result?: Promise | R) => void, - reject: (error?: any) => void - ) => mixed): void; + constructor( + callback: ( + resolve: (result?: Promise | R) => void, + reject: (error?: any) => void, + ) => mixed, + ): void; then( onFulfill?: ?(value: R) => Promise | ?U, - onReject?: ?(error: any) => Promise | ?U + onReject?: ?(error: any) => Promise | ?U, ): Promise; - catch( - onReject?: (error: any) => ?Promise | U - ): Promise; + catch(onReject?: (error: any) => ?Promise | U): Promise; static resolve(object?: Promise | T): Promise; static reject(error?: any): Promise; - static all>(promises: T): Promise<$TupleMap>; + static all>( + promises: T, + ): Promise<$TupleMap>; static race(promises: Array>): Promise; // Non-standard APIs // See https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/__forks__/Promise.native.js#L21 - finally( - onFinally?: ?(value: any) => Promise | U - ): Promise; + finally(onFinally?: ?(value: any) => Promise | U): Promise; done( onFulfill?: ?(value: R) => mixed, - onReject?: ?(error: any) => mixed + onReject?: ?(error: any) => mixed, ): void; static cast(object?: T): Promise; diff --git a/flow/Set.js b/flow/Set.js index 54b997a68..ea3b1533b 100644 --- a/flow/Set.js +++ b/flow/Set.js @@ -6,12 +6,13 @@ * * @flow * @nolint + * @format */ // These annotations are copy/pasted from the built-in Flow definitions for // Native Set. -declare module "Set" { +declare module 'Set' { // Use the name "SetPolyfill" so that we don't get confusing error // messages about "Using Set instead of Set". declare class SetPolyfill { @@ -21,7 +22,10 @@ declare module "Set" { clear(): void; delete(value: T): boolean; entries(): Iterator<[T, T]>; - forEach(callbackfn: (value: T, index: T, set: SetPolyfill) => mixed, thisArg?: any): void; + forEach( + callbackfn: (value: T, index: T, set: SetPolyfill) => mixed, + thisArg?: any, + ): void; has(value: T): boolean; keys(): Iterator; size: number; diff --git a/flow/console.js b/flow/console.js index 4e57ba953..a5d0d31bf 100644 --- a/flow/console.js +++ b/flow/console.js @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. * * @flow + * @format */ declare module 'console' { @@ -22,17 +23,17 @@ declare module 'console' { declare function warn(...data: any): void; declare class Console { constructor(stdout: stream$Writable, stdin?: stream$Writable): void; - assert(value: any, ...message: any): void, + assert(value: any, ...message: any): void; dir( obj: Object, options: {showHidden: boolean, depth: number, colors: boolean}, - ): void, - error(...data: any): void, - info(...data: any): void, - log(...data: any): void, - time(label: any): void, - timeEnd(label: any): void, - trace(first: any, ...rest: any): void, - warn(...data: any): void, + ): void; + error(...data: any): void; + info(...data: any): void; + log(...data: any): void; + time(label: any): void; + timeEnd(label: any): void; + trace(first: any, ...rest: any): void; + warn(...data: any): void; } } diff --git a/flow/fbjs.js b/flow/fbjs.js index f7b41b5a6..9106e436d 100644 --- a/flow/fbjs.js +++ b/flow/fbjs.js @@ -3,10 +3,16 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @format */ declare module 'fbjs/lib/invariant' { - declare module.exports: (condition: any, message: string, ...args: Array) => void; + declare module.exports: ( + condition: any, + message: string, + ...args: Array + ) => void; } declare module 'fbjs/lib/nullthrows' { diff --git a/flow/prop-types.js b/flow/prop-types.js index c79dab62b..be239f5bd 100644 --- a/flow/prop-types.js +++ b/flow/prop-types.js @@ -6,6 +6,7 @@ * * @flow * @nolint + * @format */ // TODO (bvaughn) Remove this file once flowtype/flow-typed/pull/773 is merged @@ -14,7 +15,7 @@ type $npm$propTypes$ReactPropsCheckType = ( props: any, propName: string, componentName: string, - href?: string + href?: string, ) => ?Error; declare module 'prop-types' { @@ -39,6 +40,6 @@ declare module 'prop-types' { values: V, location: string, componentName: string, - getStack: ?(() => ?string) - ) : void; + getStack: ?() => ?string, + ): void; }