Eslint rule for block curlies (#3955)
* Add curly rule * Fix pre-existing issues with new rule
This commit is contained in:
@@ -134,16 +134,24 @@ class List extends Component {
|
||||
const balanceA = balances[accountA.address];
|
||||
const balanceB = balances[accountB.address];
|
||||
|
||||
if (!balanceA && !balanceB) return 0;
|
||||
if (balanceA && !balanceB) return -1;
|
||||
if (!balanceA && balanceB) return 1;
|
||||
if (!balanceA && !balanceB) {
|
||||
return 0;
|
||||
} else if (balanceA && !balanceB) {
|
||||
return -1;
|
||||
} else if (!balanceA && balanceB) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const ethA = balanceA.tokens.find(token => token.token.tag.toLowerCase() === 'eth');
|
||||
const ethB = balanceB.tokens.find(token => token.token.tag.toLowerCase() === 'eth');
|
||||
|
||||
if (!ethA && !ethB) return 0;
|
||||
if (ethA && !ethB) return -1;
|
||||
if (!ethA && ethB) return 1;
|
||||
if (!ethA && !ethB) {
|
||||
return 0;
|
||||
} else if (ethA && !ethB) {
|
||||
return -1;
|
||||
} else if (!ethA && ethB) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return -1 * ethA.value.comparedTo(ethB.value);
|
||||
}
|
||||
@@ -159,9 +167,13 @@ class List extends Component {
|
||||
.sort()
|
||||
.join('');
|
||||
|
||||
if (!tagsA && !tagsB) return 0;
|
||||
if (tagsA && !tagsB) return -1;
|
||||
if (!tagsA && tagsB) return 1;
|
||||
if (!tagsA && !tagsB) {
|
||||
return 0;
|
||||
} else if (tagsA && !tagsB) {
|
||||
return -1;
|
||||
} else if (!tagsA && tagsB) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return tagsA.localeCompare(tagsB);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,10 @@ export default class InputQuery extends Component {
|
||||
return (<LinearProgress mode='indeterminate' />);
|
||||
}
|
||||
|
||||
if (!results || results.length < 1) return null;
|
||||
if (!results || results.length < 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return outputs
|
||||
.map((out, index) => ({
|
||||
name: out.name,
|
||||
@@ -181,7 +184,9 @@ export default class InputQuery extends Component {
|
||||
}
|
||||
|
||||
renderValue (value) {
|
||||
if (!value) return 'no data';
|
||||
if (!value) {
|
||||
return 'no data';
|
||||
}
|
||||
|
||||
const { api } = this.context;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user