Commit 2885fa95 authored by afc163's avatar afc163

better jsx-wrap-multilines eslint rule

parent a8caa500
...@@ -20,6 +20,15 @@ ...@@ -20,6 +20,15 @@
"react/jsx-no-bind": [0], "react/jsx-no-bind": [0],
"react/prop-types": [0], "react/prop-types": [0],
"react/prefer-stateless-function": [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-else-return": [0],
"no-restricted-syntax": [0], "no-restricted-syntax": [0],
"import/no-extraneous-dependencies": [0], "import/no-extraneous-dependencies": [0],
......
...@@ -28,12 +28,11 @@ const Item = ({ src, size, tips, onClick = (() => {}) }) => { ...@@ -28,12 +28,11 @@ const Item = ({ src, size, tips, onClick = (() => {}) }) => {
return ( return (
<li className={cls} onClick={onClick} > <li className={cls} onClick={onClick} >
{ {
tips ? tips ? (
<Tooltip title={tips}> <Tooltip title={tips}>
<Avatar src={src} size={size} style={{ cursor: 'pointer' }} /> <Avatar src={src} size={size} style={{ cursor: 'pointer' }} />
</Tooltip> </Tooltip>
: ) : <Avatar src={src} size={size} />
<Avatar src={src} size={size} />
} }
</li> </li>
); );
......
...@@ -25,7 +25,7 @@ export default class EditableItem extends PureComponent { ...@@ -25,7 +25,7 @@ export default class EditableItem extends PureComponent {
return ( return (
<div className={styles.editableItem}> <div className={styles.editableItem}>
{ {
editable ? editable ? (
<div className={styles.wrapper}> <div className={styles.wrapper}>
<Input <Input
value={value} value={value}
...@@ -38,7 +38,7 @@ export default class EditableItem extends PureComponent { ...@@ -38,7 +38,7 @@ export default class EditableItem extends PureComponent {
onClick={this.check} onClick={this.check}
/> />
</div> </div>
: ) : (
<div className={styles.wrapper}> <div className={styles.wrapper}>
<span>{value || ' '}</span> <span>{value || ' '}</span>
<Icon <Icon
...@@ -47,6 +47,7 @@ export default class EditableItem extends PureComponent { ...@@ -47,6 +47,7 @@ export default class EditableItem extends PureComponent {
onClick={this.edit} onClick={this.edit}
/> />
</div> </div>
)
} }
</div> </div>
); );
......
...@@ -144,17 +144,18 @@ export default class PageHeader extends PureComponent { ...@@ -144,17 +144,18 @@ export default class PageHeader extends PureComponent {
</div> </div>
{ {
tabList && tabList &&
tabList.length && tabList.length && (
<Tabs <Tabs
className={styles.tabs} className={styles.tabs}
defaultActiveKey={(tabDefaultValue && tabDefaultValue.key)} defaultActiveKey={(tabDefaultValue && tabDefaultValue.key)}
activeKey={activeTabKey} activeKey={activeTabKey}
onChange={this.onChange} onChange={this.onChange}
> >
{ {
tabList.map(item => <TabPane tab={item.tab} key={item.key} />) tabList.map(item => <TabPane tab={item.tab} key={item.key} />)
} }
</Tabs> </Tabs>
)
} }
</div> </div>
); );
......
...@@ -97,12 +97,11 @@ const popoverContent = ( ...@@ -97,12 +97,11 @@ const popoverContent = (
</div> </div>
); );
const customDot = (dot, { status }) => (status === 'process' ? const customDot = (dot, { status }) => (status === 'process' ? (
<Popover placement="topLeft" arrowPointAtCenter content={popoverContent}> <Popover placement="topLeft" arrowPointAtCenter content={popoverContent}>
{dot} {dot}
</Popover> </Popover>
: dot ) : dot);
);
const operationTabList = [{ const operationTabList = [{
key: 'tab1', key: 'tab1',
......
...@@ -95,7 +95,7 @@ export function digitUppercase(n) { ...@@ -95,7 +95,7 @@ export function digitUppercase(n) {
function getRelation(str1, str2) { function getRelation(str1, str2) {
if (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 arr1 = str1.split('/');
const arr2 = str2.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