Migrate conversations to ESLint

This commit is contained in:
Chris Svenningsen 2020-09-14 12:51:27 -07:00 committed by Josh Perez
parent b4f0f3c685
commit 372aa44e49
90 changed files with 1261 additions and 1165 deletions

View file

@ -13,7 +13,7 @@ export interface Props {
}
export class ExpireTimer extends React.Component<Props> {
private interval: any;
private interval: NodeJS.Timeout | null;
constructor(props: Props) {
super(props);
@ -21,26 +21,28 @@ export class ExpireTimer extends React.Component<Props> {
this.interval = null;
}
public componentDidMount() {
public componentDidMount(): void {
const { expirationLength } = this.props;
const increment = getIncrement(expirationLength);
const updateFrequency = Math.max(increment, 500);
const update = () => {
this.setState({
// Used to trigger renders
// eslint-disable-next-line react/no-unused-state
lastUpdated: Date.now(),
});
};
this.interval = setInterval(update, updateFrequency);
}
public componentWillUnmount() {
public componentWillUnmount(): void {
if (this.interval) {
clearInterval(this.interval);
}
}
public render() {
public render(): JSX.Element {
const {
direction,
expirationLength,