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

fix reveiw issue add consistent-return rule

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