Enable noImplicitOverride TypeScript compiler option

This commit is contained in:
Evan Hahn 2021-11-12 17:44:20 -06:00 committed by GitHub
parent 4490d9f2d0
commit ede34ecee3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 339 additions and 194 deletions

View file

@ -1,4 +1,4 @@
// Copyright 2018-2020 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -16,7 +16,7 @@ export class AddNewLines extends React.Component<Props> {
renderNonNewLine: ({ text }) => text,
};
public render():
public override render():
| JSX.Element
| string
| null

View file

@ -214,7 +214,7 @@ export class ContactDetail extends React.Component<Props> {
});
}
public render(): JSX.Element {
public override render(): JSX.Element {
const { contact, hasSignalAccount, i18n, onSendMessage } = this.props;
const isIncoming = false;
const module = 'contact-detail';

View file

@ -587,7 +587,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
);
}
public render(): ReactNode {
public override render(): ReactNode {
const { id, isSMSOnly, i18n, onSetDisappearingMessages, expireTimer } =
this.props;
const { isNarrow, modalState } = this.state;

View file

@ -1,4 +1,4 @@
// Copyright 2018-2020 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -54,7 +54,7 @@ export class Emojify extends React.Component<Props> {
renderNonEmoji: ({ text }) => text,
};
public render(): null | Array<JSX.Element | string | null> {
public override render(): null | Array<JSX.Element | string | null> {
const { text, sizeClass, renderNonEmoji } = this.props;
// We have to do this, because renderNonEmoji is not required in our Props object,

View file

@ -36,7 +36,7 @@ export class ErrorBoundary extends React.PureComponent<Props, State> {
return { error };
}
public render(): ReactNode {
public override render(): ReactNode {
const { error } = this.state;
const { i18n, children } = this.props;

View file

@ -1,4 +1,4 @@
// Copyright 2018-2020 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -24,7 +24,7 @@ export class ExpireTimer extends React.Component<Props> {
this.interval = null;
}
public componentDidMount(): void {
public override componentDidMount(): void {
const { expirationLength } = this.props;
const increment = getIncrement(expirationLength);
const updateFrequency = Math.max(increment, 500);
@ -39,13 +39,13 @@ export class ExpireTimer extends React.Component<Props> {
this.interval = setInterval(update, updateFrequency);
}
public componentWillUnmount(): void {
public override componentWillUnmount(): void {
if (this.interval) {
clearInterval(this.interval);
}
}
public render(): JSX.Element {
public override render(): JSX.Element {
const {
direction,
expirationLength,

View file

@ -120,7 +120,7 @@ export class GroupNotification extends React.Component<Props> {
}
}
public render(): JSX.Element {
public override render(): JSX.Element {
const { changes: rawChanges, i18n, from } = this.props;
// This check is just to be extra careful, and can probably be removed.

View file

@ -132,7 +132,7 @@ export class Image extends React.Component<Props> {
);
};
public render(): JSX.Element {
public override render(): JSX.Element {
const {
alt,
attachment,

View file

@ -1,4 +1,4 @@
// Copyright 2019-2020 Signal Messenger, LLC
// Copyright 2019-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -37,14 +37,14 @@ export class InlineNotificationWrapper extends React.Component<PropsType> {
}
};
public componentDidMount(): void {
public override componentDidMount(): void {
const { isSelected } = this.props;
if (isSelected) {
this.setFocus();
}
}
public componentDidUpdate(prevProps: PropsType): void {
public override componentDidUpdate(prevProps: PropsType): void {
const { isSelected } = this.props;
if (!prevProps.isSelected && isSelected) {
@ -52,7 +52,7 @@ export class InlineNotificationWrapper extends React.Component<PropsType> {
}
}
public render(): JSX.Element {
public override render(): JSX.Element {
const { children } = this.props;
return (

View file

@ -1,4 +1,4 @@
// Copyright 2018-2020 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -326,7 +326,7 @@ export class Linkify extends React.Component<Props> {
renderNonLink: ({ text }) => text,
};
public render():
public override render():
| JSX.Element
| string
| null

View file

@ -418,7 +418,7 @@ export class Message extends React.PureComponent<Props, State> {
}
};
public componentDidMount(): void {
public override componentDidMount(): void {
this.startSelectedTimer();
this.startDeleteForEveryoneTimer();
@ -445,7 +445,7 @@ export class Message extends React.PureComponent<Props, State> {
}
}
public componentWillUnmount(): void {
public override componentWillUnmount(): void {
if (this.selectedTimeout) {
clearTimeout(this.selectedTimeout);
}
@ -462,7 +462,7 @@ export class Message extends React.PureComponent<Props, State> {
this.toggleReactionPicker(true);
}
public componentDidUpdate(prevProps: Props): void {
public override componentDidUpdate(prevProps: Props): void {
const { canDeleteForEveryone, isSelected, status, timestamp } = this.props;
this.startSelectedTimer();
@ -2414,7 +2414,7 @@ export class Message extends React.PureComponent<Props, State> {
);
}
public render(): JSX.Element | null {
public override render(): JSX.Element | null {
const { author, attachments, direction, id, isSticker, timestamp } =
this.props;
const { expired, expiring, imageBroken, isSelected } = this.state;

View file

@ -105,7 +105,7 @@ export class MessageDetail extends React.Component<Props> {
private readonly messageContainerRef = React.createRef<HTMLDivElement>();
public componentDidMount(): void {
public override componentDidMount(): void {
// When this component is created, it's initially not part of the DOM, and then it's
// added off-screen and animated in. This ensures that the focus takes.
setTimeout(() => {
@ -257,7 +257,7 @@ export class MessageDetail extends React.Component<Props> {
);
}
public render(): JSX.Element {
public override render(): JSX.Element {
const {
errors,
message,

View file

@ -126,7 +126,7 @@ export class Quote extends React.Component<Props, State> {
};
}
componentDidMount(): void {
override componentDidMount(): void {
const { doubleCheckMissingQuoteReference, referencedMessageNotFound } =
this.props;
@ -427,7 +427,7 @@ export class Quote extends React.Component<Props, State> {
);
}
public render(): JSX.Element | null {
public override render(): JSX.Element | null {
const {
conversationColor,
customColor,

View file

@ -1005,20 +1005,20 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
}
};
public componentDidMount(): void {
public override componentDidMount(): void {
this.updateWithVisibleRows();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window.registerForActive(this.updateWithVisibleRows);
}
public componentWillUnmount(): void {
public override componentWillUnmount(): void {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window.unregisterForActive(this.updateWithVisibleRows);
}
public componentDidUpdate(
public override componentDidUpdate(
prevProps: Readonly<PropsType>,
prevState: Readonly<StateType>
): void {
@ -1311,7 +1311,7 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
}
};
public render(): JSX.Element | null {
public override render(): JSX.Element | null {
const {
acknowledgeGroupMemberNameCollisions,
areWeAdmin,

View file

@ -171,7 +171,7 @@ export type PropsType = PropsLocalType &
>;
export class TimelineItem extends React.PureComponent<PropsType> {
public render(): JSX.Element | null {
public override render(): JSX.Element | null {
const {
containerElementRef,
conversationId,

View file

@ -1,4 +1,4 @@
// Copyright 2019-2020 Signal Messenger, LLC
// Copyright 2019-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -40,7 +40,7 @@ export class TimelineLoadingRow extends React.PureComponent<Props> {
return <Spinner size="24" svgSize="small" direction="on-background" />;
}
public render(): JSX.Element {
public override render(): JSX.Element {
return (
<div className="module-timeline-loading-row">{this.renderContents()}</div>
);

View file

@ -31,7 +31,7 @@ export class Timestamp extends React.Component<Props> {
this.interval = null;
}
public componentDidMount(): void {
public override componentDidMount(): void {
const update = () => {
this.setState({
// Used to trigger renders
@ -42,13 +42,13 @@ export class Timestamp extends React.Component<Props> {
this.interval = setInterval(update, UPDATE_FREQUENCY);
}
public componentWillUnmount(): void {
public override componentWillUnmount(): void {
if (this.interval) {
clearInterval(this.interval);
}
}
public render(): JSX.Element | null {
public override render(): JSX.Element | null {
const {
direction,
i18n,

View file

@ -66,7 +66,7 @@ export class TypingBubble extends React.PureComponent<Props> {
);
}
public render(): JSX.Element {
public override render(): JSX.Element {
const { i18n, conversationType } = this.props;
const isGroup = conversationType === 'group';

View file

@ -61,7 +61,7 @@ export class VerificationNotification extends React.Component<Props> {
);
}
public render(): JSX.Element {
public override render(): JSX.Element {
const { type } = this.props;
const icon = type === 'markVerified' ? 'verified' : 'verified-not';

View file

@ -1,4 +1,4 @@
// Copyright 2018-2020 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -20,7 +20,7 @@ export type Props = {
};
export class AttachmentSection extends React.Component<Props> {
public render(): JSX.Element {
public override render(): JSX.Element {
const { header } = this.props;
return (

View file

@ -1,4 +1,4 @@
// Copyright 2018-2020 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -23,7 +23,7 @@ export class DocumentListItem extends React.Component<Props> {
shouldShowSeparator: true,
};
public render(): JSX.Element {
public override render(): JSX.Element {
const { shouldShowSeparator } = this.props;
return (

View file

@ -1,4 +1,4 @@
// Copyright 2018-2020 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -78,7 +78,7 @@ export class MediaGallery extends React.Component<Props, State> {
};
}
public componentDidMount(): void {
public override componentDidMount(): void {
// When this component is created, it's initially not part of the DOM, and then it's
// added off-screen and animated in. This ensures that the focus takes.
setTimeout(() => {
@ -88,7 +88,7 @@ export class MediaGallery extends React.Component<Props, State> {
});
}
public render(): JSX.Element {
public override render(): JSX.Element {
const { selectedTab } = this.state;
return (

View file

@ -1,4 +1,4 @@
// Copyright 2018-2020 Signal Messenger, LLC
// Copyright 2018-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
@ -111,7 +111,7 @@ export class MediaGridItem extends React.Component<Props, State> {
);
}
public render(): JSX.Element {
public override render(): JSX.Element {
const { onClick } = this.props;
return (