upgrade eslint-config-airbnb and fix lints

This commit is contained in:
afc163 2016-05-10 15:15:09 +08:00
parent cd3904b436
commit fcf3242570
8 changed files with 14 additions and 14 deletions

View File

@ -4,7 +4,10 @@ import { isCssAnimationSupported } from 'css-animation';
function getNumberArray(num) {
return num ?
num.toString().split('').reverse().map(i => Number(i)) : [];
num.toString()
.split('')
.reverse()
.map(i => Number(i)) : [];
}
export default class ScrollNumber extends React.Component {

View File

@ -59,7 +59,7 @@ export default class RangePicker extends React.Component {
const state = this.state;
const calendarClassName = classNames({
['ant-calendar-time']: showTime,
'ant-calendar-time': showTime,
});
let pickerChangeHandler = {

View File

@ -46,8 +46,8 @@ export default function createPicker(TheCalendar) {
const disabledTime = props.showTime ? props.disabledTime : null;
const calendarClassName = classNames({
['ant-calendar-time']: props.showTime,
['ant-calendar-month']: MonthCalendar === TheCalendar,
'ant-calendar-time': props.showTime,
'ant-calendar-month': MonthCalendar === TheCalendar,
});
let pickerChangeHandler = {

View File

@ -3,7 +3,7 @@ import CalendarLocale from 'rc-calendar/lib/locale/en_US';
import TimePickerLocale from '../../time-picker/locale/en_US';
// 统一合并为完整的 Locale
let locale = { ...GregorianCalendarLocale };
const locale = { ...GregorianCalendarLocale };
locale.lang = {
placeholder: 'Select date',
rangePlaceholder: ['Start date', 'End date'],

View File

@ -6,7 +6,7 @@ import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/ru_RU';
import CalendarLocale from 'rc-calendar/lib/locale/ru_RU';
import TimePickerLocale from '../../time-picker/locale/ru_RU';
let locale = { ...GregorianCalendarLocale };
const locale = { ...GregorianCalendarLocale };
locale.lang = {
placeholder: 'Выберите дату',
rangePlaceholder: ['Начальная дата', 'Конечная дата'],
@ -19,4 +19,3 @@ locale.timePickerLocale = { ...TimePickerLocale };
// https://github.com/ant-design/ant-design/issues/424
export default locale;

View File

@ -3,7 +3,7 @@ import CalendarLocale from 'rc-calendar/lib/locale/zh_CN';
import TimePickerLocale from '../../time-picker/locale/zh_CN';
// 统一合并为完整的 Locale
let locale = { ...GregorianCalendarLocale };
const locale = { ...GregorianCalendarLocale };
locale.lang = {
placeholder: '请选择日期',
rangePlaceholder: ['开始日期', '结束日期'],

View File

@ -79,7 +79,7 @@
"dom-scroll-into-view": "^1.1.0",
"es6-shim": "^0.35.0",
"eslint": "^2.2.0",
"eslint-config-airbnb": "^8.0.0",
"eslint-config-airbnb": "^9.0.1",
"eslint-plugin-babel": "^3.0.0",
"eslint-plugin-import": "^1.6.1",
"eslint-plugin-jsx-a11y": "^1.0.4",

View File

@ -81,11 +81,9 @@ export default class Header extends React.Component {
let activeMenuItem = routes[1].path || 'home';
activeMenuItem = activeMenuItem === 'components' ? 'docs/react' : activeMenuItem;
const options = Object.keys(componentsList).map((key) => {
return componentsList[key];
}).filter(({ meta }) => {
return /^component/.test(meta.fileName);
}).map(({ meta }) => {
const options = Object.keys(componentsList).map(key => componentsList[key])
.filter(({ meta }) => /^component/.test(meta.fileName))
.map(({ meta }) => {
const pathSnippet = meta.fileName.split('/')[1];
const url = `/components/${pathSnippet}`;
return (