mirror of https://github.com/status-im/metro.git
Add @flow to bunch of (mostly test-) files that trivially pass
Reviewed By: rafeca Differential Revision: D6712326 fbshipit-source-id: 44ef8506664f92a34f8e3ca124bd6167a20fbade
This commit is contained in:
parent
600af08361
commit
333182363a
|
@ -7,6 +7,7 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
@ -27,7 +28,7 @@ mockColor.bgRed = function() {
|
|||
};
|
||||
|
||||
module.exports = {
|
||||
dim: s => s,
|
||||
dim: <T>(s: T) => s, // (elaborate way of saying "any", fine for this case)
|
||||
magenta: mockColor,
|
||||
white: mockColor,
|
||||
blue: mockColor,
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
@ -24,10 +25,12 @@ describe('Logger', () => {
|
|||
const originalConsoleLog = console.log;
|
||||
|
||||
beforeEach(() => {
|
||||
// $FlowFixMe don't worry, state restored below
|
||||
console.log = jest.fn();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// $FlowFixMe
|
||||
console.log = originalConsoleLog;
|
||||
});
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ class Generator {
|
|||
*
|
||||
* This is ~2.5x faster than calling `JSON.stringify(generator.toMap())`
|
||||
*/
|
||||
toString(file?: string, options: {excludeSource?: boolean}): string {
|
||||
toString(file?: string, options?: {excludeSource?: boolean}): string {
|
||||
let content;
|
||||
|
||||
if (options && options.excludeSource) {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
@ -22,7 +23,7 @@ beforeEach(() => {
|
|||
it('exposes a fluent interface', () => {
|
||||
expect(builder.markLines(0)).toBe(builder);
|
||||
expect(builder.markLines(3)).toBe(builder);
|
||||
expect(builder.startSegment()).toBe(builder);
|
||||
expect(builder.startSegment(0)).toBe(builder);
|
||||
expect(builder.append(4)).toBe(builder);
|
||||
});
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @emails oncal+javascript_foundation
|
||||
* @emails oncall+javascript_foundation
|
||||
* @flow
|
||||
* @format
|
||||
*/
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @emails oncall+javascript_foundation
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
@ -25,6 +26,9 @@ const babelOptions = {
|
|||
};
|
||||
|
||||
function normalize({code}) {
|
||||
if (code === undefined || code === null) {
|
||||
return 'FAIL';
|
||||
}
|
||||
return babel.transform(code, babelOptions).code;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ const FILE_TYPE = 'module';
|
|||
|
||||
describe('build setup', () => {
|
||||
const buildSetup = ModuleGraph.createBuildSetup(graph, mds => {
|
||||
// TODO: the .sort() function returns -1 1 or 0 for sorting, not boolean
|
||||
return [...mds].sort((l, r) => l.file.path > r.file.path);
|
||||
});
|
||||
const polyfillOptions = {getPolyfills: () => ['polyfill-a', 'polyfill-b']};
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* All rights reserved.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -7,12 +7,13 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function(declared) {
|
||||
return function(opts) {
|
||||
module.exports = function(declared: Object) {
|
||||
return function(opts: Object) {
|
||||
for (var p in declared) {
|
||||
if (opts[p] == null && declared[p].default != null) {
|
||||
opts[p] = declared[p].default;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @emails oncall+javascript_foundation
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -7,4 +7,5 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
* React Native CLI configuration file
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*
|
||||
* @format
|
||||
* @emails oncall+js_foundation
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
|
|
Loading…
Reference in New Issue