Upgrade eslint-plugin-matrix-org to 1.2.1
This upgrade came with a number of new lints that needed to be fixed across the code base. Primarily: explicit return types on functions, and explicit visibility modifiers on class members.
This commit is contained in:
@@ -64,7 +64,7 @@ export const AvatarInputField = forwardRef<HTMLInputElement, Props>(
|
||||
useEffect(() => {
|
||||
const currentInput = fileInputRef.current;
|
||||
|
||||
const onChange = (e: Event) => {
|
||||
const onChange = (e: Event): void => {
|
||||
const inputEvent = e as unknown as ChangeEvent<HTMLInputElement>;
|
||||
if (inputEvent.target.files && inputEvent.target.files.length > 0) {
|
||||
setObjUrl(URL.createObjectURL(inputEvent.target.files[0]));
|
||||
@@ -76,7 +76,7 @@ export const AvatarInputField = forwardRef<HTMLInputElement, Props>(
|
||||
|
||||
currentInput.addEventListener("change", onChange);
|
||||
|
||||
return () => {
|
||||
return (): void => {
|
||||
currentInput?.removeEventListener("change", onChange);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -41,8 +41,8 @@ export function StarRatingInput({
|
||||
return (
|
||||
<div
|
||||
className={styles.inputContainer}
|
||||
onMouseEnter={() => setHover(index)}
|
||||
onMouseLeave={() => setHover(rating)}
|
||||
onMouseEnter={(): void => setHover(index)}
|
||||
onMouseLeave={(): void => setHover(rating)}
|
||||
key={index}
|
||||
>
|
||||
<input
|
||||
@@ -51,7 +51,7 @@ export function StarRatingInput({
|
||||
id={"starInput" + String(index)}
|
||||
value={String(index) + "Star"}
|
||||
name="star rating"
|
||||
onChange={(_ev) => {
|
||||
onChange={(_ev): void => {
|
||||
setRating(index);
|
||||
onChange(index);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user