Commit 6d0a622f authored by ζ„šι“'s avatar ζ„šι“ Committed by 偏右

fix reveiw issue add consistent-return rule

parent cd1754ec
......@@ -22,7 +22,6 @@ module.exports = {
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/anchor-is-valid': 0,
'consistent-return': 0,
},
settings: {
polyfills: ['fetch', 'promises'],
......
......@@ -118,12 +118,7 @@ function getFakeList(req, res) {
const result = fakeList(count);
sourceData = result;
if (res && res.json) {
res.json(result);
} else {
return result;
}
res.json(result);
}
function postFakeList(req, res) {
......@@ -155,11 +150,7 @@ function postFakeList(req, res) {
break;
}
if (res && res.json) {
res.json(result);
} else {
return result;
}
res.json(result);
}
const getNotice = [
......@@ -327,11 +318,7 @@ const getActivities = [
];
function getFakeCaptcha(req, res) {
if (res && res.json) {
res.json('captcha-xxx');
} else {
return 'captcha-xxx';
}
res.json('captcha-xxx');
}
export default {
......
......@@ -72,11 +72,7 @@ function getRule(req, res, u) {
},
};
if (res && res.json) {
res.json(result);
} else {
return result;
}
res.json(result);
}
function postRule(req, res, u, b) {
......@@ -133,11 +129,7 @@ function postRule(req, res, u, b) {
},
};
if (res && res.json) {
res.json(result);
} else {
return result;
}
res.json(result);
}
export default {
......
......@@ -132,7 +132,7 @@ class Analysis extends Component {
const { rangePickerValue } = this.state;
const value = getTimeDistance(type);
if (!rangePickerValue[0] || !rangePickerValue[1]) {
return;
return undefined;
}
if (
rangePickerValue[0].isSame(value[0], 'day') &&
......@@ -140,6 +140,7 @@ class Analysis extends Component {
) {
return styles.currentDate;
}
return undefined;
}
render() {
......
......@@ -52,6 +52,7 @@ export function getTimeDistance(type) {
return [moment(`${year}-01-01 00:00:00`), moment(`${year}-12-31 23:59:59`)];
}
return undefined;
}
export function getPlainNode(nodeList, parentPath = '') {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment