Enable @typescript-eslint/explicit-member-accessibility on /src (#9785)

* Enable `@typescript-eslint/explicit-member-accessibility` on /src

* Prettier
This commit is contained in:
Michael Telatynski 2022-12-16 12:29:59 +00:00 committed by GitHub
parent 51554399fb
commit f1e8e7f140
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
396 changed files with 1110 additions and 1098 deletions

View file

@ -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();

View file

@ -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,

View file

@ -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 = {};

View file

@ -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,

View file

@ -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}

View file

@ -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 = {

View file

@ -33,7 +33,7 @@ export default class ConfirmWipeDeviceDialog extends React.Component<IProps> {
this.props.onFinished(false);
};
render() {
public render() {
return (
<BaseDialog
className="mx_ConfirmWipeDeviceDialog"

View file

@ -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;

View file

@ -46,7 +46,7 @@ interface IState {
}
export default class DeactivateAccountDialog extends React.Component<IProps, IState> {
constructor(props) {
public constructor(props) {
super(props);
this.state = {

View file

@ -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")}

View file

@ -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 = {

View file

@ -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;

View file

@ -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"

View file

@ -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 = {

View file

@ -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} />;

View file

@ -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>

View file

@ -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,

View file

@ -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({

View file

@ -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;

View file

@ -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

View file

@ -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 />;

View file

@ -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;

View file

@ -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();

View file

@ -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}

View file

@ -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 = {

View file

@ -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;

View file

@ -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

View file

@ -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 = {

View file

@ -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)", {

View file

@ -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"

View file

@ -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));

View file

@ -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);

View file

@ -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 = {

View file

@ -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 &&

View file

@ -33,7 +33,7 @@ export default class ConfirmDestroyCrossSigningDialog extends React.Component<IP
this.props.onFinished(false);
};
render() {
public render() {
return (
<BaseDialog
className="mx_ConfirmDestroyCrossSigningDialog"

View file

@ -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 = (

View file

@ -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,

View file

@ -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();