Enable @typescript-eslint/explicit-function-return-type in /src (#9788)

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

* Prettier

* Enable `@typescript-eslint/explicit-function-return-type` in /src

* Fix types

* tsc strict fixes

* Delint

* Fix test

* Fix bad merge
This commit is contained in:
Michael Telatynski 2023-01-12 13:25:14 +00:00 committed by GitHub
parent 7a36ba0fde
commit 030b7e90bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
683 changed files with 3459 additions and 3013 deletions

View file

@ -172,7 +172,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
);
}
public componentDidUpdate(prevProps: IProps) {
public componentDidUpdate(prevProps: IProps): void {
// We need to re-check the placeholder when the enabled state changes because it causes the
// placeholder element to remount, which gets rid of the `::before` class. Re-evaluating the
// placeholder means we get a proper `::before` with the placeholder.
@ -676,7 +676,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
this.setState({ showPillAvatar });
};
private surroundWithSettingChanged = () => {
private surroundWithSettingChanged = (): void => {
const surroundWith = SettingsStore.getValue("MessageComposerInput.surroundWith");
this.setState({ surroundWith });
};
@ -686,7 +686,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
if (shouldReplace) this.replaceEmoticon(documentPosition, REGEX_EMOTICON_WHITESPACE);
};
public componentWillUnmount() {
public componentWillUnmount(): void {
document.removeEventListener("selectionchange", this.onSelectionChange);
this.editorRef.current.removeEventListener("input", this.onInput, true);
this.editorRef.current.removeEventListener("compositionstart", this.onCompositionStart, true);
@ -697,7 +697,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
SettingsStore.unwatchSetting(this.surroundWithHandle);
}
public componentDidMount() {
public componentDidMount(): void {
const model = this.props.model;
model.setUpdateCallback(this.updateEditorState);
const partCreator = model.partCreator;
@ -746,7 +746,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
formatRange(range, action);
};
public render() {
public render(): JSX.Element {
let autoComplete;
if (this.state.autoComplete) {
const query = this.state.query;