chore: update eslint to force curly braces

pull/19630/head
Bucky Schwarz 2020-09-23 15:40:38 -07:00 committed by Bucky Schwarz
parent d8a10e5311
commit 9b61d7efc5
5 changed files with 14 additions and 5 deletions

View File

@ -29,6 +29,7 @@ module.exports = {
},
},
rules: {
'curly': ['error', 'all'],
'no-console': ['error', {allow: ['warn', 'error']}],
'no-empty': 'off',
'getter-return': 'off',

View File

@ -71,7 +71,9 @@ export const deleteDemoDataBucketMembership = async (bucketID: string) => {
}
export const fetchDemoDataBuckets = async (): Promise<Bucket[]> => {
if (!isFlagEnabled('demodata')) return []
if (!isFlagEnabled('demodata')) {
return []
}
try {
// FindBuckets paginates before filtering for authed buckets until #6591 is resolved,

View File

@ -54,7 +54,9 @@ class DashboardCards extends PureComponent<OwnProps & StateProps> {
private registerSpinner = elem => {
this._spinner = elem
if (!elem) return
if (!elem) {
return
}
let count = 1.0
const threshold = []

View File

@ -54,18 +54,20 @@ export default class EmptyQueryView extends PureComponent<Props> {
}
if (errorMessage) {
if (errorFormat === ErrorFormat.Tooltip)
if (errorFormat === ErrorFormat.Tooltip) {
return (
<EmptyGraphErrorTooltip
message={errorMessage}
testID="empty-graph--error"
/>
)
}
if (errorFormat === ErrorFormat.Scroll)
if (errorFormat === ErrorFormat.Scroll) {
return (
<EmptyGraphError message={errorMessage} testID="empty-graph--error" />
)
}
}
if (

View File

@ -133,7 +133,9 @@ const postOrderDFS = (
): VariableNode[] => {
// Handle the edge case that the function is
// called without providing the root node
if (!node) return [...acc]
if (!node) {
return [...acc]
}
for (const child of node.children) {
// by checking the cache for existing variables, we ensure that the graph stops