Update prettier and linter

This commit is contained in:
Nicolas Gallagher
2017-07-09 16:22:17 -07:00
parent f91ecaa81d
commit f6ad9c3afb
57 changed files with 402 additions and 342 deletions
+8 -6
View File
@@ -376,9 +376,10 @@ const TouchableMixin = {
this.state.touchable.touchState = States.NOT_RESPONDER;
this.state.touchable.responderID = dispatchID;
this._receiveSignal(Signals.RESPONDER_GRANT, e);
let delayMS = this.touchableGetHighlightDelayMS !== undefined
? Math.max(this.touchableGetHighlightDelayMS(), 0)
: HIGHLIGHT_DELAY_MS;
let delayMS =
this.touchableGetHighlightDelayMS !== undefined
? Math.max(this.touchableGetHighlightDelayMS(), 0)
: HIGHLIGHT_DELAY_MS;
delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;
if (delayMS !== 0) {
this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);
@@ -386,9 +387,10 @@ const TouchableMixin = {
this._handleDelay(e);
}
let longDelayMS = this.touchableGetLongPressDelayMS !== undefined
? Math.max(this.touchableGetLongPressDelayMS(), 10)
: LONG_PRESS_DELAY_MS;
let longDelayMS =
this.touchableGetLongPressDelayMS !== undefined
? Math.max(this.touchableGetLongPressDelayMS(), 10)
: LONG_PRESS_DELAY_MS;
longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;
this.longPressDelayTimeout = setTimeout(
this._handleLongDelay.bind(this, e),
@@ -180,9 +180,10 @@ const TouchableWithoutFeedback = createReactClass({
children = React.Children.toArray(children);
children.push(Touchable.renderDebugView({ color: 'red', hitSlop: this.props.hitSlop }));
}
const style = Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'Text'
? [styles.root, this.props.disabled && styles.disabled, child.props.style, { color: 'red' }]
: [styles.root, this.props.disabled && styles.disabled, child.props.style];
const style =
Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'Text'
? [styles.root, this.props.disabled && styles.disabled, child.props.style, { color: 'red' }]
: [styles.root, this.props.disabled && styles.disabled, child.props.style];
return (React: any).cloneElement(child, {
...other,
accessible: this.props.accessible !== false,
+8 -7
View File
@@ -38,12 +38,13 @@ class UnimplementedView extends Component {
}
}
const unimplementedViewStyles = process.env.NODE_ENV !== 'production'
? {
alignSelf: 'flex-start',
borderColor: 'red',
borderWidth: 1
}
: {};
const unimplementedViewStyles =
process.env.NODE_ENV !== 'production'
? {
alignSelf: 'flex-start',
borderColor: 'red',
borderWidth: 1
}
: {};
export default UnimplementedView;
+5 -1
View File
@@ -14,7 +14,11 @@ describe('components/View', () => {
test('prop "children"', () => {
const children = <View testID="1" />;
const component = shallow(<View>{children}</View>);
const component = shallow(
<View>
{children}
</View>
);
expect(component.contains(children)).toEqual(true);
});
+10 -8
View File
@@ -22,17 +22,19 @@ var TouchHistoryMath = {
var total = 0;
var count = 0;
var oneTouchData = touchHistory.numberActiveTouches === 1
? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]
: null;
var oneTouchData =
touchHistory.numberActiveTouches === 1
? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]
: null;
if (oneTouchData !== null) {
if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {
total += ofCurrent && isXAxis
? oneTouchData.currentPageX
: ofCurrent && !isXAxis
? oneTouchData.currentPageY
: !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;
total +=
ofCurrent && isXAxis
? oneTouchData.currentPageX
: ofCurrent && !isXAxis
? oneTouchData.currentPageY
: !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;
count = 1;
}
} else {