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

@@ -30,7 +30,7 @@ function useHistory(): [Array<Message>, (topic: string, payload?: string) => voi
const amendToHistory = useCallback(
(topic: string, payload?: string) => {
// Remove duplicates
let filteredHistory = history.filter((e) => e.payload !== payload || e.topic !== topic)
let filteredHistory = history.filter(e => e.payload !== payload || e.topic !== topic)
filteredHistory = filteredHistory.slice(-7)
setHistory([...filteredHistory, { topic, payload, sent: new Date() }])
},
@@ -157,12 +157,9 @@ const PublishButton = (props: { publish: () => void }) => {
[props.publish]
)
const onFocus = useCallback(
(e: React.FocusEvent<HTMLElement>) => {
(e.relatedTarget as HTMLElement|null)?.focus()
},
[]
)
const onFocus = useCallback((e: React.FocusEvent<HTMLElement>) => {
;(e.relatedTarget as HTMLElement | null)?.focus()
}, [])
return useMemo(
() => (

View File

@@ -18,7 +18,7 @@ function PublishHistory(props: { history: Array<Message>; actions: typeof publis
)
return useMemo(() => {
const items = [...props.history].reverse().map((message) => ({
const items = [...props.history].reverse().map(message => ({
key: sha1(message.topic + message.payload),
title: message.topic,
value: message.payload || '',