react-native-macos/flow-github/metro.js

16 строки
435 B
JavaScript
Исходник Обычный вид История

Fix failure due to missing Metro flow types Summary: Fixes the Flow failure due to an undefined Ast type. Before: ``` $ npm run flow -- check > react-native@1000.0.0 flow /Users/hramos/git/react-native > flow "check" Error: local-cli/__tests__/fs-mock-test.js:27 27: beforeEach(() => { ^^^^^^^^^^ beforeEach. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:53 53: expect(content).toEqual('beep'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:88 88: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:100 100: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: node_modules/metro/src/Bundler/util.js.flow:46 46: ): Ast { ^^^ Ast. Could not resolve name Error: node_modules/metro/src/ModuleGraph/worker/collect-dependencies.js.flow:283 283: const xp = (module.exports = (ast: Ast) => ^^^ Ast. Could not resolve name Error: node_modules/metro/src/assetTransformer.js.flow:29 29: ): Promise<{ast: Ast}> { ^^^ Ast. Could not resolve name ``` After ``` $ npm run flow -- check > react-native@1000.0.0 flow /Users/hramos/git/react-native > flow "check" Error: local-cli/__tests__/fs-mock-test.js:27 27: beforeEach(() => { ^^^^^^^^^^ beforeEach. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:53 53: expect(content).toEqual('beep'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:88 88: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:100 100: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name ``` [ GENERAL ] [ BUGFIX] [ .flowconfig ] - Have Flow ignore Metro node_nodules Closes https://github.com/facebook/react-native/pull/17187 Differential Revision: D6572303 Pulled By: hramos fbshipit-source-id: aa256b9725970fcc2a6da6578c83e7c0875e3cfd
2017-12-15 02:14:03 +03:00
/**
* Copyright (c) Facebook, Inc. and its affiliates.
Fix failure due to missing Metro flow types Summary: Fixes the Flow failure due to an undefined Ast type. Before: ``` $ npm run flow -- check > react-native@1000.0.0 flow /Users/hramos/git/react-native > flow "check" Error: local-cli/__tests__/fs-mock-test.js:27 27: beforeEach(() => { ^^^^^^^^^^ beforeEach. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:53 53: expect(content).toEqual('beep'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:88 88: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:100 100: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: node_modules/metro/src/Bundler/util.js.flow:46 46: ): Ast { ^^^ Ast. Could not resolve name Error: node_modules/metro/src/ModuleGraph/worker/collect-dependencies.js.flow:283 283: const xp = (module.exports = (ast: Ast) => ^^^ Ast. Could not resolve name Error: node_modules/metro/src/assetTransformer.js.flow:29 29: ): Promise<{ast: Ast}> { ^^^ Ast. Could not resolve name ``` After ``` $ npm run flow -- check > react-native@1000.0.0 flow /Users/hramos/git/react-native > flow "check" Error: local-cli/__tests__/fs-mock-test.js:27 27: beforeEach(() => { ^^^^^^^^^^ beforeEach. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:53 53: expect(content).toEqual('beep'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:88 88: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:100 100: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name ``` [ GENERAL ] [ BUGFIX] [ .flowconfig ] - Have Flow ignore Metro node_nodules Closes https://github.com/facebook/react-native/pull/17187 Differential Revision: D6572303 Pulled By: hramos fbshipit-source-id: aa256b9725970fcc2a6da6578c83e7c0875e3cfd
2017-12-15 02:14:03 +03:00
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
Fix failure due to missing Metro flow types Summary: Fixes the Flow failure due to an undefined Ast type. Before: ``` $ npm run flow -- check > react-native@1000.0.0 flow /Users/hramos/git/react-native > flow "check" Error: local-cli/__tests__/fs-mock-test.js:27 27: beforeEach(() => { ^^^^^^^^^^ beforeEach. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:53 53: expect(content).toEqual('beep'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:88 88: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:100 100: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: node_modules/metro/src/Bundler/util.js.flow:46 46: ): Ast { ^^^ Ast. Could not resolve name Error: node_modules/metro/src/ModuleGraph/worker/collect-dependencies.js.flow:283 283: const xp = (module.exports = (ast: Ast) => ^^^ Ast. Could not resolve name Error: node_modules/metro/src/assetTransformer.js.flow:29 29: ): Promise<{ast: Ast}> { ^^^ Ast. Could not resolve name ``` After ``` $ npm run flow -- check > react-native@1000.0.0 flow /Users/hramos/git/react-native > flow "check" Error: local-cli/__tests__/fs-mock-test.js:27 27: beforeEach(() => { ^^^^^^^^^^ beforeEach. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:53 53: expect(content).toEqual('beep'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:88 88: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:100 100: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name ``` [ GENERAL ] [ BUGFIX] [ .flowconfig ] - Have Flow ignore Metro node_nodules Closes https://github.com/facebook/react-native/pull/17187 Differential Revision: D6572303 Pulled By: hramos fbshipit-source-id: aa256b9725970fcc2a6da6578c83e7c0875e3cfd
2017-12-15 02:14:03 +03:00
*
* @flow
* @format
Fix failure due to missing Metro flow types Summary: Fixes the Flow failure due to an undefined Ast type. Before: ``` $ npm run flow -- check > react-native@1000.0.0 flow /Users/hramos/git/react-native > flow "check" Error: local-cli/__tests__/fs-mock-test.js:27 27: beforeEach(() => { ^^^^^^^^^^ beforeEach. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:53 53: expect(content).toEqual('beep'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:88 88: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:100 100: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: node_modules/metro/src/Bundler/util.js.flow:46 46: ): Ast { ^^^ Ast. Could not resolve name Error: node_modules/metro/src/ModuleGraph/worker/collect-dependencies.js.flow:283 283: const xp = (module.exports = (ast: Ast) => ^^^ Ast. Could not resolve name Error: node_modules/metro/src/assetTransformer.js.flow:29 29: ): Promise<{ast: Ast}> { ^^^ Ast. Could not resolve name ``` After ``` $ npm run flow -- check > react-native@1000.0.0 flow /Users/hramos/git/react-native > flow "check" Error: local-cli/__tests__/fs-mock-test.js:27 27: beforeEach(() => { ^^^^^^^^^^ beforeEach. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:53 53: expect(content).toEqual('beep'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:88 88: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name Error: local-cli/__tests__/fs-mock-test.js:100 100: expect(content).toEqual('hello, world!'); ^^^^^^ expect. Could not resolve name ``` [ GENERAL ] [ BUGFIX] [ .flowconfig ] - Have Flow ignore Metro node_nodules Closes https://github.com/facebook/react-native/pull/17187 Differential Revision: D6572303 Pulled By: hramos fbshipit-source-id: aa256b9725970fcc2a6da6578c83e7c0875e3cfd
2017-12-15 02:14:03 +03:00
*/
// metro-visualizer is not listed as a dependency of metro since it pulls a lot
// of transitive dependencies so we need to tell flow that it may exist.
declare module 'metro-visualizer' {
declare module.exports: any;
}