Skip to content

Commit

Permalink
upgrade eslint-config-airbnb and fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Jul 21, 2016
1 parent 79184e7 commit a2e0f51
Show file tree
Hide file tree
Showing 97 changed files with 718 additions and 722 deletions.
11 changes: 4 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,19 @@ const eslintrc = {
'babel',
],
rules: {
'comma-dangle': 0,
'func-names': 0,
'prefer-const': 0,
'arrow-body-style': 0,
'react/sort-comp': 0,
'react/prop-types': 0,
'react/prefer-es6-class': 0,
'react/prefer-stateless-function': 0,
'react/jsx-closing-bracket-location': 0,
'react/jsx-first-prop-new-line': 0,
'no-param-reassign': 0,
'no-return-assign': 0,
'max-len': 0,
'react/jsx-no-bind': 0,
'react/no-multi-comp': 0,
'array-callback-return': 0,
'no-alert': 0,
'object-shorthand': 1
'import/no-unresolved': 0,
'jsx-a11y/img-has-alt': 0,
}
};

Expand All @@ -55,6 +51,7 @@ if (process.env.RUN_ENV === 'DEMO') {

Object.assign(eslintrc.rules, {
'no-console': 0,
'no-alert': 0,
'eol-last': 0,
'prefer-rest-params': 0,
'react/no-multi-comp': 0,
Expand Down
11 changes: 7 additions & 4 deletions components/action-sheet/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,24 @@ const Test = React.createClass({
icon: <img src="https://os.alipayobjects.com/rmsportal/zfQfLxUmXfgWech.png" style={{
height: 27,
verticalAlign: 'top',
}} />,
}}
/>,
title: '支付宝',
},
{
icon: <img src="https://os.alipayobjects.com/rmsportal/pTINxOHGLBxzEAG.png" style={{
height: 27,
verticalAlign: 'top',
}} />,
}}
/>,
title: '微信好友',
},
{
icon: <img src="https://os.alipayobjects.com/rmsportal/VMjNbIuafpXfjQE.png" style={{
height: 27,
verticalAlign: 'top',
}} />,
}}
/>,
title: 'QQ',
},
{ iconName: 'android', title: '用Android' },
Expand Down Expand Up @@ -107,7 +110,7 @@ const Test = React.createClass({
<Button type="primary" onClick={this.showActionSheetWithCustom}>显示</Button>
</WingBlank>
</div>);
}
},
});

ReactDOM.render(<Test />, mountNode);
Expand Down
2 changes: 1 addition & 1 deletion components/activity-indicator/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let App = React.createClass({
</div>
</div>
);
}
},
});

ReactDOM.render(<App />, mountNode);
Expand Down
5 changes: 2 additions & 3 deletions components/badge/demo/99plus.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import { Badge } from 'antm';
ReactDOM.render(
<div className="badge-container" style={{ padding: '40px 16px' }}>
<Badge text={99}>
<span className="head-example"></span>
<span className="head-example"></span>
</Badge>

<Badge text={108}>
<span className="head-example"></span>
<span className="head-example"></span>
</Badge>
</div>
, mountNode);
Expand Down
12 changes: 6 additions & 6 deletions components/badge/demo/all.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ ReactDOM.render(
文本内容<Badge dot style={{ marginLeft: 8 }} />
</List.Item>
<List.Item extra="内容内容" arrow="horizontal">
文本内容<Badge text={ 'new' } style={{ marginLeft: 8 }} />
文本内容<Badge text={'new'} style={{ marginLeft: 8 }} />
</List.Item>
<List.Item extra="内容内容" arrow="horizontal">
文本内容<Badge text={ 4 } style={{ marginLeft: 8 }} />
文本内容<Badge text={4} style={{ marginLeft: 8 }} />
</List.Item>
<List.Item extra="内容内容" arrow="horizontal">
文本内容<Badge text={ 100 } style={{ marginLeft: 8 }} />
文本内容<Badge text={100} style={{ marginLeft: 8 }} />
</List.Item>
</List.Body>
</List>
Expand All @@ -39,7 +39,7 @@ ReactDOM.render(
</Badge>小圆点
</div>
</List.Item>
<List.Item thumb="https://os.alipayobjects.com/rmsportal/JteFDJaPwHuwXgs.jpg" extra={ <Badge text={77} /> } arrow="horizontal">
<List.Item thumb="https://os.alipayobjects.com/rmsportal/JteFDJaPwHuwXgs.jpg" extra={<Badge text={77} />} arrow="horizontal">
右侧内容
</List.Item>
<List.Item thumb="https://os.alipayobjects.com/rmsportal/JteFDJaPwHuwXgs.jpg">
Expand All @@ -65,7 +65,7 @@ ReactDOM.render(
</List.Item>
<List.Item extra="内容内容" arrow="horizontal">
<div style={{ padding: '10px 0' }}>
<Badge text={ 108 }>
<Badge text={108}>
<span style={{ width: 52, height: 52, background: 'rgba(255, 140, 101, 0.15)', display: 'inline-block' }}></span>
</Badge>超出99
</div>
Expand All @@ -76,7 +76,7 @@ ReactDOM.render(
<List.Body>
<List.Item extra="内容内容" arrow="horizontal">
<div style={{ padding: '4px 0' }}>
<Badge text={ '限时优惠' } corner size="large">
<Badge text={'限时优惠'} corner size="large">
<span style={{ width: 72, height: 72, background: 'rgba(255, 140, 101, 0.15)', display: 'inline-block' }}></span>
</Badge>角标
</div>
Expand Down
7 changes: 2 additions & 5 deletions components/badge/demo/corner.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ import { Badge } from 'antm';

ReactDOM.render(
<div className="badge-container" style={{ padding: '40px 16px' }}>

<Badge text={'new'} corner>
<span className="head-example"></span>
<span className="head-example"></span>
</Badge>

<Badge text={'限时优惠'} corner size="large">
<span className="head-example head-example-l"></span>
<span className="head-example head-example-l"></span>
</Badge>

</div>
, mountNode);
````
Expand Down
14 changes: 9 additions & 5 deletions components/button/demo/basic.web.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ const ButtonExample = React.createClass({
<div className="button-container"
style={{ backgroundColor: this.state.dark ? 'black' : 'white' }}
>
<NavBar iconName={false} rightContent={<span
style={{ cursor: 'pointer' }}
onClick={this.switchDark}
>{this.state.dark ? '白天' : '夜间'}</span>}
<NavBar iconName={false} rightContent={(
<span
style={{ cursor: 'pointer' }}
onClick={this.switchDark}
>
{this.state.dark ? '白天' : '夜间'}
</span>
)}
>
类型/type
</NavBar>
Expand Down Expand Up @@ -63,7 +67,7 @@ const ButtonExample = React.createClass({
<WhiteSpace />
</div>
);
}
},
});

ReactDOM.render(<ButtonExample />, mountNode);
Expand Down
2 changes: 1 addition & 1 deletion components/button/demo/complex.web.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ReactDOM.render(
<div className="am-list-brief">可进行收款、退款、折扣管理、查看数据等操作</div>
</List.Item>
</List.Body>
</List>
</List>
</div>
, mountNode);
````
4 changes: 2 additions & 2 deletions components/button/demo/disabled.web.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const ButtonExample = React.createClass({
<NavBar iconName={false} rightContent={<span
style={{ cursor: 'pointer' }}
onClick={this.switchDark}
>{this.state.dark ? '白天' : '夜间'}</span>}
>{this.state.dark ? '白天' : '夜间'}</span>}
>
失效状态
</NavBar>
Expand All @@ -53,7 +53,7 @@ const ButtonExample = React.createClass({
<WhiteSpace />
</div>
);
}
},
});

ReactDOM.render(<ButtonExample />, mountNode);
Expand Down
4 changes: 2 additions & 2 deletions components/button/demo/ghost.web.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const ButtonExample = React.createClass({
<NavBar iconName={false} rightContent={<span
style={{ cursor: 'pointer' }}
onClick={this.switchDark}
>{this.state.dark ? '白天' : '夜间'}</span>}
>{this.state.dark ? '白天' : '夜间'}</span>}
>
幽灵模式/ghost
</NavBar>
Expand All @@ -52,7 +52,7 @@ const ButtonExample = React.createClass({
<WhiteSpace />
</div>
);
}
},
});

ReactDOM.render(<ButtonExample />, mountNode);
Expand Down
4 changes: 2 additions & 2 deletions components/button/demo/inline.web.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ButtonExample = React.createClass({
<NavBar iconName={false} rightContent={<span
style={{ cursor: 'pointer' }}
onClick={this.switchDark}
>{this.state.dark ? '白天' : '夜间'}</span>}
>{this.state.dark ? '白天' : '夜间'}</span>}
>
尺寸/行内
</NavBar>
Expand Down Expand Up @@ -61,7 +61,7 @@ const ButtonExample = React.createClass({
<WhiteSpace />
</div>
);
}
},
});

ReactDOM.render(<ButtonExample />, mountNode);
Expand Down
10 changes: 5 additions & 5 deletions components/checkbox/demo/agreeitem.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,36 @@ let Test = React.createClass({
<AgreeItem
{...getFieldProps('f5', {
initialValue: false,
valuePropName: 'checked'
valuePropName: 'checked',
})}
>同意同意同意同意同意同意同意同意同意同意同意同意同意同意同意同意同意同意同意同意同意
</AgreeItem>
<AgreeItem
{...getFieldProps('f6', {
initialValue: true,
valuePropName: 'checked'
valuePropName: 'checked',
})}
>同意<a>《信用支付服务合同》</a>
</AgreeItem>
<AgreeItem
disabled
{...getFieldProps('f7', {
initialValue: false,
valuePropName: 'checked'
valuePropName: 'checked',
})}
>未选中,不可编辑<a>《信用支付服务合同》</a>
</AgreeItem>
<AgreeItem
disabled
{...getFieldProps('f8', {
initialValue: true,
valuePropName: 'checked'
valuePropName: 'checked',
})}
>强制选中,不可编辑<a>《信用支付服务合同信用支付服务合同信用支付服务合同》</a>
</AgreeItem>
</div>
);
}
},
});

Test = createForm()(Test);
Expand Down
10 changes: 5 additions & 5 deletions components/checkbox/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,37 @@ let Test = React.createClass({
<Checkbox
{...getFieldProps('a0', {
initialValue: true,
valuePropName: 'checked'
valuePropName: 'checked',
})}
/>
<WhiteSpace />
<Checkbox
{...getFieldProps('a1', {
initialValue: false,
valuePropName: 'checked'
valuePropName: 'checked',
})}
/>
<WhiteSpace />
<Checkbox
disabled
{...getFieldProps('a2', {
initialValue: true,
valuePropName: 'checked'
valuePropName: 'checked',
})}
/>
<WhiteSpace />
<Checkbox
disabled
{...getFieldProps('a3', {
initialValue: false,
valuePropName: 'checked'
valuePropName: 'checked',
})}
/>
<WhiteSpace />
</WingBlank>
</div>
);
}
},
});

Test = createForm()(Test);
Expand Down
15 changes: 8 additions & 7 deletions components/checkbox/demo/checkboxitem.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ let Test = React.createClass({
const { getFieldProps } = this.props.form;
return (
<div>
<List >
<List>
<List.Header>表单多选项,普通列表中多选项</List.Header>
<List.Body>
<CheckboxItem
{...getFieldProps('f1', {
initialValue: true,
valuePropName: 'checked'
valuePropName: 'checked',
})}
>
使用 Ant Desgin Component
</CheckboxItem>
<CheckboxItem
{...getFieldProps('f2', {
initialValue: false,
valuePropName: 'checked'
valuePropName: 'checked',
})}
>
使用 Ant Desgin Component
Expand All @@ -41,7 +41,7 @@ let Test = React.createClass({
disabled
{...getFieldProps('f3', {
initialValue: false,
valuePropName: 'checked'
valuePropName: 'checked',
})}
>
未选中,不可编辑
Expand All @@ -50,15 +50,16 @@ let Test = React.createClass({
disabled
{...getFieldProps('f4', {
initialValue: true,
valuePropName: 'checked'
valuePropName: 'checked',
})}
>
强制选中,不可编辑
</CheckboxItem>
</List.Body>
</List>
</div>);
}
</div>
);
},
});

Test = createForm()(Test);
Expand Down
2 changes: 1 addition & 1 deletion components/collapse/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let Test = React.createClass({
<Collapse.Panel header="title2"><List.Item>this is panel content2 or other</List.Item></Collapse.Panel>
<Collapse.Panel header="title3"><List.Item>文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容文本内容</List.Item></Collapse.Panel>
</Collapse>);
}
},
});

ReactDOM.render(<Test />, mountNode);
Expand Down
Loading

0 comments on commit a2e0f51

Please sign in to comment.