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
|
@ -50,14 +50,14 @@ class ReactionPicker extends React.Component<IProps, IState> {
|
|||
this.addListeners();
|
||||
}
|
||||
|
||||
public componentDidUpdate(prevProps) {
|
||||
public componentDidUpdate(prevProps): void {
|
||||
if (prevProps.reactions !== this.props.reactions) {
|
||||
this.addListeners();
|
||||
this.onReactionsChange();
|
||||
}
|
||||
}
|
||||
|
||||
private addListeners() {
|
||||
private addListeners(): void {
|
||||
if (this.props.reactions) {
|
||||
this.props.reactions.on(RelationsEvent.Add, this.onReactionsChange);
|
||||
this.props.reactions.on(RelationsEvent.Remove, this.onReactionsChange);
|
||||
|
@ -65,7 +65,7 @@ class ReactionPicker extends React.Component<IProps, IState> {
|
|||
}
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
public componentWillUnmount(): void {
|
||||
if (this.props.reactions) {
|
||||
this.props.reactions.removeListener(RelationsEvent.Add, this.onReactionsChange);
|
||||
this.props.reactions.removeListener(RelationsEvent.Remove, this.onReactionsChange);
|
||||
|
@ -86,13 +86,13 @@ class ReactionPicker extends React.Component<IProps, IState> {
|
|||
);
|
||||
}
|
||||
|
||||
private onReactionsChange = () => {
|
||||
private onReactionsChange = (): void => {
|
||||
this.setState({
|
||||
selectedEmojis: new Set(Object.keys(this.getReactions())),
|
||||
});
|
||||
};
|
||||
|
||||
private onChoose = (reaction: string) => {
|
||||
private onChoose = (reaction: string): boolean => {
|
||||
this.componentWillUnmount();
|
||||
this.props.onFinished();
|
||||
const myReactions = this.getReactions();
|
||||
|
@ -130,7 +130,7 @@ class ReactionPicker extends React.Component<IProps, IState> {
|
|||
return true;
|
||||
};
|
||||
|
||||
public render() {
|
||||
public render(): JSX.Element {
|
||||
return (
|
||||
<EmojiPicker
|
||||
onChoose={this.onChoose}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue