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

@@ -81,7 +81,7 @@ function addChart(state: ChartsState, action: AddChart) {
function moveUp(state: ChartsState, action: MoveUp) {
const charts = state.get('charts')
const idx = charts.findIndex((chart) => chart.topic === action.topic && chart.dotPath === action.dotPath)
const idx = charts.findIndex(chart => chart.topic === action.topic && chart.dotPath === action.dotPath)
const item = charts.get(idx)
const previousItem = charts.get(idx - 1)
@@ -95,7 +95,7 @@ function moveUp(state: ChartsState, action: MoveUp) {
function updateChart(state: ChartsState, action: UpdateChart) {
const charts = state.get('charts')
const chartIdx = charts.findIndex((chart) => chart.topic === action.topic && chart.dotPath === action.dotPath)
const chartIdx = charts.findIndex(chart => chart.topic === action.topic && chart.dotPath === action.dotPath)
const chart = charts.get(chartIdx)
return state.set('charts', chart ? charts.set(chartIdx, { ...chart, ...action.parameters }) : charts)
@@ -103,9 +103,7 @@ function updateChart(state: ChartsState, action: UpdateChart) {
function removeChart(state: ChartsState, action: RemoveChart) {
const charts = state.get('charts')
const newCharts = charts.filter(
(chart) => chart.topic !== action.chart.topic || chart.dotPath !== action.chart.dotPath
)
const newCharts = charts.filter(chart => chart.topic !== action.chart.topic || chart.dotPath !== action.chart.dotPath)
return state.set('charts', newCharts)
}