Update linter

This commit is contained in:
Thomas Nordquist
2020-04-16 10:56:46 +02:00
parent 19e8bfdb37
commit 30af13f793
53 changed files with 92 additions and 97 deletions

View File

@@ -67,7 +67,7 @@ export const addChart = (chartParameters: ChartParameters) => async (
const chartExists = Boolean(
getState()
.charts.get('charts')
.find((chart) => chart.topic === chartParameters.topic && chart.dotPath === chartParameters.dotPath)
.find(chart => chart.topic === chartParameters.topic && chart.dotPath === chartParameters.dotPath)
)
if (chartExists) {
dispatch(showNotification('Already added'))

View File

@@ -20,7 +20,7 @@ export const connect = (options: MqttOptions, connectionId: string) => (
const event = makeConnectionStateEvent(connectionId)
const host = url.parse(options.url).hostname
rendererEvents.subscribe(event, (dataSourceState) => {
rendererEvents.subscribe(event, dataSourceState => {
if (dataSourceState.connected) {
const didReconnect = Boolean(getState().connection.tree)
if (!didReconnect) {

View File

@@ -146,7 +146,7 @@ export const deleteConnection = (connectionId: string) => (dispatch: Dispatch<an
const connectionIds = Object.keys(getState().connectionManager.connections)
const connectionIdLocation = connectionIds.indexOf(connectionId)
const remainingIds = connectionIds.filter((id) => id !== connectionId)
const remainingIds = connectionIds.filter(id => id !== connectionId)
const nextSelectedConnectionIndex = Math.min(remainingIds.length - 1, connectionIdLocation)
const nextSelectedConnection = remainingIds[nextSelectedConnectionIndex]

View File

@@ -22,7 +22,7 @@ export const toggleSettingsVisibility = () => (dispatch: Dispatch<any>) => {
}
export const requestConfirmation = (title: string, inquiry: string) => (dispatch: Dispatch<any>) => {
return new Promise((resolve) => {
return new Promise(resolve => {
const confirmationRequest = {
title,
inquiry,

View File

@@ -40,8 +40,8 @@ export const clearTopic = (topic: q.TreeNode<any>, recursive: boolean) => async
const publishEvent = makePublishEvent(connectionId)
topicsForPurging
.filter((t) => t.path() !== '' && t.hasMessage())
.map((t) => t.path())
.filter(t => t.path() !== '' && t.hasMessage())
.map(t => t.path())
.forEach((path, idx) => {
const mqttMessage = {
topic: path,

View File

@@ -82,7 +82,7 @@ function findNextNodeUpward(
}
const neighborNodes = sortedNodes(settings, parent)
const nodeIdx = neighborNodes.findIndex((n) => n.path() === treeNode.path())
const nodeIdx = neighborNodes.findIndex(n => n.path() === treeNode.path())
if (nodeIdx === 0) {
return parent
}
@@ -125,7 +125,7 @@ function findNextNodeDownwardNeighbor(
}
const neighborNodes = sortedNodes(settings, parent).filter(isTreeNodeVisible)
const nodeIdx = neighborNodes.findIndex((n) => n.path() === treeNode.path())
const nodeIdx = neighborNodes.findIndex(n => n.path() === treeNode.path())
const downwardNeighbor = neighborNodes[nodeIdx + 1]
if (downwardNeighbor) {
return downwardNeighbor