Add @typescript-eslint/no-base-to-string (#10091)
This commit is contained in:
parent
30cc55515e
commit
35d222bac6
10 changed files with 28 additions and 14 deletions
|
@ -48,7 +48,8 @@ export default class ServerOfflineDialog extends React.PureComponent<IProps> {
|
|||
private renderTimeline(): React.ReactElement[] {
|
||||
return EchoStore.instance.contexts.map((c, i) => {
|
||||
if (!c.firstFailedTime) return null; // not useful
|
||||
if (!(c instanceof RoomEchoContext)) throw new Error("Cannot render unknown context: " + c);
|
||||
if (!(c instanceof RoomEchoContext))
|
||||
throw new Error("Cannot render unknown context: " + c.constructor.name);
|
||||
const header = (
|
||||
<div className="mx_ServerOfflineDialog_content_context_timeline_header">
|
||||
<RoomAvatar width={24} height={24} room={c.room} />
|
||||
|
|
|
@ -185,6 +185,10 @@ export default class ProfileSettings extends React.Component<{}, IState> {
|
|||
withDisplayName: true,
|
||||
});
|
||||
|
||||
// False negative result from no-base-to-string rule, doesn't seem to account for Symbol.toStringTag
|
||||
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
||||
const avatarUrl = this.state.avatarUrl?.toString();
|
||||
|
||||
return (
|
||||
<form onSubmit={this.saveProfile} autoComplete="off" noValidate={true} className="mx_ProfileSettings">
|
||||
<input
|
||||
|
@ -216,7 +220,7 @@ export default class ProfileSettings extends React.Component<{}, IState> {
|
|||
</p>
|
||||
</div>
|
||||
<AvatarSetting
|
||||
avatarUrl={this.state.avatarUrl?.toString()}
|
||||
avatarUrl={avatarUrl}
|
||||
avatarName={this.state.displayName || this.state.userId}
|
||||
avatarAltText={_t("Profile picture")}
|
||||
uploadAvatar={this.uploadAvatar}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue