lint fixes and merge conflict resolution for Mac

This commit is contained in:
Christopher Hogan 2019-03-28 10:56:16 -07:00
Родитель 9a215f9855
Коммит a9f4ec2bf7
13 изменённых файлов: 96 добавлений и 97 удалений

Просмотреть файл

@ -13,23 +13,23 @@
const AnimatedImplementation = require('AnimatedImplementation');
module.exports = {
get FlatList() {
return require('AnimatedFlatList');
get FlatList() {
return require('AnimatedFlatList');
},
get Image() {
return require('AnimatedImage');
get Image() {
return require('AnimatedImage');
},
get ScrollView() {
return require('AnimatedScrollView');
get ScrollView() {
return require('AnimatedScrollView');
},
get SectionList() {
return require('AnimatedSectionList');
get SectionList() {
return require('AnimatedSectionList');
},
get Text() {
return require('AnimatedText');
get Text() {
return require('AnimatedText');
},
get View() {
return require('AnimatedView');
get View() {
return require('AnimatedView');
},
...AnimatedImplementation,
...AnimatedImplementation,
};

Просмотреть файл

@ -21,7 +21,7 @@ const View = require('View');
const invariant = require('fbjs/lib/invariant');
import type { PressEvent } from 'CoreEventTypes';
import type {PressEvent} from 'CoreEventTypes';
type ButtonProps = $ReadOnly<{|
/**
@ -29,38 +29,38 @@ type ButtonProps = $ReadOnly<{|
*/
title: string,
/**
* Handler to be called when the user taps the button
*/
onPress: (event?: PressEvent) => mixed,
/**
* Handler to be called when the user taps the button
*/
onPress: (event?: PressEvent) => mixed,
/**
* Color of the text (iOS), or background color of the button (Android)
*/
color?: ?string,
/**
* Color of the text (iOS), or background color of the button (Android)
*/
color?: ?string,
/**
* TV preferred focus (see documentation for the View component).
*/
hasTVPreferredFocus?: ?boolean,
/**
* TV preferred focus (see documentation for the View component).
*/
hasTVPreferredFocus?: ?boolean,
/**
* Text to display for blindness accessibility features
*/
accessibilityLabel?: ?string,
/**
* Hint text to display blindness accessibility features
*/
accessibilityHint? : ?string, // TODO(OSS Candidate ISS#2710739)
/**
* If true, disable all interactions for this component.
*/
disabled?: ?boolean,
/**
* Text to display for blindness accessibility features
*/
accessibilityLabel?: ?string,
/**
* Hint text to display blindness accessibility features
*/
accessibilityHint?: ?string, // TODO(OSS Candidate ISS#2710739)
/**
* If true, disable all interactions for this component.
*/
disabled?: ?boolean,
/**
* Used to locate this view in end-to-end tests.
*/
testID?: ?string,
/**
* Used to locate this view in end-to-end tests.
*/
testID?: ?string,
|}>;
/**
@ -110,9 +110,9 @@ class Button extends React.Component<ButtonProps> {
Platform.OS === 'ios' ||
Platform.OS === 'macos' /* TODO(macOS ISS#2323203) */
) {
textStyles.push({ color: color });
textStyles.push({color: color});
} else {
buttonStyles.push({ backgroundColor: color });
buttonStyles.push({backgroundColor: color});
}
}
const accessibilityStates = [];
@ -183,11 +183,13 @@ const styles = StyleSheet.create({
color: 'white',
fontWeight: '500',
},
macos: { // [TODO(macOS ISS#2323203)
macos: {
// [TODO(macOS ISS#2323203)
color: '#007AFF',
fontSize: 18,
}, // ]TODO(macOS ISS#2323203)
uwp: { // [TODO(windows ISS)
uwp: {
// [TODO(windows ISS)
color: 'white',
fontWeight: '500',
},

Просмотреть файл

@ -22,7 +22,6 @@ var ViewPropTypes = require('ViewPropTypes');
var createReactClass = require('create-react-class');
var requireNativeComponent = require('requireNativeComponent');
import type {NativeComponent} from 'ReactNative';
import type {ImageSource} from 'ImageSource';
import type {ColorValue} from 'StyleSheetTypes';

Просмотреть файл

@ -8,7 +8,7 @@
* @flow
*/
// TODO(macOS ISS#2323203)
// TODO(macOS ISS#2323203)
'use strict';

Просмотреть файл

@ -682,12 +682,6 @@ const TextInput = createReactClass({
* @platform ios
*/
scrollEnabled: PropTypes.bool,
/**
* If `false`, scrolling of the text view will be disabled.
* The default value is `true`. Does only work with 'multiline={true}'.
* @platform ios
*/
scrollEnabled: PropTypes.bool,
/**
* If `true`, the text input obscures the text entered so that sensitive text
* like passwords stay secure. The default value is `false`. Does not work with 'multiline={true}'.

Просмотреть файл

@ -50,4 +50,4 @@ const styles = StyleSheet.create({
},
});
module.exports = DummyTouchableNativeFeedback;
module.exports = DummyTouchableNativeFeedback;

Просмотреть файл

@ -252,15 +252,15 @@ type AndroidViewProps = $ReadOnly<{|
/**
* When `true`, indicates that the view is clickable. By default,
* all the touchable elements are clickable.
*
*
* @platform android
*/
clickable?: ?boolean, // TODO(android ISS)
/**
* When `clickable` is true, the system will try to invoke this function
* when the user performs a click.
*
*
* @platform android
*/
@ -288,7 +288,7 @@ type AndroidViewProps = $ReadOnly<{|
/**
* fired when the view focus changes (gain->lose or lose->gain)
*
*
* @platform android
*/
onFocusChange?: ?Function, // TODO(android ISS)
@ -474,8 +474,8 @@ export type ViewProps = $ReadOnly<{|
* See http://facebook.github.io/react-native/docs/view.html#pointerevents
*/
pointerEvents?: ?('auto' | 'box-none' | 'box-only' | 'none'),
/**
/**
* This is a special performance property exposed by `RCTView` and is useful
* for scrolling content when there are many subviews, most of which are
* offscreen. For this property to be effective, it must be applied to a

Просмотреть файл

@ -190,18 +190,15 @@ static UIColor *defaultPlaceholderColor()
- (void)setAttributedText:(NSAttributedString *)attributedText
{
// Using `setAttributedString:` while user is typing breaks some internal mechanics
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
// Using `setAttributedString:` while user is typing breaks some internal mechanics
// when entering complex input languages such as Chinese, Korean or Japanese.
// see: https://github.com/facebook/react-native/issues/19339
// We try to avoid calling this method as much as we can.
// If the text has changed, there is nothing we can do.
if (![super.attributedText.string isEqualToString:attributedText.string]) {
#if !TARGET_OS_OSX // TODO(macOS ISS#2323203)
[super setAttributedText:attributedText];
#else // [TODO(macOS ISS#2323203)
[self.textStorage setAttributedString:attributedText];
#endif // ]TODO(macOS ISS#2323203)
} else {
// But if the text is preserved, we just copying the attributes from the source string.
if (![super.attributedText isEqualToAttributedString:attributedText]) {
@ -210,6 +207,9 @@ static UIColor *defaultPlaceholderColor()
}
[self textDidChange];
#else // [TODO(macOS ISS#2323203)
[self.textStorage setAttributedString:attributedText];
#endif // ]TODO(macOS ISS#2323203)
}
#pragma mark - Overrides

Просмотреть файл

@ -20,6 +20,7 @@ class RNTesterExampleContainer extends React.Component {
// Filter platform-specific examples
const {description, platform} = example;
let {title} = example;
let platformSupported;
if (platform) {
if (Array.isArray(platform)) {
if (!platform.includes(Platform.OS)) {

Просмотреть файл

@ -163,7 +163,7 @@ class RewriteExampleInvalidCharacters extends React.Component<
/* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.85 was deployed. To see the error, delete
* this comment and run Flow. */
constructor(props) {
constructor(props) {
super(props);
this.state = {text: ''};
}
@ -187,7 +187,7 @@ class RewriteExampleKana extends React.Component<$FlowFixMeProps, any> {
/* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.85 was deployed. To see the error, delete
* this comment and run Flow. */
constructor(props) {
constructor(props) {
super(props);
this.state = {text: ''};
}
@ -211,7 +211,7 @@ class SecureEntryExample extends React.Component<$FlowFixMeProps, any> {
/* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.85 was deployed. To see the error, delete
* this comment and run Flow. */
constructor(props) {
constructor(props) {
super(props);
this.state = {text: ''};
}
@ -235,7 +235,7 @@ class TokenizedTextExample extends React.Component<$FlowFixMeProps, any> {
/* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.85 was deployed. To see the error, delete
* this comment and run Flow. */
constructor(props) {
constructor(props) {
super(props);
this.state = {text: 'Hello #World'};
}

Просмотреть файл

@ -11,7 +11,7 @@
'use strict';
const log = require('npmlog');
jest.setMock('chalk', { grey: str => str });
jest.setMock('chalk', {grey: str => str});
describe('link', () => {
beforeEach(() => {
@ -33,11 +33,11 @@ describe('link', () => {
it('should accept a name of a dependency to link', done => {
const config = {
getPlatformConfig: () => ({ ios: {}, android: {} }),
getProjectConfig: () => ({ assets: [] }),
getPlatformConfig: () => ({ios: {}, android: {}}),
getProjectConfig: () => ({assets: []}),
getDependencyConfig: jest
.fn()
.mockReturnValue({ assets: [], commands: {} }),
.mockReturnValue({assets: [], commands: {}}),
};
const link = require('../link').func;
@ -51,11 +51,11 @@ describe('link', () => {
it('should accept the name of a dependency with a scope / tag', async () => {
const config = {
getPlatformConfig: () => ({ ios: {}, android: {} }),
getProjectConfig: () => ({ assets: [] }),
getPlatformConfig: () => ({ios: {}, android: {}}),
getProjectConfig: () => ({assets: []}),
getDependencyConfig: jest
.fn()
.mockReturnValue({ assets: [], commands: {} }),
.mockReturnValue({assets: [], commands: {}}),
};
const link = require('../link').func;
@ -67,15 +67,15 @@ describe('link', () => {
it('should register native module when android/ios projects are present', done => {
const registerNativeModule = jest.fn();
const dependencyConfig = { android: {}, ios: {}, assets: [], commands: {} };
const dependencyConfig = {android: {}, ios: {}, assets: [], commands: {}};
const androidLinkConfig = require('../android');
const iosLinkConfig = require('../ios');
const config = {
getPlatformConfig: () => ({
ios: { linkConfig: iosLinkConfig },
android: { linkConfig: androidLinkConfig },
ios: {linkConfig: iosLinkConfig},
android: {linkConfig: androidLinkConfig},
}),
getProjectConfig: () => ({ android: {}, ios: {}, assets: [] }),
getProjectConfig: () => ({android: {}, ios: {}, assets: []}),
getDependencyConfig: jest.fn().mockReturnValue(dependencyConfig),
};
@ -97,10 +97,10 @@ describe('link', () => {
it('should not register modules when they are already installed', done => {
const registerNativeModule = jest.fn();
const dependencyConfig = { ios: {}, android: {}, assets: [], commands: {} };
const dependencyConfig = {ios: {}, android: {}, assets: [], commands: {}};
const config = {
getPlatformConfig: () => ({ ios: {}, android: {} }),
getProjectConfig: () => ({ ios: {}, android: {}, assets: [] }),
getPlatformConfig: () => ({ios: {}, android: {}}),
getProjectConfig: () => ({ios: {}, android: {}, assets: []}),
getDependencyConfig: jest.fn().mockReturnValue(dependencyConfig),
};
@ -137,9 +137,9 @@ describe('link', () => {
getPlatformConfig: () => ({
ios: {},
android: {},
test: { linkConfig: () => linkPluginConfig },
test: {linkConfig: () => linkPluginConfig},
}),
getProjectConfig: () => ({ ios: {}, android: {}, test: {}, assets: [] }),
getProjectConfig: () => ({ios: {}, android: {}, test: {}, assets: []}),
getDependencyConfig: jest.fn().mockReturnValue(dependencyConfig),
};
@ -172,9 +172,9 @@ describe('link', () => {
getPlatformConfig: () => ({
ios: {},
android: {},
test: { linkConfig: () => linkPluginConfig },
test: {linkConfig: () => linkPluginConfig},
}),
getProjectConfig: () => ({ ios: {}, android: {}, test: {}, assets: [] }),
getProjectConfig: () => ({ios: {}, android: {}, test: {}, assets: []}),
getDependencyConfig: jest.fn().mockReturnValue(dependencyConfig),
};
@ -201,12 +201,12 @@ describe('link', () => {
const linkConfig = require('../ios');
const config = {
getPlatformConfig: () => ({ ios: { linkConfig: linkConfig } }),
getProjectConfig: () => ({ ios: {}, assets: [] }),
getPlatformConfig: () => ({ios: {linkConfig: linkConfig}}),
getProjectConfig: () => ({ios: {}, assets: []}),
getDependencyConfig: jest.fn().mockReturnValue({
ios: {},
assets: [],
commands: { prelink, postlink },
commands: {prelink, postlink},
}),
};
@ -223,7 +223,7 @@ describe('link', () => {
it('should copy assets from both project and dependencies projects', done => {
const dependencyAssets = ['Fonts/Font.ttf'];
const dependencyConfig = { assets: dependencyAssets, ios: {}, commands: {} };
const dependencyConfig = {assets: dependencyAssets, ios: {}, commands: {}};
const projectAssets = ['Fonts/FontC.ttf'];
const copyAssets = jest.fn();
@ -231,8 +231,8 @@ describe('link', () => {
const linkConfig = require('../ios');
const config = {
getPlatformConfig: () => ({ ios: { linkConfig: linkConfig } }),
getProjectConfig: () => ({ ios: {}, assets: projectAssets }),
getPlatformConfig: () => ({ios: {linkConfig: linkConfig}}),
getProjectConfig: () => ({ios: {}, assets: projectAssets}),
getDependencyConfig: jest.fn().mockReturnValue(dependencyConfig),
};

Просмотреть файл

@ -43,9 +43,12 @@ function findMatchingSimulator(simulators, simulatorString) {
const device = devices[versionDescriptor];
let version = versionDescriptor;
if ((/^com\.apple\.CoreSimulator\.SimRuntime\./g).test(version)) {
if (/^com\.apple\.CoreSimulator\.SimRuntime\./g.test(version)) {
// Transform "com.apple.CoreSimulator.SimRuntime.iOS-12-2" into "iOS 12.2"
version = version.replace(/^com\.apple\.CoreSimulator\.SimRuntime\.([^-]+)-([^-]+)-([^-]+)$/g, '$1 $2.$3');
version = version.replace(
/^com\.apple\.CoreSimulator\.SimRuntime\.([^-]+)-([^-]+)-([^-]+)$/g,
'$1 $2.$3',
);
}
// Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)

Просмотреть файл

@ -69,7 +69,7 @@ if (!match) {
let [, branchVersion] = match;
// 34c034298dc9cad5a4553964a5a324450fda0385
const currentCommit = exec('git rev-parse HEAD', { silent: true }).stdout.trim();
const currentCommit = exec('git rev-parse HEAD', {silent: true}).stdout.trim();
// [34c034298dc9cad5a4553964a5a324450fda0385, refs/heads/0.33-stable, refs/tags/latest, refs/tags/v0.33.1, refs/tags/v0.34.1-rc]
const tagsWithVersion = exec(`git ls-remote origin | grep ${currentCommit}`, {
silent: true,