Browse Source

upgrade eslint-config-airbnb and fix lints

pull/1623/head
afc163 9 years ago
parent
commit
fcf3242570
  1. 5
      components/badge/ScrollNumber.jsx
  2. 2
      components/date-picker/RangePicker.jsx
  3. 4
      components/date-picker/createPicker.jsx
  4. 2
      components/date-picker/locale/en_US.js
  5. 3
      components/date-picker/locale/ru_RU.js
  6. 2
      components/date-picker/locale/zh_CN.js
  7. 2
      package.json
  8. 8
      site/component/Header/index.jsx

5
components/badge/ScrollNumber.jsx

@ -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 {

2
components/date-picker/RangePicker.jsx

@ -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 = {

4
components/date-picker/createPicker.jsx

@ -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 = {

2
components/date-picker/locale/en_US.js

@ -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'],

3
components/date-picker/locale/ru_RU.js

@ -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;

2
components/date-picker/locale/zh_CN.js

@ -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: ['开始日期', '结束日期'],

2
package.json

@ -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",

8
site/component/Header/index.jsx

@ -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 (

Loading…
Cancel
Save