From 68b51e298d37dfa3fc3d8bc8e2da671c28c88eb1 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Wed, 27 Jan 2016 16:53:05 +0800 Subject: [PATCH] style: update code style for space-before-function-paren --- .eslintrc | 1 - components/alert/demo/closable.md | 2 +- components/date-picker/demo/disabled-date.md | 2 +- components/dropdown/demo/event.md | 2 +- components/message/demo/duration.md | 2 +- components/message/demo/info.md | 2 +- components/message/demo/loading.md | 2 +- components/message/demo/other.md | 6 +++--- components/modal/demo/confirm.md | 4 ++-- components/modal/demo/footer.md | 2 +- components/modal/demo/info.md | 2 +- components/notification/demo/basic.md | 2 +- components/notification/demo/duration.md | 2 +- components/notification/demo/onclose.md | 4 ++-- components/notification/demo/with-btn.md | 6 +++--- components/notification/demo/with-icon.md | 4 ++-- components/table/demo/basic.md | 4 ++-- components/table/demo/bordered.md | 2 +- components/table/demo/colspan-rowspan.md | 6 +++--- components/table/demo/head.md | 10 +++++----- components/table/demo/paging.md | 6 +++--- components/table/demo/row-selection-props.md | 8 ++++---- components/table/demo/row-selection.md | 6 +++--- components/upload/demo/beforeUpload.md | 2 +- 24 files changed, 44 insertions(+), 45 deletions(-) diff --git a/.eslintrc b/.eslintrc index dc84cb2f82..0019ae3401 100644 --- a/.eslintrc +++ b/.eslintrc @@ -28,7 +28,6 @@ "react/prefer-es6-class": 0, "react/jsx-closing-bracket-location": 0, "react/jsx-no-bind": 0, - "space-before-function-paren": 0, "no-param-reassign": 0, "max-len": 0, "object-shorthand": 0, diff --git a/components/alert/demo/closable.md b/components/alert/demo/closable.md index 26ecf34f4d..3046e198e8 100644 --- a/components/alert/demo/closable.md +++ b/components/alert/demo/closable.md @@ -9,7 +9,7 @@ ````jsx import { Alert } from 'antd'; -const onClose = function(e) { +const onClose = function (e) { console.log(e, '我要被关闭啦!'); }; diff --git a/components/date-picker/demo/disabled-date.md b/components/date-picker/demo/disabled-date.md index b45961b29b..56d24bd692 100644 --- a/components/date-picker/demo/disabled-date.md +++ b/components/date-picker/demo/disabled-date.md @@ -11,7 +11,7 @@ ````jsx import { DatePicker } from 'antd'; -const disabledDate = function(current) { +const disabledDate = function (current) { // can not select days after today return current && current.getTime() > Date.now(); }; diff --git a/components/dropdown/demo/event.md b/components/dropdown/demo/event.md index 5e43d03ada..9cfec951fb 100644 --- a/components/dropdown/demo/event.md +++ b/components/dropdown/demo/event.md @@ -8,7 +8,7 @@ ````jsx import { Menu, Dropdown, Icon } from 'antd'; -const onClick = function({ key }) { +const onClick = function ({ key }) { console.log('点击了菜单' + key); }; diff --git a/components/message/demo/duration.md b/components/message/demo/duration.md index fd460a8766..b6e1ec7f1d 100644 --- a/components/message/demo/duration.md +++ b/components/message/demo/duration.md @@ -9,7 +9,7 @@ ````jsx import { message, Button } from 'antd'; -const success = function() { +const success = function () { message.success('这是一条成功的提示,并将于10秒后消失', 10); }; diff --git a/components/message/demo/info.md b/components/message/demo/info.md index 079a40298c..432b8bb517 100644 --- a/components/message/demo/info.md +++ b/components/message/demo/info.md @@ -9,7 +9,7 @@ ````jsx import { message, Button } from 'antd'; -const info = function() { +const info = function () { message.info('这是一条普通的提醒'); }; diff --git a/components/message/demo/loading.md b/components/message/demo/loading.md index f30e1d6ac4..b3b9ffa9bb 100644 --- a/components/message/demo/loading.md +++ b/components/message/demo/loading.md @@ -9,7 +9,7 @@ ````jsx import { message, Button } from 'antd'; -const success = function() { +const success = function () { let hide = message.loading('正在执行中...', 0); // 异步手动移除 setTimeout(hide, 2500); diff --git a/components/message/demo/other.md b/components/message/demo/other.md index 92ac41e5c6..98fd8526b1 100644 --- a/components/message/demo/other.md +++ b/components/message/demo/other.md @@ -9,15 +9,15 @@ ````jsx import { message, Button } from 'antd'; -const success = function() { +const success = function () { message.success('这是一条成功提示'); }; -const error = function() { +const error = function () { message.error('这是一条报错提示'); }; -const warn = function() { +const warn = function () { message.warn('这是一条警告提示'); }; diff --git a/components/modal/demo/confirm.md b/components/modal/demo/confirm.md index 6f337c8ed0..cb86dcc1ef 100644 --- a/components/modal/demo/confirm.md +++ b/components/modal/demo/confirm.md @@ -14,10 +14,10 @@ function showConfirm() { confirm({ title: '您是否确认要删除这项内容', content: '一些解释', - onOk: function() { + onOk: function () { console.log('确定'); }, - onCancel: function() {} + onCancel: function () {} }); } diff --git a/components/modal/demo/footer.md b/components/modal/demo/footer.md index eb79bb0f69..d43edcbcc4 100644 --- a/components/modal/demo/footer.md +++ b/components/modal/demo/footer.md @@ -10,7 +10,7 @@ import { Modal, Button } from 'antd'; const Test = React.createClass({ - getInitialState: function() { + getInitialState: function () { return { loading: false, visible: false diff --git a/components/modal/demo/info.md b/components/modal/demo/info.md index e623cdb42d..bde3aa0ebf 100644 --- a/components/modal/demo/info.md +++ b/components/modal/demo/info.md @@ -13,7 +13,7 @@ function info() { Modal.info({ title: '这是一条通知信息', content: '一些附加信息一些附加信息一些附加信息', - onOk: function() {} + onOk: function () {} }); } diff --git a/components/notification/demo/basic.md b/components/notification/demo/basic.md index 8c92fd2438..90ed7fb78f 100644 --- a/components/notification/demo/basic.md +++ b/components/notification/demo/basic.md @@ -9,7 +9,7 @@ ````jsx import { Button, notification } from 'antd'; -const openNotification = function() { +const openNotification = function () { notification.open({ message: '这是标题', description: '这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案这是提示框的文案' diff --git a/components/notification/demo/duration.md b/components/notification/demo/duration.md index b8c5a04e8b..6c999a4ddf 100644 --- a/components/notification/demo/duration.md +++ b/components/notification/demo/duration.md @@ -9,7 +9,7 @@ ````jsx import { Button, notification } from 'antd'; -const openNotification = function() { +const openNotification = function () { const args = { message: '这是标题', description: '我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭,我不会自动关闭', diff --git a/components/notification/demo/onclose.md b/components/notification/demo/onclose.md index efd61e2618..9f887d6c98 100644 --- a/components/notification/demo/onclose.md +++ b/components/notification/demo/onclose.md @@ -9,11 +9,11 @@ ````jsx import { Button, notification } from 'antd'; -const close = function() { +const close = function () { console.log('我被默认的关闭按钮关闭了!'); }; -const openNotification = function() { +const openNotification = function () { const args = { message: '这是标题', description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案', diff --git a/components/notification/demo/with-btn.md b/components/notification/demo/with-btn.md index ff058b7d5d..f9473aa96c 100644 --- a/components/notification/demo/with-btn.md +++ b/components/notification/demo/with-btn.md @@ -9,13 +9,13 @@ ````jsx import { Button, notification } from 'antd'; -const close = function() { +const close = function () { console.log('我被默认的关闭按钮关闭了!'); }; -const openNotification = function() { +const openNotification = function () { const key = 'open' + Date.now(); - const btnClick = function() { + const btnClick = function () { // 隐藏提醒框 notification.close(key); }; diff --git a/components/notification/demo/with-icon.md b/components/notification/demo/with-icon.md index 6ee55f306a..812848aee8 100644 --- a/components/notification/demo/with-icon.md +++ b/components/notification/demo/with-icon.md @@ -9,8 +9,8 @@ ````jsx import { Button, notification } from 'antd'; -const openNotificationWithIcon = function(type) { - return function() { +const openNotificationWithIcon = function (type) { + return function () { notification[type]({ message: '这是标题', description: '这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案' diff --git a/components/table/demo/basic.md b/components/table/demo/basic.md index 4653baa427..8f091fbb63 100644 --- a/components/table/demo/basic.md +++ b/components/table/demo/basic.md @@ -13,7 +13,7 @@ const columns = [{ title: '姓名', dataIndex: 'name', key: 'name', - render: function(text) { + render: function (text) { return {text}; } }, { @@ -27,7 +27,7 @@ const columns = [{ }, { title: '操作', key: 'operation', - render: function(text, record) { + render: function (text, record) { return ( 操作一{record.name} diff --git a/components/table/demo/bordered.md b/components/table/demo/bordered.md index 20a336058f..e3d5be06e1 100644 --- a/components/table/demo/bordered.md +++ b/components/table/demo/bordered.md @@ -12,7 +12,7 @@ import { Table } from 'antd'; const columns = [{ title: '姓名', dataIndex: 'name', - render: function(text) { + render: function (text) { return {text}; } }, { diff --git a/components/table/demo/colspan-rowspan.md b/components/table/demo/colspan-rowspan.md index 8165d85833..f8e3366857 100644 --- a/components/table/demo/colspan-rowspan.md +++ b/components/table/demo/colspan-rowspan.md @@ -13,7 +13,7 @@ import { Table } from 'antd'; // 事例表中第四行合并了五列,除了第一列设置 colSpan = 5 外 // 其他列的第四行 colSpan = 0 (被合并掉,不会渲染) -const renderContent = function(value, row, index) { +const renderContent = function (value, row, index) { let obj = { children: value, props: {} @@ -27,7 +27,7 @@ const renderContent = function(value, row, index) { const columns = [{ title: '姓名', dataIndex: 'name', - render: function(text, row, index) { + render: function (text, row, index) { if (index < 4) { return {text}; } @@ -46,7 +46,7 @@ const columns = [{ title: '家庭电话', colSpan: 2, dataIndex: 'tel', - render: function(value, row, index) { + render: function (value, row, index) { let obj = { children: value, props: {} diff --git a/components/table/demo/head.md b/components/table/demo/head.md index cf77bf0cd0..a0bc8e7c5c 100644 --- a/components/table/demo/head.md +++ b/components/table/demo/head.md @@ -33,16 +33,16 @@ const columns = [{ }], // 指定确定筛选的条件函数 // 这里是名字中第一个字是 value - onFilter: function(value, record) { + onFilter: function (value, record) { return record.name.indexOf(value) === 0; }, - sorter: function(a, b) { + sorter: function (a, b) { return a.name.length - b.name.length; } }, { title: '年龄', dataIndex: 'age', - sorter: function(a, b) { + sorter: function (a, b) { return a.age - b.age; } }, { @@ -56,10 +56,10 @@ const columns = [{ value: '西湖' }], filterMultiple: false, - onFilter: function(value, record) { + onFilter: function (value, record) { return record.address.indexOf(value) === 0; }, - sorter: function(a, b) { + sorter: function (a, b) { return a.address.length - b.address.length; } }]; diff --git a/components/table/demo/paging.md b/components/table/demo/paging.md index 2459cae6d9..5eeaae80e3 100644 --- a/components/table/demo/paging.md +++ b/components/table/demo/paging.md @@ -12,7 +12,7 @@ import { Table } from 'antd'; const columns = [{ title: '姓名', dataIndex: 'name', - render: function(text) { + render: function (text) { return {text}; } }, { @@ -37,10 +37,10 @@ const pagination = { total: data.length, current: 1, showSizeChanger: true, - onShowSizeChange: function(current, pageSize) { + onShowSizeChange: function (current, pageSize) { console.log('Current: ', current, '; PageSize: ', pageSize); }, - onChange: function(current) { + onChange: function (current) { console.log('Current: ', current); } }; diff --git a/components/table/demo/row-selection-props.md b/components/table/demo/row-selection-props.md index e21d7b4438..30dc55dd55 100644 --- a/components/table/demo/row-selection-props.md +++ b/components/table/demo/row-selection-props.md @@ -12,7 +12,7 @@ import { Table } from 'antd'; const columns = [{ title: '姓名', dataIndex: 'name', - render: function(text) { + render: function (text) { return {text}; } }, { @@ -41,7 +41,7 @@ const data = [{ // 通过 rowSelection 对象表明需要行选择 const rowSelection = { - getCheckboxProps: function(record) { + getCheckboxProps: function (record) { return { defaultChecked: record.name === '李大嘴', // 配置默认勾选的列 disabled: record.name === '胡彦祖' // 配置无法勾选的列 @@ -50,10 +50,10 @@ const rowSelection = { onChange(selectedRowKeys) { console.log('selectedRowKeys changed: ' + selectedRowKeys); }, - onSelect: function(record, selected, selectedRows) { + onSelect: function (record, selected, selectedRows) { console.log(record, selected, selectedRows); }, - onSelectAll: function(selected, selectedRows) { + onSelectAll: function (selected, selectedRows) { console.log(selected, selectedRows); }, }; diff --git a/components/table/demo/row-selection.md b/components/table/demo/row-selection.md index 980f4bd019..df08ed6025 100644 --- a/components/table/demo/row-selection.md +++ b/components/table/demo/row-selection.md @@ -12,7 +12,7 @@ import { Table } from 'antd'; const columns = [{ title: '姓名', dataIndex: 'name', - render: function(text) { + render: function (text) { return {text}; } }, { @@ -44,10 +44,10 @@ const rowSelection = { onChange(selectedRowKeys) { console.log('selectedRowKeys changed: ' + selectedRowKeys); }, - onSelect: function(record, selected, selectedRows) { + onSelect: function (record, selected, selectedRows) { console.log(record, selected, selectedRows); }, - onSelectAll: function(selected, selectedRows) { + onSelectAll: function (selected, selectedRows) { console.log(selected, selectedRows); } }; diff --git a/components/upload/demo/beforeUpload.md b/components/upload/demo/beforeUpload.md index 204a70b5d4..8d80f71274 100644 --- a/components/upload/demo/beforeUpload.md +++ b/components/upload/demo/beforeUpload.md @@ -11,7 +11,7 @@ import { Upload, Button, Icon, message } from 'antd'; const props = { action: '/upload.do', - beforeUpload: function(file) { + beforeUpload: function (file) { const isJPG = file.type === 'image/jpeg'; if (!isJPG) { message.error('只能上传 JPG 文件哦!');