Skip to content

Commit a8ae3cc

Browse files
committed
Fix lint and formatting issues
1 parent 6554bdf commit a8ae3cc

File tree

4 files changed

+39
-34
lines changed

4 files changed

+39
-34
lines changed

packages/toolkit/.size-limit.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const esmSuffixes = ['modern.mjs' /*, 'browser.mjs', 'legacy-esm.js'*/]
55
const cjsSuffixes = [/*'development.cjs',*/ 'production.min.cjs']
66

77
/**
8-
* @param {string} suffix
9-
* @param {boolean} cjs
10-
*/
8+
* @param {string} suffix
9+
* @param {boolean} cjs
10+
*/
1111
function withRtkPath(suffix, cjs = false) {
1212
/**
1313
* @param {string} name

packages/toolkit/src/entities/sorted_state_adapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { createStateOperator } from './state_adapter'
1010
import { createUnsortedStateAdapter } from './unsorted_state_adapter'
1111
import {
1212
ensureEntitiesArray,
13+
getCurrent,
1314
selectIdValue,
1415
splitAddedUpdatedEntities,
15-
getCurrent,
1616
} from './utils'
1717

1818
// Borrowed from Replay
@@ -24,7 +24,7 @@ export function findInsertIndex<T>(
2424
let lowIndex = 0
2525
let highIndex = sortedItems.length
2626
while (lowIndex < highIndex) {
27-
let middleIndex = (lowIndex + highIndex) >>> 1
27+
const middleIndex = (lowIndex + highIndex) >>> 1
2828
const currentItem = sortedItems[middleIndex]
2929
const res = comparisonFunction(item, currentItem)
3030
if (res >= 0) {

packages/toolkit/src/query/tests/buildHooks.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -773,8 +773,8 @@ describe('hooks tests', () => {
773773
endpoints: (builder) => ({
774774
getTest: builder.query<string, number>({
775775
async queryFn() {
776-
await new Promise((resolve) => setTimeout(resolve, 1000));
777-
return { data: "data!" };
776+
await new Promise((resolve) => setTimeout(resolve, 1000))
777+
return { data: 'data!' }
778778
},
779779
keepUnusedDataFor: 0,
780780
}),
@@ -786,13 +786,13 @@ describe('hooks tests', () => {
786786
})
787787

788788
const checkNumQueries = (count: number) => {
789-
const cacheEntries = Object.keys((storeRef.store.getState()).api.queries)
789+
const cacheEntries = Object.keys(storeRef.store.getState().api.queries)
790790
const queries = cacheEntries.length
791791

792792
expect(queries).toBe(count)
793793
}
794794

795-
let i = 0;
795+
let i = 0
796796

797797
function User() {
798798
const [fetchTest, { isFetching, isUninitialized }] =
@@ -820,7 +820,7 @@ describe('hooks tests', () => {
820820
})
821821

822822
// There should only be one stored query once they have had time to resolve
823-
checkNumQueries( 1)
823+
checkNumQueries(1)
824824
})
825825

826826
// See https://github.com/reduxjs/redux-toolkit/issues/3182

packages/toolkit/src/tests/createSlice.test-d.ts

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -660,38 +660,43 @@ describe('type tests', () => {
660660
expectTypeOf(action.error).toEqualTypeOf<'error'>()
661661
},
662662
),
663-
testInferVoid: create.asyncThunk(() => {}, {
664-
pending(state, action) {
665-
expectTypeOf(state).toEqualTypeOf<TestState>()
666-
667-
expectTypeOf(action.meta.arg).toBeVoid()
663+
testInferVoid: create.asyncThunk(
664+
() => {
665+
/* empty */
668666
},
669-
fulfilled(state, action) {
670-
expectTypeOf(state).toEqualTypeOf<TestState>()
671-
672-
expectTypeOf(action.meta.arg).toBeVoid()
667+
{
668+
pending(state, action) {
669+
expectTypeOf(state).toEqualTypeOf<TestState>()
673670

674-
expectTypeOf(action.payload).toBeVoid()
675-
},
676-
rejected(state, action) {
677-
expectTypeOf(state).toEqualTypeOf<TestState>()
671+
expectTypeOf(action.meta.arg).toBeVoid()
672+
},
673+
fulfilled(state, action) {
674+
expectTypeOf(state).toEqualTypeOf<TestState>()
678675

679-
expectTypeOf(action.meta.arg).toBeVoid()
676+
expectTypeOf(action.meta.arg).toBeVoid()
680677

681-
expectTypeOf(action.error).toEqualTypeOf<SerializedError>()
682-
},
683-
settled(state, action) {
684-
expectTypeOf(state).toEqualTypeOf<TestState>()
678+
expectTypeOf(action.payload).toBeVoid()
679+
},
680+
rejected(state, action) {
681+
expectTypeOf(state).toEqualTypeOf<TestState>()
685682

686-
expectTypeOf(action.meta.arg).toBeVoid()
683+
expectTypeOf(action.meta.arg).toBeVoid()
687684

688-
if (isRejected(action)) {
689685
expectTypeOf(action.error).toEqualTypeOf<SerializedError>()
690-
} else {
691-
expectTypeOf(action.payload).toBeVoid()
692-
}
686+
},
687+
settled(state, action) {
688+
expectTypeOf(state).toEqualTypeOf<TestState>()
689+
690+
expectTypeOf(action.meta.arg).toBeVoid()
691+
692+
if (isRejected(action)) {
693+
expectTypeOf(action.error).toEqualTypeOf<SerializedError>()
694+
} else {
695+
expectTypeOf(action.payload).toBeVoid()
696+
}
697+
},
693698
},
694-
}),
699+
),
695700
testInfer: create.asyncThunk(
696701
function payloadCreator(arg: TestArg, api) {
697702
return Promise.resolve<TestReturned>({ payload: 'foo' })

0 commit comments

Comments
 (0)