Commit 2885fa95 authored by afc163's avatar afc163

better jsx-wrap-multilines eslint rule

parent a8caa500
......@@ -20,6 +20,15 @@
"react/jsx-no-bind": [0],
"react/prop-types": [0],
"react/prefer-stateless-function": [0],
"react/jsx-wrap-multilines": ["error", {
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "parens-new-line",
"condition": "parens-new-line",
"logical": "parens-new-line",
"prop": "ignore"
}],
"no-else-return": [0],
"no-restricted-syntax": [0],
"import/no-extraneous-dependencies": [0],
......
......@@ -28,12 +28,11 @@ const Item = ({ src, size, tips, onClick = (() => {}) }) => {
return (
<li className={cls} onClick={onClick} >
{
tips ?
tips ? (
<Tooltip title={tips}>
<Avatar src={src} size={size} style={{ cursor: 'pointer' }} />
</Tooltip>
:
<Avatar src={src} size={size} />
) : <Avatar src={src} size={size} />
}
</li>
);
......
......@@ -25,7 +25,7 @@ export default class EditableItem extends PureComponent {
return (
<div className={styles.editableItem}>
{
editable ?
editable ? (
<div className={styles.wrapper}>
<Input
value={value}
......@@ -38,7 +38,7 @@ export default class EditableItem extends PureComponent {
onClick={this.check}
/>
</div>
:
) : (
<div className={styles.wrapper}>
<span>{value || ' '}</span>
<Icon
......@@ -47,6 +47,7 @@ export default class EditableItem extends PureComponent {
onClick={this.edit}
/>
</div>
)
}
</div>
);
......
......@@ -144,17 +144,18 @@ export default class PageHeader extends PureComponent {
</div>
{
tabList &&
tabList.length &&
<Tabs
className={styles.tabs}
defaultActiveKey={(tabDefaultValue && tabDefaultValue.key)}
activeKey={activeTabKey}
onChange={this.onChange}
>
{
tabList.map(item => <TabPane tab={item.tab} key={item.key} />)
}
</Tabs>
tabList.length && (
<Tabs
className={styles.tabs}
defaultActiveKey={(tabDefaultValue && tabDefaultValue.key)}
activeKey={activeTabKey}
onChange={this.onChange}
>
{
tabList.map(item => <TabPane tab={item.tab} key={item.key} />)
}
</Tabs>
)
}
</div>
);
......
......@@ -97,12 +97,11 @@ const popoverContent = (
</div>
);
const customDot = (dot, { status }) => (status === 'process' ?
const customDot = (dot, { status }) => (status === 'process' ? (
<Popover placement="topLeft" arrowPointAtCenter content={popoverContent}>
{dot}
</Popover>
: dot
);
) : dot);
const operationTabList = [{
key: 'tab1',
......
......@@ -95,7 +95,7 @@ export function digitUppercase(n) {
function getRelation(str1, str2) {
if (str1 === str2) {
console.warn('Two path are equal!');
console.warn('Two path are equal!'); // eslint-disable-line
}
const arr1 = str1.split('/');
const arr2 = str2.split('/');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment