,
- P
+ P,
> = FunctionComponent &
NonReactStatics & {
WrappedComponent: C
@@ -108,9 +108,9 @@ export type Mapped = Identity<{ [k in keyof T]: T[k] }>
// Note> Most of the time TNeedsProps is empty, because the overloads in `Connect`
// just pass in `{}`. The real props we need come from the component.
export type InferableComponentEnhancerWithProps = <
- C extends ComponentType>>
+ C extends ComponentType>>,
>(
- component: C
+ component: C,
) => ConnectedComponent<
C,
Mapped<
@@ -130,7 +130,7 @@ export type InferableComponentEnhancer =
InferableComponentEnhancerWithProps
export type InferThunkActionCreatorType<
- TActionCreator extends (...args: any[]) => any
+ TActionCreator extends (...args: any[]) => any,
> = TActionCreator extends (
...args: infer TParams
) => (...args: any[]) => infer TReturn
@@ -168,11 +168,11 @@ export type ResolveThunks = TDispatchProps extends {
export interface TypedUseSelectorHook {
(
selector: (state: TState) => TSelected,
- equalityFn?: EqualityFn>
+ equalityFn?: EqualityFn>,
): TSelected
(
selector: (state: TState) => Selected,
- options?: UseSelectorOptions
+ options?: UseSelectorOptions,
): Selected
}
diff --git a/src/utils/hoistStatics.ts b/src/utils/hoistStatics.ts
index 5e41e0185..2e93931f2 100644
--- a/src/utils/hoistStatics.ts
+++ b/src/utils/hoistStatics.ts
@@ -69,15 +69,15 @@ export type NonReactStatics<
S extends React.ComponentType,
C extends {
[key: string]: true
- } = {}
+ } = {},
> = {
[key in Exclude<
keyof S,
S extends React.MemoExoticComponent
? keyof typeof MEMO_STATICS | keyof C
: S extends React.ForwardRefExoticComponent
- ? keyof typeof FORWARD_REF_STATICS | keyof C
- : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C
+ ? keyof typeof FORWARD_REF_STATICS | keyof C
+ : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C
>]: S[key]
}
@@ -93,7 +93,7 @@ export default function hoistNonReactStatics<
S extends React.ComponentType,
C extends {
[key: string]: true
- } = {}
+ } = {},
>(targetComponent: T, sourceComponent: S): T & NonReactStatics {
if (typeof sourceComponent !== 'string') {
// don't hoist over string (html) components
diff --git a/test/components/connect.spec.tsx b/test/components/connect.spec.tsx
index f7f984f87..1a81606d5 100644
--- a/test/components/connect.spec.tsx
+++ b/test/components/connect.spec.tsx
@@ -4,12 +4,12 @@ import * as rtl from '@testing-library/react'
import type { Dispatch, ElementType, MouseEvent, ReactNode } from 'react'
import React, { Component } from 'react'
import type {
- Action,
- AnyAction,
- MiddlewareAPI,
- Dispatch as ReduxDispatch,
- Store,
- UnknownAction,
+ Action,
+ AnyAction,
+ MiddlewareAPI,
+ Dispatch as ReduxDispatch,
+ Store,
+ UnknownAction,
} from 'redux'
import { applyMiddleware, createStore } from 'redux'
import type { ReactReduxContextValue } from '../../src/index'
diff --git a/test/hooks/hooks.withTypes.test.tsx b/test/hooks/hooks.withTypes.test.tsx
index 2a5823c56..288a50746 100644
--- a/test/hooks/hooks.withTypes.test.tsx
+++ b/test/hooks/hooks.withTypes.test.tsx
@@ -22,7 +22,7 @@ export const counterSlice = createSlice({
export function fetchCount(amount = 1) {
return new Promise<{ data: number }>((resolve) =>
- setTimeout(() => resolve({ data: amount }), 500)
+ setTimeout(() => resolve({ data: amount }), 500),
)
}
@@ -32,7 +32,7 @@ export const incrementAsync = createAsyncThunk(
const response = await fetchCount(amount)
// The value we return becomes the `fulfilled` action payload
return response.data
- }
+ },
)
const { increment } = counterSlice.actions
diff --git a/test/hooks/useReduxContext.spec.tsx b/test/hooks/useReduxContext.spec.tsx
index 6486bc96b..c11740bd2 100644
--- a/test/hooks/useReduxContext.spec.tsx
+++ b/test/hooks/useReduxContext.spec.tsx
@@ -2,8 +2,8 @@ import { renderHook } from '@testing-library/react-hooks'
import { createContext } from 'react'
import type { ReactReduxContextValue } from '../../src/components/Context'
import {
- createReduxContextHook,
- useReduxContext,
+ createReduxContextHook,
+ useReduxContext,
} from '../../src/hooks/useReduxContext'
describe('React', () => {
diff --git a/test/hooks/useSelector.spec.tsx b/test/hooks/useSelector.spec.tsx
index 70124ef5d..e86a522c6 100644
--- a/test/hooks/useSelector.spec.tsx
+++ b/test/hooks/useSelector.spec.tsx
@@ -3,31 +3,31 @@
import * as rtl from '@testing-library/react'
import type { DispatchWithoutAction, FunctionComponent, ReactNode } from 'react'
import React, {
- Suspense,
- useCallback,
- useContext,
- useEffect,
- useLayoutEffect,
- useReducer,
- useState,
+ Suspense,
+ useCallback,
+ useContext,
+ useEffect,
+ useLayoutEffect,
+ useReducer,
+ useState,
} from 'react'
import type { Action, AnyAction, Store } from 'redux'
import { createStore } from 'redux'
import type { UseSelectorOptions } from '../../src/hooks/useSelector'
import type {
- ProviderProps,
- ReactReduxContextValue,
- Subscription,
- TypedUseSelectorHook,
+ ProviderProps,
+ ReactReduxContextValue,
+ Subscription,
+ TypedUseSelectorHook,
} from '../../src/index'
import {
- Provider,
- ReactReduxContext,
- connect,
- createSelectorHook,
- shallowEqual,
- useDispatch,
- useSelector,
+ Provider,
+ ReactReduxContext,
+ connect,
+ createSelectorHook,
+ shallowEqual,
+ useDispatch,
+ useSelector,
} from '../../src/index'
// disable checks by default
diff --git a/test/typeTestHelpers.ts b/test/typeTestHelpers.ts
index c205d324f..36edf7fb1 100644
--- a/test/typeTestHelpers.ts
+++ b/test/typeTestHelpers.ts
@@ -29,7 +29,7 @@ type Equals = IsAny<
>
export type IsEqual = (() => G extends A ? 1 : 2) extends <
- G
+ G,
>() => G extends B ? 1 : 2
? true
: false
@@ -38,12 +38,12 @@ export type IfEquals<
T,
U,
TypeIfEquals = unknown,
- TypeIfNotEquals = never
+ TypeIfNotEquals = never,
> = IsEqual extends true ? TypeIfEquals : TypeIfNotEquals
export declare const exactType: (
draft: T & IfEquals,
- expected: U & IfEquals
+ expected: U & IfEquals,
) => IfEquals
export function expectExactType(t: T) {
diff --git a/test/typetests/hooks.tsx b/test/typetests/hooks.tsx
index 9779c26b6..5ae3af047 100644
--- a/test/typetests/hooks.tsx
+++ b/test/typetests/hooks.tsx
@@ -1,13 +1,13 @@
/* eslint-disable @typescript-eslint/no-unused-vars, no-inner-declarations */
-import type { AnyAction, Dispatch, Store } from '@reduxjs/toolkit';
-import { configureStore } from '@reduxjs/toolkit';
-import * as React from 'react';
+import type { AnyAction, Dispatch, Store } from '@reduxjs/toolkit'
+import { configureStore } from '@reduxjs/toolkit'
+import * as React from 'react'
import type {
ReactReduxContextValue,
Selector,
TypedUseSelectorHook,
-} from '../../src/index';
+} from '../../src/index'
import {
createDispatchHook,
createSelectorHook,
@@ -16,12 +16,12 @@ import {
useDispatch,
useSelector,
useStore,
-} from '../../src/index';
+} from '../../src/index'
-import type { AppDispatch, RootState } from './counterApp';
-import { incrementAsync } from './counterApp';
+import type { AppDispatch, RootState } from './counterApp'
+import { incrementAsync } from './counterApp'
-import { expectExactType, expectType } from '../typeTestHelpers';
+import { expectExactType, expectType } from '../typeTestHelpers'
function preTypedHooksSetup() {
// Standard hooks setup
diff --git a/test/utils/Subscription.spec.ts b/test/utils/Subscription.spec.ts
index ecd053029..562cecf8e 100644
--- a/test/utils/Subscription.spec.ts
+++ b/test/utils/Subscription.spec.ts
@@ -1,6 +1,6 @@
-import type { Store } from 'redux';
-import type { Subscription } from '../../src/utils/Subscription';
-import { createSubscription } from '../../src/utils/Subscription';
+import type { Store } from 'redux'
+import type { Subscription } from '../../src/utils/Subscription'
+import { createSubscription } from '../../src/utils/Subscription'
describe('Subscription', () => {
let notifications: string[]
diff --git a/test/utils/shallowEqual.spec.ts b/test/utils/shallowEqual.spec.ts
index afe95efb2..b4bd1d195 100644
--- a/test/utils/shallowEqual.spec.ts
+++ b/test/utils/shallowEqual.spec.ts
@@ -4,7 +4,10 @@ describe('Utils', () => {
describe('shallowEqual', () => {
it('should return true if arguments fields are equal', () => {
expect(
- shallowEqual({ a: 1, b: 2, c: undefined }, { a: 1, b: 2, c: undefined }),
+ shallowEqual(
+ { a: 1, b: 2, c: undefined },
+ { a: 1, b: 2, c: undefined },
+ ),
).toBe(true)
expect(shallowEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 })).toBe(