diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js index de634b87e8..f0430e1bf1 100644 --- a/superset-frontend/.eslintrc.js +++ b/superset-frontend/.eslintrc.js @@ -89,7 +89,6 @@ module.exports = { 'new-cap': 0, 'no-bitwise': 0, 'no-continue': 0, - 'no-else-return': 0, // disabled temporarily 'no-mixed-operators': 0, 'no-multi-assign': 0, 'no-multi-spaces': 0, @@ -203,7 +202,6 @@ module.exports = { 'jsx-a11y/mouse-events-have-key-events': 0, // re-enable up for discussion 'lines-between-class-members': 0, // disabled temporarily 'new-cap': 0, - 'no-else-return': 0, // disabled temporarily 'no-bitwise': 0, 'no-continue': 0, 'no-mixed-operators': 0, diff --git a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton.jsx b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton.jsx index 1c9612f6be..78f2b2f30f 100644 --- a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton.jsx +++ b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton.jsx @@ -61,7 +61,8 @@ class EstimateQueryCostButton extends React.PureComponent { {this.props.queryCostEstimate.error} ); - } else if (this.props.queryCostEstimate.completed) { + } + if (this.props.queryCostEstimate.completed) { return ( Query was stopped; - } else if (query.state === 'failed') { + } + if (query.state === 'failed') { return (
); - } else if (query.state === 'success' && query.ctas) { + } + if (query.state === 'success' && query.ctas) { const { tempSchema, tempTable } = query; let object = 'Table'; if (query.ctas_method === CtasEnum.VIEW) { @@ -262,7 +264,8 @@ export default class ResultSet extends React.PureComponent< ); - } else if (query.state === 'success' && query.results) { + } + if (query.state === 'success' && query.results) { const { results } = query; let data; if (this.props.cache && query.cached) { @@ -287,7 +290,8 @@ export default class ResultSet extends React.PureComponent< /> ); - } else if (data && data.length === 0) { + } + if (data && data.length === 0) { return ( {t('The query returned no data')} ); @@ -310,7 +314,8 @@ export default class ResultSet extends React.PureComponent< {t('Fetch data preview')} ); - } else if (query.resultsKey) { + } + if (query.resultsKey) { return ( ); - } else if (allowAsync) { + } + if (allowAsync) { return (