[build] upgrade eslint to 9.37.0 (#88)

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88
Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org>
Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
Zoë Bijl
2025-10-12 13:42:02 +02:00
committed by tobi
parent 75d7a62693
commit 1ff70886a1
975 changed files with 22196 additions and 21964 deletions
@@ -1,35 +1,35 @@
import { PureComponent } from 'react';
import { PureComponent } from "react";
import classNames from 'classnames';
import classNames from "classnames";
import { AnimatedNumber } from './animated_number';
import { Icon } from './icon';
import { AnimatedNumber } from "./animated_number";
import { Icon } from "./icon";
interface Props {
className?: string;
title: string;
icon: string;
onClick?: React.MouseEventHandler<HTMLButtonElement>;
onMouseDown?: React.MouseEventHandler<HTMLButtonElement>;
onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement>;
onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>;
size: number;
active: boolean;
expanded?: boolean;
style?: React.CSSProperties;
activeStyle?: React.CSSProperties;
disabled: boolean;
inverted?: boolean;
animate: boolean;
overlay: boolean;
tabIndex: number;
counter?: number;
href?: string;
ariaHidden: boolean;
className?: string,
title: string,
icon: string,
onClick?: React.MouseEventHandler<HTMLButtonElement>,
onMouseDown?: React.MouseEventHandler<HTMLButtonElement>,
onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement>,
onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>,
size: number,
active: boolean,
expanded?: boolean,
style?: React.CSSProperties,
activeStyle?: React.CSSProperties,
disabled: boolean,
inverted?: boolean,
animate: boolean,
overlay: boolean,
tabIndex: number,
counter?: number,
href?: string,
ariaHidden: boolean,
}
interface States {
activate: boolean;
deactivate: boolean;
activate: boolean,
deactivate: boolean,
}
export class IconButton extends PureComponent<Props, States> {
static defaultProps = {
@@ -48,7 +48,9 @@ export class IconButton extends PureComponent<Props, States> {
};
UNSAFE_componentWillReceiveProps(nextProps: Props) {
if (!nextProps.animate) return;
if (!nextProps.animate) {
return;
}
if (this.props.active && !nextProps.active) {
this.setState({ activate: false, deactivate: true });
@@ -65,12 +67,6 @@ export class IconButton extends PureComponent<Props, States> {
}
};
handleKeyPress: React.KeyboardEventHandler<HTMLButtonElement> = (e) => {
if (this.props.onKeyPress && !this.props.disabled) {
this.props.onKeyPress(e);
}
};
handleMouseDown: React.MouseEventHandler<HTMLButtonElement> = (e) => {
if (!this.props.disabled && this.props.onMouseDown) {
this.props.onMouseDown(e);
@@ -110,24 +106,24 @@ export class IconButton extends PureComponent<Props, States> {
const { activate, deactivate } = this.state;
const classes = classNames(className, 'icon-button', {
const classes = classNames(className, "icon-button", {
active,
disabled,
inverted,
activate,
deactivate,
overlayed: overlay,
'icon-button--with-counter': typeof counter !== 'undefined',
"icon-button--with-counter": typeof counter !== "undefined",
});
if (typeof counter !== 'undefined') {
style.width = 'auto';
if (typeof counter !== "undefined") {
style.width = "auto";
}
let contents = (
<>
<Icon id={icon} fixedWidth aria-hidden='true' />{' '}
{typeof counter !== 'undefined' && (
<Icon id={icon} fixedWidth aria-hidden='true' />{" "}
{typeof counter !== "undefined" && (
<span className='icon-button__counter'>
<AnimatedNumber value={counter} />
</span>
@@ -154,7 +150,6 @@ export class IconButton extends PureComponent<Props, States> {
onClick={this.handleClick}
onMouseDown={this.handleMouseDown}
onKeyDown={this.handleKeyDown}
onKeyPress={this.handleKeyPress}
style={style}
tabIndex={tabIndex}
disabled={disabled}