mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
upgrade eslint-config-airbnb
This commit is contained in:
parent
e3f0b2c6f5
commit
1e001d2d82
22
.eslintrc
22
.eslintrc
@ -17,29 +17,15 @@
|
||||
"babel"
|
||||
],
|
||||
"rules": {
|
||||
"constructor-super": 2,
|
||||
"comma-dangle": 0,
|
||||
"func-names": 0,
|
||||
"guard-for-in": 0,
|
||||
"one-var": [2, { "initialized": "never" }],
|
||||
"prefer-const": 0,
|
||||
"key-spacing": 0,
|
||||
"no-eq-null": 0,
|
||||
"no-else-return": 0,
|
||||
"no-param-reassign": 0,
|
||||
"no-this-before-super": 2,
|
||||
"no-undef": 2,
|
||||
"babel/object-shorthand": 0,
|
||||
"react/jsx-no-duplicate-props": 2,
|
||||
"react/sort-comp": 0,
|
||||
"react/wrap-multilines": 0,
|
||||
"react/no-multi-comp": 0,
|
||||
"react/prop-types": 0,
|
||||
"space-after-keywords": 0,
|
||||
"space-before-blocks": 0,
|
||||
"space-before-function-paren": 0,
|
||||
"spaced-comment": 0,
|
||||
"vars-on-top": 0,
|
||||
"id-length": 0
|
||||
"react/prefer-es6-class": 0,
|
||||
"react/jsx-closing-bracket-location": 0,
|
||||
"react/jsx-no-bind": 0,
|
||||
"space-before-function-paren": 0
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ class AntScrollNumber extends React.Component {
|
||||
style: {
|
||||
transition: removeTransition && 'none',
|
||||
transform: 'translate3d(0, ' + (-position * height) + 'px, 0)',
|
||||
height: height,
|
||||
height,
|
||||
},
|
||||
key: i,
|
||||
}, this.renderNumberList());
|
||||
@ -120,7 +120,7 @@ AntScrollNumber.defaultProps = {
|
||||
prefixCls: 'ant-scroll-number',
|
||||
count: null,
|
||||
component: 'sup',
|
||||
onAnimated: function() {},
|
||||
onAnimated() {},
|
||||
height: 18,
|
||||
};
|
||||
|
||||
|
@ -10,8 +10,8 @@ export default class ButtonGroup extends React.Component {
|
||||
// large => lg
|
||||
// small => sm
|
||||
const sizeCls = ({
|
||||
'large': 'lg',
|
||||
'small': 'sm'
|
||||
large: 'lg',
|
||||
small: 'sm',
|
||||
})[size] || '';
|
||||
|
||||
const classes = classNames({
|
||||
|
@ -37,8 +37,8 @@ export default class Button extends React.Component {
|
||||
// large => lg
|
||||
// small => sm
|
||||
const sizeCls = ({
|
||||
'large': 'lg',
|
||||
'small': 'sm'
|
||||
large: 'lg',
|
||||
small: 'sm',
|
||||
})[size] || '';
|
||||
|
||||
const classes = classNames({
|
||||
|
@ -68,11 +68,8 @@ class Header extends Component {
|
||||
}
|
||||
render() {
|
||||
const { type, value, prefixCls, locale } = this.props;
|
||||
|
||||
const yearSelect = this.getYearSelectElement(value.getYear());
|
||||
|
||||
const monthSelect = type === 'date' ? this.getMonthSelectElement(value.getMonth()) : null;
|
||||
|
||||
const typeSwitch = (
|
||||
<Group onChange={this.onTypeChange.bind(this)} value={type}>
|
||||
<Button value="date">{locale.month}</Button>
|
||||
|
@ -4,10 +4,10 @@ if (typeof window !== 'undefined') {
|
||||
const matchMediaPolyfill = function matchMediaPolyfill() {
|
||||
return {
|
||||
matches: false,
|
||||
addListener: function () {
|
||||
addListener() {
|
||||
},
|
||||
removeListener() {
|
||||
},
|
||||
removeListener: function () {
|
||||
}
|
||||
};
|
||||
};
|
||||
window.matchMedia = window.matchMedia || matchMediaPolyfill;
|
||||
@ -21,7 +21,7 @@ const AntCarousel = React.createClass({
|
||||
getDefaultProps() {
|
||||
return {
|
||||
dots: true,
|
||||
arrows: false
|
||||
arrows: false,
|
||||
};
|
||||
},
|
||||
render() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
import Collapse from 'rc-collapse';
|
||||
import React from 'react';
|
||||
const prefixCls = 'ant-collapse';
|
||||
|
||||
class AntCollapse extends React.Component {
|
||||
render() {
|
||||
@ -9,7 +8,7 @@ class AntCollapse extends React.Component {
|
||||
}
|
||||
|
||||
AntCollapse.defaultProps = {
|
||||
prefixCls: prefixCls
|
||||
prefixCls: 'ant-collapse',
|
||||
};
|
||||
|
||||
AntCollapse.Panel = Collapse.Panel;
|
||||
|
@ -17,7 +17,7 @@ function animate(node, show, transitionName, done) {
|
||||
node.style.display = show ? 'block' : 'none';
|
||||
velocity(node, transitionName, {
|
||||
duration: 240,
|
||||
complete: complete,
|
||||
complete,
|
||||
easing: 'easeInOutQuad'
|
||||
});
|
||||
return {
|
||||
|
@ -17,7 +17,7 @@ const align = {
|
||||
export default React.createClass({
|
||||
getDefaultProps() {
|
||||
return {
|
||||
align: align,
|
||||
align,
|
||||
type: 'default',
|
||||
};
|
||||
},
|
||||
|
@ -2,13 +2,13 @@ import React from 'react';
|
||||
import Dropdown from 'rc-dropdown';
|
||||
|
||||
export default React.createClass({
|
||||
getDefaultProps: function () {
|
||||
getDefaultProps() {
|
||||
return {
|
||||
transitionName: 'slide-up',
|
||||
prefixCls: 'ant-dropdown',
|
||||
};
|
||||
},
|
||||
render: function () {
|
||||
render() {
|
||||
const { overlay, ...otherProps } = this.props;
|
||||
const menu = React.cloneElement(overlay, {
|
||||
openTransitionName: 'zoom-big',
|
||||
|
@ -61,7 +61,8 @@ class FormItem extends React.Component {
|
||||
const required = this.props.required ? 'required' : '';
|
||||
|
||||
return this.props.label ? (
|
||||
<label htmlFor={this.props.id} className={this._getLayoutClass(labelCol)} required={required} key="label">
|
||||
<label htmlFor={this.props.id} className={this._getLayoutClass(labelCol)}
|
||||
required={required} key="label">
|
||||
{this.props.label}
|
||||
</label>
|
||||
) : null;
|
||||
@ -92,7 +93,8 @@ class FormItem extends React.Component {
|
||||
let prefixCls = child.props && child.props.prefixCls;
|
||||
prefixCls = prefixCls ? prefixCls.substring(prefixCls.indexOf('-') + 1) : '';
|
||||
|
||||
if ((type && compactControls.indexOf(type) > -1) || (prefixCls && compactControls.indexOf(prefixCls) > -1)) {
|
||||
if ((type && compactControls.indexOf(type) > -1) ||
|
||||
(prefixCls && compactControls.indexOf(prefixCls) > -1)) {
|
||||
isCompact = true;
|
||||
} else if (child.props && typeof child.props.children === 'object') {
|
||||
isCompact = this._isCompact(child.props.children);
|
||||
|
@ -26,8 +26,7 @@ class Group extends React.Component {
|
||||
render() {
|
||||
const className = 'ant-input-group ' + (this.props.className || '');
|
||||
return (
|
||||
<span className={className}
|
||||
style={this.props.style}>
|
||||
<span className={className} style={this.props.style}>
|
||||
{this.props.children}
|
||||
</span>
|
||||
);
|
||||
|
@ -87,7 +87,7 @@
|
||||
"css-loader": "^0.23.0",
|
||||
"es3ify-loader": "^0.1.0",
|
||||
"eslint": "^1.1.0",
|
||||
"eslint-config-airbnb": "^1.0.0",
|
||||
"eslint-config-airbnb": "^3.0.0",
|
||||
"eslint-plugin-babel": "^3.0.0",
|
||||
"eslint-plugin-markdown-antd": "0.0.0",
|
||||
"eslint-plugin-react": "^3.3.1",
|
||||
|
Loading…
Reference in New Issue
Block a user