Skip to content

Commit

Permalink
[Resolve]
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienKode committed Sep 12, 2017
2 parents 7560ce0 + b45c91d commit e3688b5
Show file tree
Hide file tree
Showing 522 changed files with 10,874 additions and 6,462 deletions.
12 changes: 11 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,17 @@

// General

"comma-dangle": 0, // disallow trailing commas in object literals
// This must be disallowed in this repo because the minimum supported
// version of node is 4 which doesn't support trailing commas.
// Once the minimum supported version is 8 or greater this can be changed
"comma-dangle": [2, { // disallow trailing commas in object literals
"arrays": "ignore",
"objects": "ignore",
"imports": "ignore",
"exports": "ignore",
"functions": "never"
}],

"no-cond-assign": 1, // disallow assignment in conditional expressions
"no-console": 0, // disallow use of console (off by default in the node environment)
"no-const-assign": 2, // disallow assignment to const-declared variables
Expand Down
8 changes: 5 additions & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|we

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-2]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-2]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-4]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-4]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.52.0
^0.54.0
22 changes: 10 additions & 12 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
docs/* @facebook/react-native
blog/* @facebook/react-native
docs/* @hramos
blog/* @hramos
Libraries/Animated/* @janicduplessis
Libraries/NativeAnimation/* @janicduplessis
Libraries/Image/* @shergin
Libraries/Text/* @shergin
React/Base/* @shergin @javache
React/Views/* @shergin @javache
React/Modules/* @shergin @javache
React/CxxBridge/* @javache
React/Executors/* @javache
React/Base/* @shergin
React/Views/* @shergin
React/Modules/* @shergin
React/CxxBridge/* @mhorowitz
ReactAndroid/src/main/java/com/facebook/react/animated/* @janicduplessis
ReactCommon/* @javache
website/* @facebook/react-native
website/showcase.json @facebook/react-native
package.json @facebook/react-native
website/package.json @facebook/react-native
website/* @hramos
website/showcase.json @hramos
package.json @hramos
website/package.json @hramos
local-cli/core/* @grabbou @kureev
local-cli/link/* @grabbou @kureev
local-cli/unlink/* @grabbou @kureev
4 changes: 2 additions & 2 deletions IntegrationTests/AccessibilityManagerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {
} = ReactNative.NativeModules;


class AccessibilityManagerTest extends React.Component {
class AccessibilityManagerTest extends React.Component<{}> {
componentDidMount() {
AccessibilityManager.setAccessibilityContentSizeMultipliers({
'extraSmall': 1.0,
Expand All @@ -42,7 +42,7 @@ class AccessibilityManagerTest extends React.Component {
});
}

render(): React.Element<any> {
render(): React.Node {
return <View />;
}
}
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/AppEventsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type State = {
elapsed?: string,
};

class AppEventsTest extends React.Component {
class AppEventsTest extends React.Component<{}, State> {
state: State = {sent: 'none', received: 'none'};

componentDidMount() {
Expand Down
8 changes: 6 additions & 2 deletions IntegrationTests/AsyncStorageTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function testOptimizedMultiGet() {
}


class AsyncStorageTest extends React.Component {
class AsyncStorageTest extends React.Component<{}, $FlowFixMeState> {
state = {
messages: 'Initializing...',
done: false,
Expand All @@ -189,7 +189,11 @@ class AsyncStorageTest extends React.Component {
return (
<View style={{backgroundColor: 'white', padding: 40}}>
<Text>
{this.constructor.displayName + ': '}
{
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error found when Flow v0.54 was deployed.
* To see the error delete this comment and run Flow. */
this.constructor.displayName + ': '}
{this.state.done ? 'Done' : 'Testing...'}
{'\n\n' + this.state.messages}
</Text>
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/ImageCachePolicyTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type State = {
'force-cache'?: boolean,
}

class ImageCachePolicyTest extends React.Component {
class ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {
state = {}

shouldComponentUpdate(nextProps: Props, nextState: State) {
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/ImageSnapshotTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var {
} = ReactNative;
var { TestModule } = ReactNative.NativeModules;

class ImageSnapshotTest extends React.Component {
class ImageSnapshotTest extends React.Component<{}> {
componentDidMount() {
if (!TestModule.verifySnapshot) {
throw new Error('TestModule.verifySnapshot not defined.');
Expand Down
19 changes: 12 additions & 7 deletions IntegrationTests/IntegrationTestHarnessTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
*/
'use strict';

/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame');
var React = require('react');
var PropTypes = require('prop-types');
Expand All @@ -21,12 +24,10 @@ var {
} = ReactNative;
var { TestModule } = ReactNative.NativeModules;

class IntegrationTestHarnessTest extends React.Component {
props: {
shouldThrow?: boolean,
waitOneFrame?: boolean,
};

class IntegrationTestHarnessTest extends React.Component<{
shouldThrow?: boolean,
waitOneFrame?: boolean,
}, $FlowFixMeState> {
static propTypes = {
shouldThrow: PropTypes.bool,
waitOneFrame: PropTypes.bool,
Expand Down Expand Up @@ -62,7 +63,11 @@ class IntegrationTestHarnessTest extends React.Component {
return (
<View style={{backgroundColor: 'white', padding: 40}}>
<Text>
{this.constructor.displayName + ': '}
{
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error found when Flow v0.54 was deployed.
* To see the error delete this comment and run Flow. */
this.constructor.displayName + ': '}
{this.state.done ? 'Done' : 'Testing...'}
</Text>
</View>
Expand Down
8 changes: 7 additions & 1 deletion IntegrationTests/IntegrationTestsApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ var TESTS = [
];

TESTS.forEach(
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error found when Flow v0.54 was deployed. To see the error
* delete this comment and run Flow. */
(test) => AppRegistry.registerComponent(test.displayName, () => test)
);

Expand All @@ -48,7 +51,7 @@ require('LoggingTestModule');

type Test = any;

class IntegrationTestsApp extends React.Component {
class IntegrationTestsApp extends React.Component<{}, $FlowFixMeState> {
state = {
test: (null: ?Test),
};
Expand All @@ -57,6 +60,9 @@ class IntegrationTestsApp extends React.Component {
if (this.state.test) {
return (
<ScrollView>
{/* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This
* comment suppresses an error when upgrading Flow's support for
* React. To see the error delete this comment and run Flow. */}
<this.state.test />
</ScrollView>
);
Expand Down
4 changes: 2 additions & 2 deletions IntegrationTests/PromiseTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var ReactNative = require('react-native');
var { View } = ReactNative;
var { TestModule } = ReactNative.NativeModules;

class PromiseTest extends React.Component {
class PromiseTest extends React.Component<{}> {
shouldResolve = false;
shouldReject = false;
shouldSucceedAsync = false;
Expand Down Expand Up @@ -66,7 +66,7 @@ class PromiseTest extends React.Component {
}
};

render(): React.Element<any> {
render(): React.Node {
return <View />;
}
}
Expand Down
5 changes: 4 additions & 1 deletion IntegrationTests/SimpleSnapshotTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

var React = require('react');
var ReactNative = require('react-native');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame');

var {
Expand All @@ -21,7 +24,7 @@ var {
} = ReactNative;
var { TestModule } = ReactNative.NativeModules;

class SimpleSnapshotTest extends React.Component {
class SimpleSnapshotTest extends React.Component<{}> {
componentDidMount() {
if (!TestModule.verifySnapshot) {
throw new Error('TestModule.verifySnapshot not defined.');
Expand Down
4 changes: 2 additions & 2 deletions IntegrationTests/SyncMethodTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {
} = ReactNative.NativeModules;


class SyncMethodTest extends React.Component {
class SyncMethodTest extends React.Component<{}> {
componentDidMount() {
if (RNTesterTestModule.echoString('test string value') !== 'test string value') {
throw new Error('Something wrong with sync method export');
Expand All @@ -32,7 +32,7 @@ class SyncMethodTest extends React.Component {
TestModule.markTestCompleted();
}

render(): React.Element<any> {
render(): React.Node {
return <View />;
}
}
Expand Down
3 changes: 3 additions & 0 deletions IntegrationTests/TimersTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
var React = require('react');
var createReactClass = require('create-react-class');
var ReactNative = require('react-native');
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
var TimerMixin = require('react-timer-mixin');

var {
Expand Down
4 changes: 2 additions & 2 deletions IntegrationTests/WebSocketTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type State = {
testExpectedResponse: string;
};

class WebSocketTest extends React.Component {
class WebSocketTest extends React.Component<{}, State> {
state: State = {
url: DEFAULT_WS_URL,
fetchStatus: null,
Expand Down Expand Up @@ -158,7 +158,7 @@ class WebSocketTest extends React.Component {
});
}

render(): React.Element<any> {
render(): React.Node {
return <View />;
}
}
Expand Down
2 changes: 2 additions & 0 deletions IntegrationTests/WebViewTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* This source code is licensed under the BSD-style license found in the
* 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.
*
* @providesModule WebViewTest
*/
'use strict';

Expand Down
3 changes: 3 additions & 0 deletions IntegrationTests/websocket_integration_test_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

/* eslint-env node */

/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
* found when Flow v0.54 was deployed. To see the error delete this comment and
* run Flow. */
const WebSocket = require('ws');

console.log(`\
Expand Down
7 changes: 7 additions & 0 deletions Libraries/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rules": {
// This folder currently runs through babel and doesn't need to be
// compatible with node 4
"comma-dangle": 0
}
}
6 changes: 3 additions & 3 deletions Libraries/Alert/AlertIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class AlertIOS {
* Create and display a popup alert.
* @static
* @method alert
* @param title The dialog's title.
* @param title The dialog's title. Passing null or '' will hide the title.
* @param message An optional message that appears below
* the dialog's title.
* @param callbackOrButtons This optional argument should
Expand Down Expand Up @@ -209,7 +209,7 @@ class AlertIOS {
var callback = type;
var defaultValue = message;
RCTAlertManager.alertWithArgs({
title: title || undefined,
title: title || '',
type: 'plain-text',
defaultValue,
}, (id, value) => {
Expand Down Expand Up @@ -242,7 +242,7 @@ class AlertIOS {
}
RCTAlertManager.alertWithArgs({
title: title || undefined,
title: title || '',
message: message || undefined,
buttons,
type: type || undefined,
Expand Down
Loading

0 comments on commit e3688b5

Please sign in to comment.