Commit Graph

5 Commits

Author SHA1 Message Date
Eli White 86b6f5d39e Add Prettier to some files
Reviewed By: sahrens

Differential Revision: D7958196

fbshipit-source-id: 05a04380a4a1f3abd4cc3a9034fc70deaa4a444b
2018-05-10 16:16:35 -07:00
Mats Byrkeland edb6ca72fd Fix ESLint warnings using 'yarn lint --fix'
Summary:
Hi! I would like to contribute to React Native, and I am just starting out. I forked the repo and found that it has quite a lot of ESLint warnings – many of which were automatically fixable. This PR is simply the result of running `yarn lint --fix` from the root folder.

Most changes are removing trailing spaces from comments.

Haven't really done any manual testing, since I haven't done any code changes manually. `yarn test` runs fine, `yarn flow` runs fine, `yarn prettier` is satisfied.

N/A

[INTERNAL][MINOR][] - Fix ESLint warnings
Closes https://github.com/facebook/react-native/pull/18047

Differential Revision: D7054948

Pulled By: hramos

fbshipit-source-id: d53e692698d1687de5821c3fb5cdb76a5e03b71e
2018-02-22 07:23:17 -08:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.

find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.

Reviewed By: TheSavior, yungsters

Differential Revision: D7007050

fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
2018-02-16 18:31:53 -08:00
Héctor Ramos a1c479fb3b Declare HMRClient module to fix Flow issues in OSS
Summary: Closes https://github.com/facebook/react-native/pull/17881

Differential Revision: D6918186

Pulled By: hramos

fbshipit-source-id: ebcdbde1623eab497062fb50bccb393734b3578f
2018-02-06 16:01:23 -08:00
Héctor Ramos f4d627c8fa 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-14 15:19:08 -08:00