Update linter
This commit is contained in:
@@ -9,11 +9,9 @@ interface Props {
|
||||
}
|
||||
|
||||
function changeAmount(props: Props) {
|
||||
const additions = props.changes
|
||||
.map((change) => (change.added === true ? change.count || 0 : 0))
|
||||
.reduce((a, b) => a + b)
|
||||
const additions = props.changes.map(change => (change.added === true ? change.count || 0 : 0)).reduce((a, b) => a + b)
|
||||
const deletions = props.changes
|
||||
.map((change) => (change.removed === true ? change.count || 0 : 0))
|
||||
.map(change => (change.removed === true ? change.count || 0 : 0))
|
||||
.reduce((a, b) => a + b)
|
||||
if (additions === 0 && deletions === 0) {
|
||||
return null
|
||||
|
||||
@@ -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(
|
||||
() => (
|
||||
|
||||
@@ -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 || '',
|
||||
|
||||
@@ -33,9 +33,9 @@ class Topic extends React.PureComponent<Props, {}> {
|
||||
let key = 0
|
||||
const breadCrumps = node
|
||||
.branch()
|
||||
.map((node) => node.sourceEdge)
|
||||
.filter((edge) => Boolean(edge))
|
||||
.map((edge) => [
|
||||
.map(node => node.sourceEdge)
|
||||
.filter(edge => Boolean(edge))
|
||||
.map(edge => [
|
||||
<Button
|
||||
onClick={() => this.props.actions.selectTopic(edge!.target)}
|
||||
size="small"
|
||||
|
||||
Reference in New Issue
Block a user