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

@@ -52,7 +52,7 @@ export interface MediaDevices {
function useObservableState<T>(
observable: Observable<T> | undefined,
startWith: T
) {
): T {
const [state, setState] = useState<T>(startWith);
useEffect(() => {
// observable state doesn't run in SSR
@@ -207,7 +207,8 @@ export const MediaDevicesProvider: FC<Props> = ({ children }) => {
);
};
export const useMediaDevices = () => useContext(MediaDevicesContext);
export const useMediaDevices = (): MediaDevices =>
useContext(MediaDevicesContext);
/**
* React hook that requests for the media devices context to be populated with
@@ -215,7 +216,10 @@ export const useMediaDevices = () => useContext(MediaDevicesContext);
* default because it may involve requesting additional permissions from the
* user.
*/
export const useMediaDeviceNames = (context: MediaDevices, enabled = true) =>
export const useMediaDeviceNames = (
context: MediaDevices,
enabled = true
): void =>
useEffect(() => {
if (enabled) {
context.startUsingDeviceNames();