Skip to content

Commit 1586a45

Browse files
afc163paranoidjk
authored andcommitted
Auto fix tslint errors
1 parent 9b7d295 commit 1586a45

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+71
-72
lines changed

components/action-sheet/AndroidContainer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ActionSheetAndroid extends React.Component<Props, any> {
5050
<TouchableHighlight
5151
style={[ styles.btn ]}
5252
underlayColor={variables.fill_tap}
53-
onPress={() => this.confirm(index) }
53+
onPress={() => this.confirm(index)}
5454
>
5555
<Text style={[ destructiveButtonIndex === index ? styles.destructiveBtn : null ]}>
5656
{item}
@@ -74,7 +74,7 @@ class ActionSheetAndroid extends React.Component<Props, any> {
7474
>
7575
<View>
7676
{titleMsg}
77-
{message && <View style={styles.message} key="1"><Text>{message}</Text></View> }
77+
{message && <View style={styles.message} key="1"><Text>{message}</Text></View>}
7878
<View>{content}</View>
7979
</View>
8080
</Modal>

components/action-sheet/index.web.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function createActionSheet(flag, config, callback) {
9898
mode = 'share';
9999
const multipleLine = options.length && Array.isArray(options[0]) || false;
100100
const createList = (item, index, rowIndex = 0) => (
101-
<div className={`${prefixCls}-share-list-item`} key={index} onClick={() => cb(index, rowIndex) }>
101+
<div className={`${prefixCls}-share-list-item`} key={index} onClick={() => cb(index, rowIndex)}>
102102
<div className={`${prefixCls}-share-list-item-icon`}>
103103
{item.iconName ? <Icon type={item.iconName}/> : item.icon}
104104
</div>
@@ -149,7 +149,7 @@ function createActionSheet(flag, config, callback) {
149149
>
150150
{children}
151151
</Dialog>,
152-
div
152+
div,
153153
);
154154

155155
return {

components/activity-indicator/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default class RNActivityIndicator extends React.Component<PropTypes, any>
2626
color="white"
2727
size="large"
2828
/>
29-
{ this.props.text && (<Text style={[styles.toast]}>{this.props.text}</Text>) }
29+
{this.props.text && (<Text style={[styles.toast]}>{this.props.text}</Text>)}
3030
</View>
3131
</View>
3232
</View>
@@ -40,7 +40,7 @@ export default class RNActivityIndicator extends React.Component<PropTypes, any>
4040
color={this.props.color}
4141
size={this.props.size}
4242
/>
43-
{ this.props.text && (<Text style={[this.props.styles.tip]}>{this.props.text}</Text>) }
43+
{this.props.text && (<Text style={[this.props.styles.tip]}>{this.props.text}</Text>)}
4444
</View>
4545
);
4646
}

components/activity-indicator/index.web.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ export default class ActivityIndicator extends React.Component<ActivityIndicator
3232
<div className={wrapClass}>
3333
<div className={`${prefixCls}-content`}>
3434
<span className={spinnerClass} />
35-
{ text && (<span className={`${prefixCls}-toast`}>{text}</span>) }
35+
{text && (<span className={`${prefixCls}-toast`}>{text}</span>)}
3636
</div>
3737
</div>
3838
);
3939
} else {
4040
return (
4141
<div className={wrapClass}>
4242
<span className={spinnerClass} />
43-
{ text && (<span className={`${prefixCls}-tip`}>{text}</span>) }
43+
{text && (<span className={`${prefixCls}-tip`}>{text}</span>)}
4444
</div>
4545
);
4646
}

components/badge/index.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ export default class Badge extends React.Component<BadgeProps, any> {
2020

2121
const badgeCls = corner ? 'textCorner' : 'textDom';
2222
const contentDom = !dot ? (
23-
<View style={ [styles[badgeCls], styles[`${badgeCls}${size}`]] }>
24-
<Text style={ [styles.text] }>{badgeText}</Text>
23+
<View style={[styles[badgeCls], styles[`${badgeCls}${size}`]]}>
24+
<Text style={[styles.text]}>{badgeText}</Text>
2525
</View>
26-
) : <View style={ [styles.dot, styles[`dotSize${size}`] ] } />;
26+
) : <View style={[styles.dot, styles[`dotSize${size}`] ]} />;
2727

2828
return (
2929
<View style={[ styles.wrap, style ]}>
30-
<View style={ [styles[`${badgeCls}Wrap`]] }>
30+
<View style={[styles[`${badgeCls}Wrap`]]}>
3131
{children}
3232
{contentDom}
3333
</View>

components/badge/index.web.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
4949
return (
5050
<span className={badgeCls} title={text}>
5151
{children}
52-
{ !hidden && <sup className={scrollNumberCls} style={style} > {text} </sup> }
52+
{!hidden && <sup className={scrollNumberCls} style={style} > {text} </sup>}
5353
</span>);
5454
}
5555
}

components/button/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ export default class Button extends React.Component<tsProps, any> {
9797
];
9898

9999
const underlayColor = StyleSheet.flatten(
100-
styles[activeStyle ? `${type}Highlight` : `${type}Raw`]
100+
styles[activeStyle ? `${type}Highlight` : `${type}Raw`],
101101
).backgroundColor;
102102

103103
const indicatorColor = (StyleSheet.flatten(
104-
this.state.pressIn ? styles[`${type}HighlightText`] : styles[`${type}RawText`]
104+
this.state.pressIn ? styles[`${type}HighlightText`] : styles[`${type}RawText`],
105105
) as any).color;
106106

107107
return (

components/card/CardFooter.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class CardFooter extends React.Component<CardFooterProps, any> {
3131
return (
3232
<View style={[styles.footerWrap, style]} {...restProps}>
3333
{contentDom}
34-
{ extra ? extraDom : null }
34+
{extra ? extraDom : null}
3535
</View>
3636
);
3737
}

components/card/CardFooter.web.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class CardFooter extends React.Component <CardFooterProps, any> {
2323
return (
2424
<div className={wrapCls} {...restProps}>
2525
<div className={`${prefixCls}-footer-content`}>{content}</div>
26-
{ extra && <div className={`${prefixCls}-footer-extra`}>{extra}</div> }
26+
{extra && <div className={`${prefixCls}-footer-extra`}>{extra}</div>}
2727
</div>
2828
);
2929
}

components/card/CardHeader.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export default class CardHeader extends React.Component<CardHeaderProps, any> {
3434
return (
3535
<View style={[styles.headerWrap, style]} {...restProps}>
3636
<View style={[styles.headerTitle]}>
37-
{ thumb ? <Image source={{ uri: thumb }} style={[styles.headerImage, thumbStyle]} /> : null }
37+
{thumb ? <Image source={{ uri: thumb }} style={[styles.headerImage, thumbStyle]} /> : null}
3838
{titleDom}
3939
</View>
40-
{ extra ? extraDom : null }
40+
{extra ? extraDom : null}
4141
</View>
4242
);
4343
}

components/card/CardHeader.web.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ export default class CardHeader extends React.Component <CardHeaderProps, any> {
2626
return (
2727
<div className={wrapCls} {...restProps}>
2828
<div className={`${prefixCls}-header-content`}>
29-
{ thumb ? <img style={thumbStyle} src={thumb} /> : null }
29+
{thumb ? <img style={thumbStyle} src={thumb} /> : null}
3030
{title}
3131
</div>
32-
{ extra ? <div className={`${prefixCls}-header-extra`}>{extra}</div> : null }
32+
{extra ? <div className={`${prefixCls}-header-extra`}>{extra}</div> : null}
3333
</div>
3434
);
3535
}

components/checkbox/AgreeItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default class AgreeItem extends React.Component<AgreeItemPropsType, any>
3535
defaultChecked={defaultChecked}
3636
onChange={onChange}
3737
/>
38-
<View style={{flex:1}}>
38+
<View style={{flex: 1}}>
3939
{contentDom}
4040
</View>
4141
</View>

components/checkbox/Checkbox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default class Checkbox extends React.Component<CheckboxProps, any> {
6464
<TouchableWithoutFeedback onPress={this.handleClick}>
6565
<View style={[styles.wrapper]}>
6666
<Image source={imgSrc} style={[styles.icon, style]} />
67-
{ typeof children === 'string' ? ( <Text style={styles.iconRight}>{this.props.children}</Text>) : children }
67+
{typeof children === 'string' ? ( <Text style={styles.iconRight}>{this.props.children}</Text>) : children}
6868
</View>
6969
</TouchableWithoutFeedback>
7070
);

components/checkbox/demo/basic.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default class BasicCheckboxExample extends React.Component<any, any> {
2121
<View style={{ padding: 10 }}>
2222
<Checkbox
2323
checked={this.state.checkBox1}
24-
style={{tintColor:'#f00'}}
24+
style={{tintColor: '#f00'}}
2525
onChange={(event) => { this.setState({ checkBox1: event.target.checked }); }}
2626
/>
2727
<WhiteSpace />
@@ -37,7 +37,7 @@ export default class BasicCheckboxExample extends React.Component<any, any> {
3737
<WhiteSpace />
3838
<AgreeItem
3939
checked={this.state.agreeItem1}
40-
checkboxStyle={{tintColor:'#f00'}}
40+
checkboxStyle={{tintColor: '#f00'}}
4141
onChange={(event) => { this.setState({ agreeItem1: event.target.checked }); }}
4242
>
4343
同意 《信用支付服务合同

components/date-picker/demo/popup.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export default class PopupExample extends React.Component<any, any> {
2929
defaultDate={defaultDate}
3030
value={this.state.value}
3131
mode="date"
32-
minDate={this.date1MinDate || (this.date1MinDate = moment('2015-08-06','YYYY-MM-DD'))}
33-
maxDate={this.date1MaxDate || (this.date1MaxDate = moment('2016-12-06','YYYY-MM-DD'))}
32+
minDate={this.date1MinDate || (this.date1MinDate = moment('2015-08-06', 'YYYY-MM-DD'))}
33+
maxDate={this.date1MaxDate || (this.date1MaxDate = moment('2016-12-06', 'YYYY-MM-DD'))}
3434
onChange={this.onChange}
3535
format={val => val.fromNow()}
3636
>

components/drawer/demo/basic.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class DrawerExample extends React.Component<any, any> {
5959
<Drawer
6060
sidebar={sidebar}
6161
{...drawerProps}
62-
ref={ d => { this.drawer = d; DrawerExample.drawer = d; } }
62+
ref={d => { this.drawer = d; DrawerExample.drawer = d; }}
6363
>
6464
<DefaultRenderer
6565
navigationState={this.props.navigationState.children[0]}
@@ -80,7 +80,7 @@ export class DrawerMain extends React.Component<any, any> {
8080
render() {
8181
return (
8282
<View style={{ flex: 1, marginTop: 114, padding: 8 }}>
83-
<Button onClick={() => this.drawer && this.drawer.openDrawer() }>打开 drawer</Button>
83+
<Button onClick={() => this.drawer && this.drawer.openDrawer()}>打开 drawer</Button>
8484
<WhiteSpace />
8585
<Button onClick={() => Actions.pop()}>返回 demo list</Button>
8686
</View>

components/drawer/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class Drawer extends React.Component<tsPropsType, any> {
2323
renderNavigationView={() => sidebar}
2424
drawerPosition={position}
2525
onDrawerOpen={() => onOpenChange(true)}
26-
onDrawerClose={() => onOpenChange(false) }
26+
onDrawerClose={() => onOpenChange(false)}
2727
{...restProps}
2828
>
2929
{children}

components/grid/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default class Grid extends React.Component<GridProps, any> {
8989
pageRows.push(
9090
<Flex key={rowIndex} style={[styles.grayBorderBox, { borderBottomWidth: hasLine ? 1 : 0 }]}>
9191
{res}
92-
</Flex>
92+
</Flex>,
9393
);
9494
}
9595
}
@@ -99,7 +99,7 @@ export default class Grid extends React.Component<GridProps, any> {
9999
style={[styles.grayBorderBox, { borderTopWidth: hasLine && pageIndex !== 0 ? 1 : 0 }]}
100100
>
101101
{pageRows}
102-
</View>
102+
</View>,
103103
);
104104
}
105105
}

components/image-picker/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default class ImagePicker extends React.Component<ImagePickerPropTypes, a
141141
);
142142
return (
143143
<View style={styles.container}>
144-
{ filesView }
144+
{filesView}
145145
<TouchableWithoutFeedback
146146
onPress={this.showPicker}
147147
onPressIn={this.onPressIn}
@@ -154,7 +154,7 @@ export default class ImagePicker extends React.Component<ImagePickerPropTypes, a
154154
<Text style={[styles.plusNormal, styles.plusText]}>+</Text>
155155
</View>
156156
</TouchableWithoutFeedback>
157-
{ this.state.visible ? imageRollEl : null }
157+
{this.state.visible ? imageRollEl : null}
158158
</View>
159159
);
160160
}

components/list-view/demo/basic-row.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class BasicRowDemo extends React.Component<any, any> {
4747
dataBlob[`${ii}`] = `row - ${ii}`;
4848
}
4949
return dataBlob;
50-
};
50+
}
5151

5252
onEndReached = (_event) => {
5353
// load new data

components/list-view/demo/basic.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class BasicDemo extends React.Component<any, any> {
6868
// new object ref
6969
this.sectionIDs = [].concat(this.sectionIDs);
7070
this.rowIDs = [].concat(this.rowIDs);
71-
};
71+
}
7272
onEndReached = (_event) => {
7373
// load new data
7474
this.setState({ isLoading: true });

components/list-view/handleProps.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ export default function handleProps(props, isIndexed) {
1616
};
1717
if (renderHeader) {
1818
extraProps.renderHeader =
19-
() => <div className={`${listPrefixCls}-header`}>{renderHeader() }</div>;
19+
() => <div className={`${listPrefixCls}-header`}>{renderHeader()}</div>;
2020
}
2121
if (renderFooter) {
2222
extraProps.renderFooter =
23-
() => <div className={`${listPrefixCls}-footer`}>{renderFooter() }</div>;
23+
() => <div className={`${listPrefixCls}-footer`}>{renderFooter()}</div>;
2424
}
2525
if (renderSectionHeader) {
2626
extraProps.renderSectionHeader = isIndexed ?
2727
(sectionData, sectionID) => (<div>
28-
<Item prefixCls={listPrefixCls}>{renderSectionHeader(sectionData, sectionID) }</Item>
28+
<Item prefixCls={listPrefixCls}>{renderSectionHeader(sectionData, sectionID)}</Item>
2929
</div>) :
3030
(sectionData, sectionID) => <Item prefixCls={listPrefixCls}>{renderSectionHeader(sectionData, sectionID)}</Item>;
3131
}

components/list/ListItem.web.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class ListItem extends React.Component<ListItemProps, any> {
128128
{extra !== undefined && <div className={`${prefixCls}-extra`}>{extra}</div>}
129129
{arrow && <div className={arrowCls} />}
130130
</div>
131-
{ isAndroid && <div style={coverRipleStyle} className={ripleCls} />}
131+
{isAndroid && <div style={coverRipleStyle} className={ripleCls} />}
132132
</div>;
133133

134134
return (

components/modal/alert.web.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function (...args) {
5353
maskTransitionName="am-fade"
5454
>
5555
<div style={{ zoom: 1, overflow: 'hidden' }}>{content}</div>
56-
</Modal>, div
56+
</Modal>, div,
5757
);
5858

5959
return {

components/modal/operation.web.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function (...args) {
4444
footer={footer}
4545
maskTransitionName="am-fade"
4646
className="am-modal-operation"
47-
/> , div
47+
/> , div,
4848
);
4949

5050
return {

components/modal/prompt.web.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default function (...args) {
142142
maskTransitionName="am-fade"
143143
>
144144
<div style={{ zoom: 1, overflow: 'hidden' }}>{content}</div>
145-
</Modal>, div
145+
</Modal>, div,
146146
);
147147

148148
return {

components/notice-bar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default class NoticeBar extends React.Component<NoticeBarProps, any> {
1010
icon: (
1111
<Image
1212
source={{ uri: 'https://zos.alipayobjects.com/rmsportal/UgviADRsIpznkjSEXWEaPTlKtPCMSlth.png' }}
13-
style={{ width: 14, height:12 }}
13+
style={{ width: 14, height: 12 }}
1414
/>
1515
),
1616
styles: NoticeStyle,

components/notice-bar/index.web.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default class NoticeBar extends React.Component<NoticeBarProps, any> {
6969

7070
return this.state.show ? (
7171
<div className={wrapCls} {...restProps} {...extraProps}>
72-
{ icon ? <div className={`${prefixCls}-icon`}> {icon} </div> : null }
72+
{icon ? <div className={`${prefixCls}-icon`}> {icon} </div> : null}
7373
<div className={`${prefixCls}-content`}>
7474
<Marquee prefixCls={prefixCls} text={children} {...marquee} />
7575
</div>

components/pagination/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class Pagination extends React.Component<PaginationProps, any> {
6868
{prevText}
6969
</Button>
7070
</Flex.Item>
71-
{ simpleItem }
71+
{simpleItem}
7272
<Flex.Item>
7373
<Button
7474
inline

components/pagination/index.web.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ export default class Pagination extends React.Component<PaginationProps, any> {
5555
{this.props.children ? (<Flex.Item>{this.props.children}</Flex.Item>) : (!simple &&
5656
<Flex.Item className={`${prefixCls}-wrap`}>
5757
<span className="active">{current + 1}</span>/<span>{total}</span>
58-
</Flex.Item>)
59-
}
58+
</Flex.Item>)}
6059
<Flex.Item className={`${prefixCls}-wrap-btn ${prefixCls}-wrap-btn-next`}>
6160
<Button
6261
inline

components/picker/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default class Picker extends React.Component<tsPropsType, any> {
6969
prefixCls={props.prefixCls}
7070
pickerPrefixCls={props.pickerPrefixCls}
7171
>
72-
{ props.data.map(d => { return { props: { children: d } }; }) }
72+
{props.data.map(d => { return { props: { children: d } }; })}
7373
</MultiPicker>
7474
);
7575
popupMoreProps = {

components/popup/demo/basic.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class PopupExample extends React.Component<any, any> {
1414
getPopupContent = (num) => {
1515
return (
1616
<View>
17-
<List renderHeader={() => '委托买入' }>
17+
<List renderHeader={() => '委托买入'}>
1818
<List.Item>股票名称</List.Item>
1919
<List.Item>股票代码</List.Item>
2020
<List.Item>买入价格</List.Item>

0 commit comments

Comments
 (0)