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:
parent
7a36ba0fde
commit
030b7e90bf
683 changed files with 3459 additions and 3013 deletions
|
@ -26,7 +26,7 @@ import RoomContext from "../../../contexts/RoomContext";
|
|||
|
||||
const MAX_PROVIDER_MATCHES = 20;
|
||||
|
||||
export const generateCompletionDomId = (number) => `mx_Autocomplete_Completion_${number}`;
|
||||
export const generateCompletionDomId = (n: number): string => `mx_Autocomplete_Completion_${n}`;
|
||||
|
||||
interface IProps {
|
||||
// the query string for which to show autocomplete suggestions
|
||||
|
@ -79,7 +79,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
|
|||
};
|
||||
}
|
||||
|
||||
public componentDidMount() {
|
||||
public componentDidMount(): void {
|
||||
this.autocompleter = new Autocompleter(this.props.room, this.context.timelineRenderingType);
|
||||
this.applyNewProps();
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
|
|||
this.complete(this.props.query, this.props.selection);
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
public componentWillUnmount(): void {
|
||||
this.autocompleter.destroy();
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
|
|||
}
|
||||
}
|
||||
|
||||
public componentDidUpdate(prevProps: IProps) {
|
||||
public componentDidUpdate(prevProps: IProps): void {
|
||||
this.applyNewProps(prevProps.query, prevProps.room);
|
||||
// this is the selected completion, so scroll it into view if needed
|
||||
const selectedCompletion = this.refs[`completion${this.state.selectionOffset}`] as HTMLElement;
|
||||
|
@ -280,7 +280,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
|
|||
}
|
||||
}
|
||||
|
||||
public render() {
|
||||
public render(): JSX.Element {
|
||||
let position = 1;
|
||||
const renderedCompletions = this.state.completions
|
||||
.map((completionResult, i) => {
|
||||
|
@ -290,7 +290,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
|
|||
const componentPosition = position;
|
||||
position++;
|
||||
|
||||
const onClick = () => {
|
||||
const onClick = (): void => {
|
||||
this.onCompletionClicked(componentPosition);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue