Skip to content

Commit

Permalink
temp(*): eslint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jinli.lyy committed Jan 25, 2019
1 parent 7a2d6eb commit 9366137
Show file tree
Hide file tree
Showing 136 changed files with 449 additions and 449 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
"prepub": "npm run eslint && npm run stylelint && npm run changelog && npm run build && npm run check && npm run docs && npm run pack && npm run pack -- minimize"
},
"lint-staged": {
"@(src|scripts|docs/*/demo)/**/*.@(js|jsx|md)": [
"eslint",
"git add"
],
// "@(src|scripts|docs/*/demo)/**/*.@(js|jsx|md)": [
// "eslint",
// "git add"
// ],
"src/**/*.@(css|scss)": [
"stylelint",
"git add"
Expand Down
6 changes: 3 additions & 3 deletions scripts/docs/generate-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function* buildCompiledDocs(cwd) {
componentList.push({
english: apiMdParsed.meta.title,
chinese: apiMdParsed.meta.chinese,
family: apiMdParsed.meta.family,
family: apiMdParsed.meta.family
});
yield fs.writeFile(apiTo, apiMdRendered, 'utf8');
} else {
Expand Down Expand Up @@ -215,7 +215,7 @@ function mutliLangHandler(orginData = '') {
const enVersrionText = enDocs ? `${enDocs}\n\n---\n\n${jsxCode}` : '';
return {
cn: cnDocs + jsxCode,
en: enVersrionText,
en: enVersrionText
};
}

Expand All @@ -229,6 +229,6 @@ function* compileApiFrom(apiFrom, docParser) {
const [meta, api] = html.split('<split></split>');
return {
apiMdParsed,
apiMdRendered: JSON.stringify({ meta, api }),
apiMdRendered: JSON.stringify({ meta, api })
};
}
6 changes: 3 additions & 3 deletions scripts/init-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ const options = {
return arr.filter((current, index, arr) =>
['config-provider', entry.name].indexOf(current) === -1 && index === arr.indexOf(current)
);
},
},
}
}
}, {
match: NEXT_LOCALE,
main: ['lib/en-us.js', 'lib/ja-jp.js', 'lib/zh-cn.js', 'lib/zh-tw.js']
Expand Down Expand Up @@ -78,7 +78,7 @@ const options = {
return arr.filter((current, index, arr) =>
['config-provider', entry.name].indexOf(current) === -1 && index === arr.indexOf(current)
);
},
}
}
}]
};
Expand Down
2 changes: 1 addition & 1 deletion scripts/server/loaders/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function(content) {

const scripts = [
'/common.js',
`/${replaceExt(path.relative(cwd, this.resourcePath), '.js')}`,
`/${replaceExt(path.relative(cwd, this.resourcePath), '.js')}`
];

ejs.renderFile(themeTplPath, {
Expand Down
2 changes: 1 addition & 1 deletion scripts/server/middlewares/change-dir.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const event = require('../event');
const event = require('../event');

module.exports = function() {
return function(req, res, next) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/server/middlewares/change-lang.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const event = require('../event');
const event = require('../event');

module.exports = function() {
return function(req, res, next) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const runRest = components => {
server.start();

server.on('run_complete', (brower, result) => {
const {error, failed, success, exitCode} = result;
const {error, failed, success, exitCode} = result;
failedNum += failed;
successNum += success;
if (error) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/karma.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = function(config) {
},
reporters: ['spec', 'coverage'],
preprocessors: {
[specPath]: ['webpack', 'sourcemap'],
[specPath]: ['webpack', 'sourcemap']
},
files: [
path.join(__dirname, 'animation-polyfill.js'),
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/check-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function (runtest = false, withOtherArgs = false) {
}

if (withOtherArgs) {
const newArgs = argv._;
const newArgs = argv._;
newArgs.splice(comIndex, 1);
newArgs.unshift(componentName);
return newArgs;
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/parse-md.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const remarkAbstract = require('remark');

const remark = remarkAbstract();
const logger = require('./logger');
const logger = require('./logger');

const EN_DOC_REG = /:{3}lang=en-us((.|\r|\n)*):{3}/;

Expand Down
2 changes: 1 addition & 1 deletion scripts/webpack/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const babelConfig = require('@alifd/babel-preset-next')({}, { runtime: true });
const js = (options = {}) => ({
loader: 'babel-loader',
options: Object.assign({
cacheDirectory: true,
cacheDirectory: true
}, babelConfig, options)
});

Expand Down
2 changes: 1 addition & 1 deletion scripts/webpack/prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = function(options = {}) {
// support ie 9
new CssSplitWebpackPlugin({
size: 4000,
preserve: true,
preserve: true
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
Expand Down
24 changes: 12 additions & 12 deletions src/affix/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ class Affix extends React.Component {
useAbsolute: PropTypes.bool,
className: PropTypes.string,
style: PropTypes.object,
children: PropTypes.any,
children: PropTypes.any
};

static defaultProps = {
prefix: 'next-',
container: () => window,
onAffix: func.noop,
onAffix: func.noop
};

constructor(props, context) {
super(props, context);
this.state = {
style: null,
containerStyle: null,
containerStyle: null
};
this.affixMode = this._getAffixMode(props);
}
Expand Down Expand Up @@ -99,21 +99,21 @@ class Affix extends React.Component {
if (!affixContainer) {
return false;
}
const containerScrollTop = getScroll(affixContainer, true); // 容器在垂直位置上的滚动 offset
const containerScrollTop = getScroll(affixContainer, true); // 容器在垂直位置上的滚动 offset
const affixOffset = this._getOffset(this.affixNode, affixContainer); // 目标节点当前相对于容器的 offset
const containerHeight = getNodeHeight(affixContainer); // 容器的高度
const containerHeight = getNodeHeight(affixContainer); // 容器的高度
const affixHeight = this.affixNode.offsetHeight;
const containerRect = getRect(affixContainer);

const affixChildHeight = this.affixChildNode.offsetHeight;

const affixMode = this.affixMode;
const affixStyle = {
width: affixOffset.width,
width: affixOffset.width
};
const containerStyle = {
width: affixOffset.width,
height: affixChildHeight,
height: affixChildHeight
};

if (affixMode.top && containerScrollTop > affixOffset.top - affixMode.offset) {
Expand Down Expand Up @@ -152,7 +152,7 @@ class Affix extends React.Component {
const affixMode = {
top: false,
bottom: false,
offset: 0,
offset: 0
};

if (typeof offsetTop !== 'number' && typeof offsetBottom !== 'number') {
Expand All @@ -175,7 +175,7 @@ class Affix extends React.Component {
}

this.setState({
style: affixStyle,
style: affixStyle
});

const { onAffix } = this.props;
Expand All @@ -195,7 +195,7 @@ class Affix extends React.Component {
}

_getOffset(affixNode, affixContainer) {
const affixRect = affixNode.getBoundingClientRect(); // affix 元素 相对浏览器窗口的位置
const affixRect = affixNode.getBoundingClientRect(); // affix 元素 相对浏览器窗口的位置
const containerRect = getRect(affixContainer); // affix 容器 相对浏览器窗口的位置
const containerScrollTop = getScroll(affixContainer, true);
const containerScrollLeft = getScroll(affixContainer, false);
Expand All @@ -204,7 +204,7 @@ class Affix extends React.Component {
top: affixRect.top - containerRect.top + containerScrollTop,
left: affixRect.left - containerRect.left + containerScrollLeft,
width: affixRect.width,
height: affixRect.height,
height: affixRect.height
};
}

Expand All @@ -223,7 +223,7 @@ class Affix extends React.Component {
[`${prefix}affix`]: state.style,
[`${prefix}affix-top`]: !state.style && this.affixMode.top,
[`${prefix}affix-bottom`]: !state.style && this.affixMode.bottom,
[className]: className,
[className]: className
});
const combinedStyle = { ...state.containerStyle, ...style };

Expand Down
2 changes: 1 addition & 1 deletion src/animate/animate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Animate extends Component {
enter: `${names.enter}`,
enterActive: `${names.enter}-active`,
leave: `${names.leave}`,
leaveActive: `${names.leave}-active`,
leaveActive: `${names.leave}-active`
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/badge/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Badge extends Component {
}

const classes = classNames(`${prefix}badge`, {
[`${prefix}badge-not-a-wrapper`]: !children,
[`${prefix}badge-not-a-wrapper`]: !children
}, className);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/button/view/button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function mapIconSize(size) {
return ({
large: 'small',
medium: 'xs',
small: 'xs',
small: 'xs'
})[size];
}

Expand Down
2 changes: 1 addition & 1 deletion src/button/view/group.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ButtonGroup extends Component {

static defaultProps = {
prefix: 'next-',
size: 'medium',
size: 'medium'
};

render() {
Expand Down
18 changes: 9 additions & 9 deletions src/calendar/calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Calendar extends Component {
onVisibleMonthChange: func.noop,
dateCellRender: (value) => value.date(),
locale: locale.Calendar,
showOtherMonth: true,
showOtherMonth: true
}

constructor(props, context) {
Expand All @@ -106,20 +106,20 @@ class Calendar extends Component {
this.state = {
value,
mode: props.mode || this.MODES[0],
visibleMonth,
visibleMonth
};
}

componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
const value = formatDateValue(nextProps.value);
this.setState({
value,
value
});

if (value) {
this.setState({
visibleMonth: value,
visibleMonth: value
});
}
}
Expand Down Expand Up @@ -195,7 +195,7 @@ class Calendar extends Component {

const classNames = classnames({
[`${prefix}calendar`]: true,
[`${prefix}calendar-${shape}`]: shape,
[`${prefix}calendar-${shape}`]: shape
}, className);

if (rtl) {
Expand Down Expand Up @@ -227,7 +227,7 @@ class Calendar extends Component {
goNextMonth: this.goNextMonth,
goPrevDecade: this.goPrevDecade,
goPrevYear: this.goPrevYear,
goPrevMonth: this.goPrevMonth,
goPrevMonth: this.goPrevMonth
};

const tableProps = {
Expand All @@ -243,19 +243,19 @@ class Calendar extends Component {
momentLocale: localeData,
today: this.today,
goPrevDecade: this.goPrevDecade,
goNextDecade: this.goNextDecade,
goNextDecade: this.goNextDecade
};

const tables = {
[CALENDAR_MODE_DATE]: <DateTable format={format} {...tableProps} onSelectDate={this.onSelectCell} />,
[CALENDAR_MODE_MONTH]: <MonthTable {...tableProps} onSelectMonth={this.onSelectCell} />,
[CALENDAR_MODE_YEAR]: <YearTable {...tableProps} rtl={rtl} onSelectYear={this.onSelectCell} />,
[CALENDAR_MODE_YEAR]: <YearTable {...tableProps} rtl={rtl} onSelectYear={this.onSelectCell} />
};

const panelHeaders = {
[CALENDAR_MODE_DATE]: <DatePanelHeader {...headerProps} />,
[CALENDAR_MODE_MONTH]: <MonthPanelHeader {...headerProps} />,
[CALENDAR_MODE_YEAR]: <YearPanelHeader {...headerProps} />,
[CALENDAR_MODE_YEAR]: <YearPanelHeader {...headerProps} />
};

return (
Expand Down
4 changes: 2 additions & 2 deletions src/calendar/head/card-header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import Radio from '../../radio';
class CardHeader extends React.PureComponent {

static propTypes = {
yearRangeOffset: PropTypes.number,
yearRangeOffset: PropTypes.number
}

static defaultProps = {
yearRangeOffset: 10,
yearRangeOffset: 10
}

selectContainerHandler = target => {
Expand Down
Loading

0 comments on commit 9366137

Please sign in to comment.