Enable @typescript-eslint/explicit-member-accessibility
on /src (#9785)
* Enable `@typescript-eslint/explicit-member-accessibility` on /src * Prettier
This commit is contained in:
parent
51554399fb
commit
f1e8e7f140
396 changed files with 1110 additions and 1098 deletions
|
@ -88,7 +88,7 @@ export default class BaseDialog extends React.Component<IProps> {
|
|||
fixedWidth: true,
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.matrixClient = MatrixClientPeg.get();
|
||||
|
|
|
@ -54,7 +54,7 @@ interface IState {
|
|||
export default class BugReportDialog extends React.Component<IProps, IState> {
|
||||
private unmounted: boolean;
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
sendLogs: true,
|
||||
|
|
|
@ -30,7 +30,7 @@ interface IProps {
|
|||
const REPOS = ["vector-im/element-web", "matrix-org/matrix-react-sdk", "matrix-org/matrix-js-sdk"];
|
||||
|
||||
export default class ChangelogDialog extends React.Component<IProps> {
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {};
|
||||
|
|
|
@ -45,7 +45,7 @@ interface IState {
|
|||
* To avoid this, we keep the dialog open as long as /redact is in progress.
|
||||
*/
|
||||
export default class ConfirmAndWaitRedactDialog extends React.PureComponent<IProps, IState> {
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
isRedacting: false,
|
||||
|
|
|
@ -31,7 +31,7 @@ interface IProps {
|
|||
* A dialog for confirming a redaction.
|
||||
*/
|
||||
export default class ConfirmRedactDialog extends React.Component<IProps> {
|
||||
render() {
|
||||
public render() {
|
||||
return (
|
||||
<TextInputDialog
|
||||
onFinished={this.props.onFinished}
|
||||
|
|
|
@ -55,12 +55,12 @@ interface IState {
|
|||
* Also tweaks the style for 'dangerous' actions (albeit only with colour)
|
||||
*/
|
||||
export default class ConfirmUserActionDialog extends React.Component<IProps, IState> {
|
||||
static defaultProps = {
|
||||
public static defaultProps = {
|
||||
danger: false,
|
||||
askReason: false,
|
||||
};
|
||||
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
|
|
@ -33,7 +33,7 @@ export default class ConfirmWipeDeviceDialog extends React.Component<IProps> {
|
|||
this.props.onFinished(false);
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
return (
|
||||
<BaseDialog
|
||||
className="mx_ConfirmWipeDeviceDialog"
|
||||
|
|
|
@ -62,7 +62,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
private nameField = createRef<Field>();
|
||||
private aliasField = createRef<RoomAliasField>();
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.supportsRestricted = !!this.props.parentSpace;
|
||||
|
@ -124,7 +124,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
return opts;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
public componentDidMount() {
|
||||
// move focus to first field when showing dialog
|
||||
this.nameField.current.focus();
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
],
|
||||
});
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
const isVideoRoom = this.props.type === RoomType.ElementVideo;
|
||||
|
||||
let aliasField: JSX.Element;
|
||||
|
|
|
@ -46,7 +46,7 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class DeactivateAccountDialog extends React.Component<IProps, IState> {
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
|
|
@ -59,7 +59,7 @@ export default class EndPollDialog extends React.Component<IProps> {
|
|||
this.props.onFinished(endPoll);
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
return (
|
||||
<QuestionDialog
|
||||
title={_t("End Poll")}
|
||||
|
|
|
@ -42,7 +42,7 @@ export default class HostSignupDialog extends React.PureComponent<IProps, IState
|
|||
private iframeRef: React.RefObject<HTMLIFrameElement> = React.createRef();
|
||||
private readonly config: SnakedObject<IConfigOptions["host_signup"]>;
|
||||
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
|
|
@ -56,7 +56,7 @@ interface IState {
|
|||
export default class IncomingSasDialog extends React.Component<IProps, IState> {
|
||||
private showSasEvent: ISasEvent;
|
||||
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
let phase = PHASE_START;
|
||||
|
|
|
@ -34,7 +34,7 @@ interface IProps extends IDialogProps {
|
|||
}
|
||||
|
||||
export default class InfoDialog extends React.Component<IProps> {
|
||||
static defaultProps = {
|
||||
public static defaultProps = {
|
||||
title: "",
|
||||
description: "",
|
||||
hasCloseButton: false,
|
||||
|
@ -44,7 +44,7 @@ export default class InfoDialog extends React.Component<IProps> {
|
|||
this.props.onFinished();
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
return (
|
||||
<BaseDialog
|
||||
className="mx_InfoDialog"
|
||||
|
|
|
@ -83,7 +83,7 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class InteractiveAuthDialog extends React.Component<InteractiveAuthDialogProps, IState> {
|
||||
constructor(props: InteractiveAuthDialogProps) {
|
||||
public constructor(props: InteractiveAuthDialogProps) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
|
|
@ -100,7 +100,7 @@ class DMUserTile extends React.PureComponent<IDMUserTileProps> {
|
|||
this.props.onRemove(this.props.member);
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
const avatarSize = 20;
|
||||
const avatar = <SearchResultAvatar user={this.props.member} size={avatarSize} />;
|
||||
|
||||
|
@ -187,7 +187,7 @@ class DMRoomTile extends React.PureComponent<IDMRoomTileProps> {
|
|||
return result;
|
||||
}
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
let timestamp = null;
|
||||
if (this.props.lastActiveTs) {
|
||||
const humanTs = humanizeTime(this.props.lastActiveTs);
|
||||
|
@ -301,7 +301,7 @@ interface IInviteDialogState {
|
|||
}
|
||||
|
||||
export default class InviteDialog extends React.PureComponent<Props, IInviteDialogState> {
|
||||
static defaultProps = {
|
||||
public static defaultProps = {
|
||||
kind: KIND_DM,
|
||||
initialText: "",
|
||||
};
|
||||
|
@ -311,7 +311,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
|||
private numberEntryFieldRef: React.RefObject<Field> = createRef();
|
||||
private unmounted = false;
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
if (props.kind === KIND_INVITE && !props.roomId) {
|
||||
|
@ -351,13 +351,13 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
|||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
public componentDidMount() {
|
||||
if (this.props.initialText) {
|
||||
this.updateSuggestions(this.props.initialText);
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
public componentWillUnmount() {
|
||||
this.unmounted = true;
|
||||
}
|
||||
|
||||
|
@ -1078,7 +1078,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
|||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
let spinner = null;
|
||||
if (this.state.busy) {
|
||||
spinner = <Spinner w={20} h={20} />;
|
||||
|
|
|
@ -41,11 +41,11 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class LogoutDialog extends React.Component<IProps, IState> {
|
||||
static defaultProps = {
|
||||
public static defaultProps = {
|
||||
onFinished: function () {},
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
const cli = MatrixClientPeg.get();
|
||||
|
@ -127,7 +127,7 @@ export default class LogoutDialog extends React.Component<IProps, IState> {
|
|||
this.props.onFinished(true);
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
if (this.state.shouldLoadBackupStatus) {
|
||||
const description = (
|
||||
<div>
|
||||
|
|
|
@ -48,7 +48,7 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class MessageEditHistoryDialog extends React.PureComponent<IProps, IState> {
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
originalEvent: null,
|
||||
|
|
|
@ -61,11 +61,11 @@ export default class ModalWidgetDialog extends React.PureComponent<IProps, IStat
|
|||
private readonly possibleButtons: ModalButtonID[];
|
||||
private appFrame: React.RefObject<HTMLIFrameElement> = React.createRef();
|
||||
|
||||
state: IState = {
|
||||
public state: IState = {
|
||||
disabledButtonIds: (this.props.widgetDefinition.buttons || []).filter((b) => b.disabled).map((b) => b.id),
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.widget = new ElementWidget({
|
||||
|
|
|
@ -96,7 +96,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
|||
// If the room supports moderation, the moderation information.
|
||||
private moderation?: Moderation;
|
||||
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
let moderatedByRoomId = null;
|
||||
|
|
|
@ -55,7 +55,7 @@ interface IState {
|
|||
export default class RoomSettingsDialog extends React.Component<IProps, IState> {
|
||||
private dispatcherRef: string;
|
||||
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
this.state = { roomName: "" };
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ export default class RoomSettingsDialog extends React.Component<IProps, IState>
|
|||
return tabs;
|
||||
}
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
const roomName = this.state.roomName;
|
||||
return (
|
||||
<BaseDialog
|
||||
|
|
|
@ -37,11 +37,11 @@ interface IState {
|
|||
export default class RoomUpgradeDialog extends React.Component<IProps, IState> {
|
||||
private targetVersion: string;
|
||||
|
||||
state = {
|
||||
public state = {
|
||||
busy: true,
|
||||
};
|
||||
|
||||
async componentDidMount() {
|
||||
public async componentDidMount() {
|
||||
const recommended = await this.props.room.getRecommendedVersion();
|
||||
this.targetVersion = recommended.version;
|
||||
this.setState({ busy: false });
|
||||
|
@ -68,7 +68,7 @@ export default class RoomUpgradeDialog extends React.Component<IProps, IState> {
|
|||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
let buttons;
|
||||
if (this.state.busy) {
|
||||
buttons = <Spinner />;
|
||||
|
|
|
@ -53,7 +53,7 @@ export default class RoomUpgradeWarningDialog extends React.Component<IProps, IS
|
|||
private readonly isPrivate: boolean;
|
||||
private readonly currentVersion: string;
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
const room = MatrixClientPeg.get().getRoom(this.props.roomId);
|
||||
|
@ -100,7 +100,7 @@ export default class RoomUpgradeWarningDialog extends React.Component<IProps, IS
|
|||
Modal.createDialog(BugReportDialog, {});
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
const brand = SdkConfig.get().brand;
|
||||
|
||||
let inviteToggle = null;
|
||||
|
|
|
@ -45,7 +45,7 @@ export default class ServerPickerDialog extends React.PureComponent<IProps, ISta
|
|||
private readonly fieldRef = createRef<Field>();
|
||||
private validatedConf: ValidatedServerConfig;
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
const config = SdkConfig.get();
|
||||
|
|
|
@ -22,7 +22,7 @@ import DialogButtons from "../elements/DialogButtons";
|
|||
import { IDialogProps } from "./IDialogProps";
|
||||
|
||||
export default class SeshatResetDialog extends React.PureComponent<IDialogProps> {
|
||||
render() {
|
||||
public render() {
|
||||
return (
|
||||
<BaseDialog
|
||||
hasCancel={true}
|
||||
|
|
|
@ -46,7 +46,7 @@ interface IState {
|
|||
export default class SetEmailDialog extends React.Component<IProps, IState> {
|
||||
private addThreepid: AddThreepid;
|
||||
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
|
|
@ -75,7 +75,7 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class ShareDialog extends React.PureComponent<IProps, IState> {
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
let permalinkCreator: RoomPermalinkCreator = null;
|
||||
|
@ -91,7 +91,7 @@ export default class ShareDialog extends React.PureComponent<IProps, IState> {
|
|||
};
|
||||
}
|
||||
|
||||
static onLinkClick(e) {
|
||||
public static onLinkClick(e) {
|
||||
e.preventDefault();
|
||||
selectText(e.target);
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ export default class ShareDialog extends React.PureComponent<IProps, IState> {
|
|||
return matrixToUrl;
|
||||
}
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
let title;
|
||||
let checkbox;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class TermsCheckbox extends React.PureComponent<ITermsCheckboxProps> {
|
|||
this.props.onChange(this.props.url, ev.currentTarget.checked);
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
return <input type="checkbox" onChange={this.onChange} checked={this.props.checked} />;
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class TermsDialog extends React.PureComponent<ITermsDialogProps, IState> {
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
// url -> boolean
|
||||
|
|
|
@ -54,7 +54,7 @@ export default class TextInputDialog extends React.Component<IProps, IState> {
|
|||
hasCancel: true,
|
||||
};
|
||||
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
|
|
@ -35,11 +35,11 @@ export default class UploadConfirmDialog extends React.Component<IProps> {
|
|||
private readonly objectUrl: string;
|
||||
private readonly mimeType: string;
|
||||
|
||||
static defaultProps = {
|
||||
public static defaultProps = {
|
||||
totalFiles: 1,
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
// Create a fresh `Blob` for previewing (even though `File` already is
|
||||
|
@ -49,7 +49,7 @@ export default class UploadConfirmDialog extends React.Component<IProps> {
|
|||
this.objectUrl = URL.createObjectURL(blob);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
public componentWillUnmount() {
|
||||
if (this.objectUrl) URL.revokeObjectURL(this.objectUrl);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ export default class UploadConfirmDialog extends React.Component<IProps> {
|
|||
this.props.onFinished(true, true);
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
let title: string;
|
||||
if (this.props.totalFiles > 1 && this.props.currentIndex !== undefined) {
|
||||
title = _t("Upload files (%(current)s of %(total)s)", {
|
||||
|
|
|
@ -50,7 +50,7 @@ interface IState {
|
|||
export default class UserSettingsDialog extends React.Component<IProps, IState> {
|
||||
private settingsWatchers: string[] = [];
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
@ -210,7 +210,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
return tabs;
|
||||
}
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
return (
|
||||
<BaseDialog
|
||||
className="mx_UserSettingsDialog"
|
||||
|
|
|
@ -35,7 +35,7 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class VerificationRequestDialog extends React.Component<IProps, IState> {
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
verificationRequest: this.props.verificationRequest,
|
||||
|
@ -47,7 +47,7 @@ export default class VerificationRequestDialog extends React.Component<IProps, I
|
|||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
const request = this.state.verificationRequest;
|
||||
const otherUserId = request && request.otherUserId;
|
||||
const member = this.props.member || (otherUserId && MatrixClientPeg.get().getUser(otherUserId));
|
||||
|
|
|
@ -46,7 +46,7 @@ interface IState {
|
|||
export default class WidgetCapabilitiesPromptDialog extends React.PureComponent<IProps, IState> {
|
||||
private eventPermissionsMap = new Map<Capability, WidgetEventCapability>();
|
||||
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
const parsedEvents = WidgetEventCapability.findEventCapabilities(this.props.requestedCapabilities);
|
||||
|
|
|
@ -38,7 +38,7 @@ interface IState {
|
|||
}
|
||||
|
||||
export default class WidgetOpenIDPermissionsDialog extends React.PureComponent<IProps, IState> {
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
|
|
@ -62,7 +62,7 @@ interface IState {
|
|||
export default class AccessSecretStorageDialog extends React.PureComponent<IProps, IState> {
|
||||
private fileUpload = React.createRef<HTMLInputElement>();
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
@ -268,7 +268,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
|
|||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
const hasPassphrase =
|
||||
this.props.keyInfo &&
|
||||
this.props.keyInfo.passphrase &&
|
||||
|
|
|
@ -33,7 +33,7 @@ export default class ConfirmDestroyCrossSigningDialog extends React.Component<IP
|
|||
this.props.onFinished(false);
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
return (
|
||||
<BaseDialog
|
||||
className="mx_ConfirmDestroyCrossSigningDialog"
|
||||
|
|
|
@ -46,7 +46,7 @@ interface IState {
|
|||
* may need to complete some steps to proceed.
|
||||
*/
|
||||
export default class CreateCrossSigningDialog extends React.PureComponent<IProps, IState> {
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
|
@ -167,7 +167,7 @@ export default class CreateCrossSigningDialog extends React.PureComponent<IProps
|
|||
this.props.onFinished(false);
|
||||
};
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
let content;
|
||||
if (this.state.error) {
|
||||
content = (
|
||||
|
|
|
@ -77,11 +77,11 @@ interface IState {
|
|||
* Dialog for restoring e2e keys from a backup and the user's recovery key
|
||||
*/
|
||||
export default class RestoreKeyBackupDialog extends React.PureComponent<IProps, IState> {
|
||||
static defaultProps = {
|
||||
public static defaultProps = {
|
||||
showSummary: true,
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
public constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
backupInfo: null,
|
||||
|
|
|
@ -38,7 +38,7 @@ interface IState {
|
|||
export default class SetupEncryptionDialog extends React.Component<IProps, IState> {
|
||||
private store: SetupEncryptionStore;
|
||||
|
||||
constructor(props: IProps) {
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
||||
this.store = SetupEncryptionStore.sharedInstance();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue