Upgrade to typescript-eslint
v6 (#25904)
This commit is contained in:
parent
3ed9b55cb3
commit
a7253075d1
23 changed files with 133 additions and 107 deletions
|
@ -16,7 +16,7 @@ const defaultTypeSuffixes: Config['promiseTypeSuffixes'] = [
|
|||
export const loadingBarMiddleware = (
|
||||
config: Config = {},
|
||||
): Middleware<Record<string, never>, RootState> => {
|
||||
const promiseTypeSuffixes = config.promiseTypeSuffixes || defaultTypeSuffixes;
|
||||
const promiseTypeSuffixes = config.promiseTypeSuffixes ?? defaultTypeSuffixes;
|
||||
|
||||
return ({ dispatch }) =>
|
||||
(next) =>
|
||||
|
@ -32,7 +32,7 @@ export const loadingBarMiddleware = (
|
|||
if (action.type.match(isPending)) {
|
||||
dispatch(showLoading());
|
||||
} else if (
|
||||
action.type.match(isFulfilled) ||
|
||||
action.type.match(isFulfilled) ??
|
||||
action.type.match(isRejected)
|
||||
) {
|
||||
dispatch(hideLoading());
|
||||
|
|
|
@ -38,7 +38,7 @@ export const soundsMiddleware = (): Middleware<
|
|||
Record<string, never>,
|
||||
RootState
|
||||
> => {
|
||||
const soundCache: { [key: string]: HTMLAudioElement } = {};
|
||||
const soundCache: Record<string, HTMLAudioElement> = {};
|
||||
|
||||
void ready(() => {
|
||||
soundCache.boop = createAudio([
|
||||
|
@ -56,9 +56,9 @@ export const soundsMiddleware = (): Middleware<
|
|||
return () =>
|
||||
(next) =>
|
||||
(action: AnyAction & { meta?: { sound?: string } }) => {
|
||||
const sound = action?.meta?.sound;
|
||||
const sound = action.meta?.sound;
|
||||
|
||||
if (sound && soundCache[sound]) {
|
||||
if (sound && Object.hasOwn(soundCache, sound)) {
|
||||
play(soundCache[sound]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue