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
|
@ -19,7 +19,7 @@ import { useEffect, useRef, useState } from "react";
|
|||
type Handler = () => void;
|
||||
|
||||
// Hook to simplify timeouts in functional components
|
||||
export const useTimeout = (handler: Handler, timeoutMs: number) => {
|
||||
export const useTimeout = (handler: Handler, timeoutMs: number): void => {
|
||||
// Create a ref that stores handler
|
||||
const savedHandler = useRef<Handler>();
|
||||
|
||||
|
@ -38,7 +38,7 @@ export const useTimeout = (handler: Handler, timeoutMs: number) => {
|
|||
};
|
||||
|
||||
// Hook to simplify intervals in functional components
|
||||
export const useInterval = (handler: Handler, intervalMs: number) => {
|
||||
export const useInterval = (handler: Handler, intervalMs: number): void => {
|
||||
// Create a ref that stores handler
|
||||
const savedHandler = useRef<Handler>();
|
||||
|
||||
|
@ -57,7 +57,7 @@ export const useInterval = (handler: Handler, intervalMs: number) => {
|
|||
};
|
||||
|
||||
// Hook to simplify a variable counting down to 0, handler called when it reached 0
|
||||
export const useExpiringCounter = (handler: Handler, intervalMs: number, initialCount: number) => {
|
||||
export const useExpiringCounter = (handler: Handler, intervalMs: number, initialCount: number): number => {
|
||||
const [count, setCount] = useState(initialCount);
|
||||
useInterval(() => setCount((c) => c - 1), intervalMs);
|
||||
if (count === 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue