Skip to content

Commit

Permalink
style: enable comma-dangle
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed May 11, 2016
1 parent 5077873 commit ecaa6c5
Show file tree
Hide file tree
Showing 115 changed files with 254 additions and 255 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const eslintrc = {
'babel',
],
rules: {
'comma-dangle': 0,
'func-names': 0,
'prefer-const': 0,
'arrow-body-style': 0,
Expand Down
8 changes: 4 additions & 4 deletions components/alert/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class Alert extends React.Component {
super(props);
this.state = {
closing: true,
closed: false
closed: false,
};
}
handleClose = (e) => {
Expand All @@ -27,19 +27,19 @@ export default class Alert extends React.Component {
dom.style.height = `${dom.offsetHeight}px`;

this.setState({
closing: false
closing: false,
});
this.props.onClose.call(this, e);
}
animationEnd = () => {
this.setState({
closed: true,
closing: true
closing: true,
});
}
render() {
let {
closable, description, type, prefixCls, message, closeText, showIcon
closable, description, type, prefixCls, message, closeText, showIcon,
} = this.props;

let iconType = '';
Expand Down
6 changes: 3 additions & 3 deletions components/badge/ScrollNumber.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class ScrollNumber extends React.Component {
static propTypes = {
count: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
React.PropTypes.number,
]),
component: React.PropTypes.string,
onAnimated: React.PropTypes.func,
Expand All @@ -33,7 +33,7 @@ export default class ScrollNumber extends React.Component {
super(props);
this.state = {
animateStarted: true,
count: props.count
count: props.count,
};
}

Expand Down Expand Up @@ -124,7 +124,7 @@ export default class ScrollNumber extends React.Component {
render() {
const props = {
...this.props,
className: `${this.props.prefixCls} ${this.props.className}`
className: `${this.props.prefixCls} ${this.props.className}`,
};
return createElement(
this.props.component,
Expand Down
2 changes: 1 addition & 1 deletion components/badge/demo/change.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Test = React.createClass({
</div>
</div>
);
}
},
});

ReactDOM.render(
Expand Down
2 changes: 1 addition & 1 deletion components/badge/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class Badge extends React.Component {
static propTypes = {
count: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
React.PropTypes.number,
]),
dot: React.PropTypes.bool,
overflowCount: React.PropTypes.number,
Expand Down
2 changes: 1 addition & 1 deletion components/breadcrumb/demo/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Home(props) {
marginBottom: 15,
marginTop: 15,
paddingBottom: 15,
borderBottom: '1px dashed #ccc'
borderBottom: '1px dashed #ccc',
}}>
点击上面的导航切换页面,面包屑在下面:
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/button/button-group.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function ButtonGroup(props) {
const classes = classNames({
'ant-btn-group': true,
[prefix + sizeCls]: sizeCls,
[className]: className
[className]: className,
});

return <div {...others} className={classes} />;
Expand Down
2 changes: 1 addition & 1 deletion components/button/demo/loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const App = React.createClass({
</Button>
</div>
);
}
},
});

ReactDOM.render(<App />, mountNode);
Expand Down
6 changes: 3 additions & 3 deletions components/calendar/demo/notice-calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ function getListData(value) {
case 8:
listData = [
{ type: 'warning', content: '这里是警告事项.' },
{ type: 'normal', content: '这里是普通事项.' }
{ type: 'normal', content: '这里是普通事项.' },
]; break;
case 10:
listData = [
{ type: 'warning', content: '这里是警告事项.' },
{ type: 'normal', content: '这里是普通事项.' },
{ type: 'error', content: '这里是错误事项.' }
{ type: 'error', content: '这里是错误事项.' },
]; break;
case 15:
listData = [
Expand All @@ -29,7 +29,7 @@ function getListData(value) {
{ type: 'error', content: '这里是错误事项.' },
{ type: 'error', content: '这里是错误事项.' },
{ type: 'error', content: '这里是错误事项.' },
{ type: 'error', content: '这里是错误事项.' }
{ type: 'error', content: '这里是错误事项.' },
]; break;
default:
}
Expand Down
2 changes: 1 addition & 1 deletion components/calendar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class Calendar extends React.Component {
componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
this.setState({
value: this.parseDateFromValue(nextProps.value)
value: this.parseDateFromValue(nextProps.value),
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions components/checkbox/demo/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const App = React.createClass({
getInitialState() {
return {
checked: true,
disabled: false
disabled: false,
};
},
render() {
Expand Down Expand Up @@ -51,7 +51,7 @@ const App = React.createClass({
this.setState({
checked: e.target.checked,
});
}
},
});

ReactDOM.render(<App />, mountNode);
Expand Down
2 changes: 1 addition & 1 deletion components/checkbox/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import classNames from 'classnames';
export default class Checkbox extends React.Component {
static Group = CheckboxGroup;
static defaultProps = {
prefixCls: 'ant-checkbox'
prefixCls: 'ant-checkbox',
}
render() {
const { prefixCls, style, children, className, ...restProps } = this.props;
Expand Down
6 changes: 3 additions & 3 deletions components/date-picker/RangePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default class RangePicker extends React.Component {
this.state = {
value: [
parseDateFromValue(start),
parseDateFromValue(end)
]
parseDateFromValue(end),
],
};
}

Expand All @@ -28,7 +28,7 @@ export default class RangePicker extends React.Component {
const start = nextProps.parseDateFromValue(value[0]);
const end = nextProps.parseDateFromValue(value[1]);
this.setState({
value: [start, end]
value: [start, end],
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/date-picker/createPicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function createPicker(TheCalendar) {
componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
this.setState({
value: nextProps.parseDateFromValue(nextProps.value)
value: nextProps.parseDateFromValue(nextProps.value),
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions components/date-picker/demo/start-end.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const DateRange = React.createClass({
getInitialState() {
return {
startValue: null,
endValue: null
endValue: null,
};
},
disabledStartDate(startValue) {
Expand Down Expand Up @@ -52,7 +52,7 @@ const DateRange = React.createClass({
onChange={this.onEndChange} />
</div>
);
}
},
});

ReactDOM.render(
Expand Down
2 changes: 1 addition & 1 deletion components/date-picker/demo/with-time-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const DateTimePicker = React.createClass({
<TimePicker onChange={this.handleTimeChange} />
</div>
);
}
},
});

function onSelect(value) {
Expand Down
8 changes: 4 additions & 4 deletions components/date-picker/wrapPicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function wrapPicker(Picker, defaultFormat) {
align: {
offset: [0, -9],
},
open: false
open: false,
}

static contextTypes = {
Expand Down Expand Up @@ -67,7 +67,7 @@ export default function wrapPicker(Picker, defaultFormat) {

toggleOpen = (e) => {
this.setState({
open: e.open
open: e.open,
});
}

Expand All @@ -76,7 +76,7 @@ export default function wrapPicker(Picker, defaultFormat) {
const state = this.state;
const pickerClass = classNames({
'ant-calendar-picker': true,
'ant-calendar-picker-open': state.open
'ant-calendar-picker-open': state.open,
});
const pickerInputClass = classNames({
'ant-calendar-range-picker': true,
Expand All @@ -91,7 +91,7 @@ export default function wrapPicker(Picker, defaultFormat) {
const rcTimePickerProps = {
formatter: new DateTimeFormat(timeFormat || 'HH:mm:ss'),
showSecond: timeFormat && timeFormat.indexOf('ss') >= 0,
showHour: timeFormat && timeFormat.indexOf('HH') >= 0
showHour: timeFormat && timeFormat.indexOf('HH') >= 0,
};
const timePicker = props.showTime ? (
<TimePicker
Expand Down
4 changes: 2 additions & 2 deletions components/dropdown/demo/overlay-visible.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Menu, Dropdown, Icon } from 'antd';
const OverlayVisible = React.createClass({
getInitialState() {
return {
visible: false
visible: false,
};
},
handleMenuClick(e) {
Expand Down Expand Up @@ -39,7 +39,7 @@ const OverlayVisible = React.createClass({
</a>
</Dropdown>
);
}
},
});

ReactDOM.render(<OverlayVisible />, mountNode);
Expand Down
2 changes: 1 addition & 1 deletion components/form/demo/form-in-modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ let Demo = React.createClass({
</Modal>
</div>
);
}
},
});

Demo = createForm()(Demo);
Expand Down
2 changes: 1 addition & 1 deletion components/form/demo/horizontal-form.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ let Demo = React.createClass({
</FormItem>
</Form>
);
}
},
});

Demo = Form.create()(Demo);
Expand Down
2 changes: 1 addition & 1 deletion components/form/demo/inline-form.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let Demo = React.createClass({
<Button type="primary" htmlType="submit">登录</Button>
</Form>
);
}
},
});

Demo = Form.create()(Demo);
Expand Down
4 changes: 2 additions & 2 deletions components/form/demo/mix.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ let Demo = React.createClass({
<Upload name="logo" action="/upload.do" listType="picture" onChange={this.handleUpload}
{...getFieldProps('upload', {
valuePropName: 'fileList',
normalize: this.normFile
normalize: this.normFile,
})}
>
<Button type="ghost">
Expand All @@ -156,7 +156,7 @@ let Demo = React.createClass({
</FormItem>
</Form>
);
}
},
});

Demo = Form.create()(Demo);
Expand Down
2 changes: 1 addition & 1 deletion components/form/demo/search-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const SearchInput = React.createClass({
</div>
</InputGroup>
);
}
},
});

ReactDOM.render(
Expand Down
2 changes: 1 addition & 1 deletion components/form/demo/validate-basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ let BasicDemo = React.createClass({
{ type: 'email', message: '请输入正确的邮箱地址' },
],
trigger: ['onBlur', 'onChange'],
}]
}],
});
const passwdProps = getFieldProps('passwd', {
rules: [
Expand Down
8 changes: 4 additions & 4 deletions components/form/demo/validate-customized.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ let Demo = React.createClass({
'ant-pwd-strength': true,
'ant-pwd-strength-low': strength === 'L',
'ant-pwd-strength-medium': strength === 'M',
'ant-pwd-strength-high': strength === 'H'
'ant-pwd-strength-high': strength === 'H',
});
const level = {
L: '',
M: '',
H: ''
H: '',
};

return (
Expand All @@ -119,7 +119,7 @@ let Demo = React.createClass({
const passProps = getFieldProps('pass', {
rules: [
{ required: true, whitespace: true, message: '请填写密码' },
{ validator: this.checkPass }
{ validator: this.checkPass },
],
onChange: (e) => {
console.log('你的密码就是这样被盗的:', e.target.value);
Expand Down Expand Up @@ -182,7 +182,7 @@ let Demo = React.createClass({
</Form>
</div>
);
}
},
});

Demo = createForm()(Demo);
Expand Down
Loading

0 comments on commit ecaa6c5

Please sign in to comment.