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:
Robin
2023-09-22 18:05:13 -04:00
parent 444a37224b
commit a7624806b2
88 changed files with 735 additions and 433 deletions

View File

@@ -21,7 +21,7 @@ import { useEventTarget } from "./useEvents";
/**
* React hook that tracks whether the given media query matches.
*/
export const useMediaQuery = (query: string) => {
export function useMediaQuery(query: string): boolean {
const mediaQuery = useMemo(() => matchMedia(query), [query]);
const [numChanges, setNumChanges] = useState(0);
@@ -34,4 +34,4 @@ export const useMediaQuery = (query: string) => {
// We want any change to the update counter to trigger an update here
// eslint-disable-next-line react-hooks/exhaustive-deps
return useMemo(() => mediaQuery.matches, [mediaQuery, numChanges]);
};
}