mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
upgrade eslint-config-airbnb version and fix some problems
This commit is contained in:
parent
ce123137e3
commit
03cb74ead5
@ -30,6 +30,8 @@ const eslintrc = {
|
||||
'react/sort-comp': 0,
|
||||
'react/prop-types': 0,
|
||||
'react/jsx-closing-bracket-location': 0,
|
||||
'react/jsx-first-prop-new-line': 0,
|
||||
'import/no-unresolved': 0,
|
||||
'no-param-reassign': 0,
|
||||
'no-return-assign': 0,
|
||||
'max-len': 0,
|
||||
|
@ -59,8 +59,7 @@ ReactDOM.render(<div>
|
||||
<Button type="ghost">小</Button>
|
||||
<Button type="ghost">小</Button>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
, mountNode);
|
||||
</div>, mountNode);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -28,7 +28,7 @@ export default class FormItem extends React.Component {
|
||||
form: React.PropTypes.object,
|
||||
}
|
||||
|
||||
_getLayoutClass(colDef) {
|
||||
getLayoutClass(colDef) {
|
||||
if (!colDef) {
|
||||
return '';
|
||||
}
|
||||
@ -132,7 +132,7 @@ export default class FormItem extends React.Component {
|
||||
renderWrapper(children) {
|
||||
const wrapperCol = this.props.wrapperCol;
|
||||
return (
|
||||
<div className={this._getLayoutClass(wrapperCol)} key="wrapper">
|
||||
<div className={this.getLayoutClass(wrapperCol)} key="wrapper">
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@ -158,7 +158,7 @@ export default class FormItem extends React.Component {
|
||||
props.required;
|
||||
|
||||
const className = classNames({
|
||||
[this._getLayoutClass(labelCol)]: true,
|
||||
[this.getLayoutClass(labelCol)]: true,
|
||||
[`${props.prefixCls}-item-required`]: required,
|
||||
});
|
||||
|
||||
|
@ -1,8 +1,13 @@
|
||||
import Pagination from 'rc-pagination/lib/locale/en_US';
|
||||
import DatePicker from '../date-picker/locale/en_US';
|
||||
import TimePicker from '../time-picker/locale/en_US';
|
||||
import Calendar from '../calendar/locale/en_US';
|
||||
|
||||
export default {
|
||||
Pagination: require('rc-pagination/lib/locale/en_US'),
|
||||
DatePicker: require('../date-picker/locale/en_US'),
|
||||
TimePicker: require('../time-picker/locale/en_US'),
|
||||
Calendar: require('../calendar/locale/en_US'),
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Table: {
|
||||
filterTitle: 'Filter Menu',
|
||||
filterConfirm: 'OK',
|
||||
|
@ -2,11 +2,16 @@
|
||||
* Created by Andrey Gayvoronsky on 13/04/16.
|
||||
*/
|
||||
|
||||
import Pagination from 'rc-pagination/lib/locale/ru_RU';
|
||||
import DatePicker from '../date-picker/locale/ru_RU';
|
||||
import TimePicker from '../time-picker/locale/ru_RU';
|
||||
import Calendar from '../calendar/locale/ru_RU';
|
||||
|
||||
export default {
|
||||
Pagination: require('rc-pagination/lib/locale/ru_RU'),
|
||||
DatePicker: require('../date-picker/locale/ru_RU'),
|
||||
TimePicker: require('../time-picker/locale/ru_RU'),
|
||||
Calendar: require('../calendar/locale/ru_RU'),
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Table: {
|
||||
filterTitle: 'Фильтр',
|
||||
filterConfirm: 'OK',
|
||||
@ -29,4 +34,3 @@ export default {
|
||||
itemsUnit: 'items',
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -25,5 +25,6 @@ function showConfirm() {
|
||||
ReactDOM.render(
|
||||
<Button onClick={showConfirm}>
|
||||
确认对话框
|
||||
</Button>, mountNode);
|
||||
</Button>
|
||||
, mountNode);
|
||||
````
|
||||
|
@ -23,5 +23,6 @@ function showConfirm() {
|
||||
ReactDOM.render(
|
||||
<Button onClick={showConfirm}>
|
||||
确认对话框
|
||||
</Button>, mountNode);
|
||||
</Button>
|
||||
, mountNode);
|
||||
````
|
||||
|
@ -8,7 +8,7 @@ title: 受控
|
||||
````jsx
|
||||
import { Pagination } from 'antd';
|
||||
|
||||
let Container = React.createClass({
|
||||
const Container = React.createClass({
|
||||
getInitialState() {
|
||||
return {
|
||||
current: 3
|
||||
@ -25,8 +25,5 @@ let Container = React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
ReactDOM.render(
|
||||
<Container />,
|
||||
mountNode);
|
||||
ReactDOM.render(<Container />, mountNode);
|
||||
````
|
||||
|
||||
|
@ -215,7 +215,7 @@ export default class Table extends React.Component {
|
||||
if (result !== 0) {
|
||||
return (sortOrder === 'descend') ? -result : result;
|
||||
}
|
||||
return a._index - b._index;
|
||||
return a.indexForSort - b.indexForSort;
|
||||
};
|
||||
}
|
||||
|
||||
@ -644,7 +644,7 @@ export default class Table extends React.Component {
|
||||
// 优化本地排序
|
||||
data = data.slice(0);
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i]._index = i;
|
||||
data[i].indexForSort = i;
|
||||
}
|
||||
const sorterFn = this.getSorterFn();
|
||||
if (sorterFn) {
|
||||
|
@ -16,7 +16,8 @@ ReactDOM.render(
|
||||
<TabPane tab="选项卡二" key="2">选项卡二内容</TabPane>
|
||||
<TabPane tab="选项卡三" key="3">选项卡三内容</TabPane>
|
||||
</Tabs>
|
||||
</div>, mountNode);
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
||||
|
||||
````css
|
||||
|
@ -16,5 +16,6 @@ ReactDOM.render(
|
||||
<TabPane tab="选项卡一" key="1">选项卡一内容</TabPane>
|
||||
<TabPane tab="选项卡二" key="2">选项卡二内容</TabPane>
|
||||
<TabPane tab="选项卡三" key="3">选项卡三内容</TabPane>
|
||||
</Tabs>, mountNode);
|
||||
</Tabs>
|
||||
, mountNode);
|
||||
````
|
||||
|
@ -29,10 +29,10 @@ const generateData = (_level, _preKey, _tns) => {
|
||||
if (_level < 0) {
|
||||
return tns;
|
||||
}
|
||||
const __level = _level - 1;
|
||||
const level = _level - 1;
|
||||
children.forEach((key, index) => {
|
||||
tns[index].children = [];
|
||||
return generateData(__level, key, tns[index].children);
|
||||
return generateData(level, key, tns[index].children);
|
||||
});
|
||||
};
|
||||
generateData(z);
|
||||
|
@ -29,10 +29,10 @@ const generateData = (_level, _preKey, _tns) => {
|
||||
if (_level < 0) {
|
||||
return tns;
|
||||
}
|
||||
const __level = _level - 1;
|
||||
const level = _level - 1;
|
||||
children.forEach((key, index) => {
|
||||
tns[index].children = [];
|
||||
return generateData(__level, key, tns[index].children);
|
||||
return generateData(level, key, tns[index].children);
|
||||
});
|
||||
};
|
||||
generateData(z);
|
||||
|
@ -73,19 +73,20 @@
|
||||
"devDependencies": {
|
||||
"antd-tools": "~0.3.0",
|
||||
"babel-eslint": "^6.0.2",
|
||||
"babel-jest": "^11.0.2",
|
||||
"babel-jest": "^12.0.2",
|
||||
"babel-plugin-antd": "^0.4.0",
|
||||
"dom-scroll-into-view": "^1.1.0",
|
||||
"es6-shim": "^0.35.0",
|
||||
"eslint": "^2.2.0",
|
||||
"eslint-config-airbnb": "^7.0.0",
|
||||
"eslint-config-airbnb": "^8.0.0",
|
||||
"eslint-plugin-babel": "^3.0.0",
|
||||
"eslint-plugin-jsx-a11y": "^0.6.2",
|
||||
"eslint-plugin-import": "^1.6.1",
|
||||
"eslint-plugin-jsx-a11y": "^1.0.4",
|
||||
"eslint-plugin-markdown": "*",
|
||||
"eslint-plugin-react": "^5.0.1",
|
||||
"eslint-tinker": "^0.3.1",
|
||||
"history": "^2.0.1",
|
||||
"jest-cli": "^11.0.0",
|
||||
"jest-cli": "^12.0.2",
|
||||
"jsonml-to-react-component": "~0.2.0",
|
||||
"jsonml.js": "^0.1.0",
|
||||
"jsonp": "^0.2.0",
|
||||
|
Loading…
Reference in New Issue
Block a user