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