Fix code-style

This commit is contained in:
Thomas Nordquist
2019-04-11 19:34:23 +02:00
parent 52c44327d0
commit d1f4bc678c
22 changed files with 43 additions and 46 deletions

View File

@@ -16,4 +16,4 @@ export enum CodeBlockColorsBraceMonokai {
string = '#E6DB74',
variable = '#A6E22E',
gutters = '#2F3129',
}
}

View File

@@ -19,7 +19,7 @@ class CodeDiff extends React.Component<Props, {}> {
super(props)
}
private renderChangeAmount(changes: Diff.Change[]) {
private renderChangeAmount(changes: Array<Diff.Change>) {
const additions = changes.map(change => (change.added === true) ? (change.count || 0) : 0).reduce((a, b) => a + b)
const deletions = changes.map(change => (change.removed === true) ? (change.count || 0) : 0).reduce((a, b) => a + b)
if (additions === 0 && deletions === 0) {

View File

@@ -10,7 +10,7 @@ interface HistoryItem {
}
interface Props {
items: HistoryItem[]
items: Array<HistoryItem>
onClick?: (index: number, element: EventTarget) => void
classes: any
contentTypeIndicator?: JSX.Element

View File

@@ -25,7 +25,6 @@ import {
withTheme,
} from '@material-ui/core'
// tslint:disable-next-line
import { default as AceEditor } from 'react-ace'
import { AppState } from '../../../reducers'
import History from '../History'
@@ -52,7 +51,7 @@ interface Props {
}
interface State {
history: Message[]
history: Array<Message>
}
class Publish extends React.Component<Props, State> {
@@ -97,7 +96,7 @@ class Publish extends React.Component<Props, State> {
// Remove duplicates
let filteredHistory = this.state.history.filter(e => e.payload !== payload || e.topic !== topic)
filteredHistory = filteredHistory.slice(-7)
const history: Message[] = [...filteredHistory, { topic, payload, sent: new Date() }]
const history: Array<Message> = [...filteredHistory, { topic, payload, sent: new Date() }]
this.setState({ history })
}

View File

@@ -191,7 +191,7 @@ const styles: StyleRulesCallback<string> = (theme: Theme) => {
},
toggleButton: {
height: '36px',
}
},
}
}