Upgrade to typescript-eslint v6 (#25904)

This commit is contained in:
Renaud Chaput 2023-07-13 11:49:16 +02:00 committed by GitHub
parent 3ed9b55cb3
commit a7253075d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 133 additions and 107 deletions

View file

@ -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());

View file

@ -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]);
}