Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9b6b9de
Add `configs` to `workspaces`
aryaemami59 Aug 27, 2024
7781664
use foreach so publish doesn't fail if package doesn't have tests, an…
EskiMojo14 Feb 8, 2024
b6e81dc
Build `config` packages on `postinstall`
aryaemami59 Aug 27, 2024
260f923
Initialize all the `config` packages
aryaemami59 Aug 27, 2024
a7586d3
Use the shareable Prettier config
aryaemami59 Aug 27, 2024
3f14e4a
Use the shareable ESLint config
aryaemami59 Aug 27, 2024
cc7230b
Use shareable `tsconfig.json` files
aryaemami59 Aug 28, 2024
0d71b78
Use the shareable Vitest config
aryaemami59 Aug 28, 2024
dca79bc
Run `yarn format` to format all files
aryaemami59 Sep 3, 2024
6ce8871
Add `AnyNonNullishValue` helper type
aryaemami59 Sep 3, 2024
275c2e0
Add `AnyFunction` helper type
aryaemami59 Sep 3, 2024
5b9b778
Add `EmptyObject` helper type
aryaemami59 Sep 3, 2024
718d0d2
Add `AnyObject` helper type
aryaemami59 Sep 3, 2024
e70c337
Add `isObject` and `hasBodyAndHeaders` utility functions
aryaemami59 Sep 3, 2024
a69e82c
Change all `let` variables to `const` to comply with `prefer-const` rule
aryaemami59 Sep 3, 2024
dc41266
Make `hasBodyAndHeaders` assertion looser
aryaemami59 Sep 3, 2024
88d1f17
Use `hasBodyAndHeaders` to fix TS issues in `fetchBaseQuery.test.tsx`
aryaemami59 Sep 3, 2024
0170457
Fix lint issues related to the `no-prototype-builtins` rule
aryaemami59 Sep 3, 2024
137f315
Fix `no-unsafe-optional-chaining` related problems
aryaemami59 Feb 3, 2024
2f78ece
Fix `@typescript-eslint/prefer-as-const` related problems
aryaemami59 Sep 3, 2024
affc5e8
Fix `no-extra-boolean-cast` related problems
aryaemami59 Sep 3, 2024
a596a5a
Fix `no-constant-condition` related problems
aryaemami59 Feb 3, 2024
b79b9e5
Fix `no-empty` related problems
aryaemami59 Feb 3, 2024
24c50e3
Replace all `Function` references with `AnyFunction`
aryaemami59 Feb 3, 2024
61086e8
Move custom matchers into `vitest.setup.ts`
aryaemami59 Feb 8, 2024
9127134
Fix `@typescript-eslint/no-unnecessary-type-constraint` related problems
aryaemami59 Sep 3, 2024
e6778e9
Disable `prefer-rest-params` inside `composeWithDevTools`
aryaemami59 Feb 8, 2024
d9d6b89
Fix `@typescript-eslint/no-var-requires` related problems
aryaemami59 Feb 3, 2024
f232712
Fix issues related to the `@typescript-eslint/prefer-function-type` rule
aryaemami59 Feb 3, 2024
618b4e2
Fix problems related to the `@typescript-eslint/no-empty-function` rule
aryaemami59 Feb 7, 2024
51521c0
Fix problems related to the `sort-imports` rule
aryaemami59 Sep 3, 2024
8704baa
Replace all `{}` types with `AnyNonNullishValue`
aryaemami59 Feb 3, 2024
9500a85
Remove unused ESLint disable directives
aryaemami59 Sep 4, 2024
a143442
Fix `@typescript-eslint/no-unused-expressions` related issues
aryaemami59 Jul 31, 2024
147cb81
Fix problems related to the `@typescript-eslint/array-type` rule
aryaemami59 Sep 4, 2024
48e889d
Fix `noImplicitReturns`-related issues in `src/tests/utils/helpers.tsx`
aryaemami59 Sep 4, 2024
a93bc7d
Fix issues related to `hasBodyAndHeaders` usage
aryaemami59 Sep 4, 2024
2d307b2
Lint files and check formatting during CI
aryaemami59 Sep 4, 2024
c7c2d3c
Fix TS issues related to `AnyNonNullishValue`
aryaemami59 Sep 5, 2024
d2f46c9
Fix TS issues related to `EmptyObject`
aryaemami59 Sep 5, 2024
2854438
Remove unused imports
aryaemami59 Sep 21, 2024
bc933f4
Resolve remaining lint errors
aryaemami59 Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Resolve remaining lint errors
  • Loading branch information
aryaemami59 committed Oct 22, 2025
commit bc933f4757a627354f61c44c054f6d7853769c64
10 changes: 5 additions & 5 deletions docs/virtual/petstore-api.generated/petstore-api.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const api = createApi({
}),
}),
})
type AnyNonNullishValue = NonNullable<unknown>
export type UpdatePetApiResponse = /** status 200 Successful operation */ Pet
export type UpdatePetApiArg = {
/** Update an existent pet in the store */
Expand Down Expand Up @@ -174,10 +175,9 @@ export type UploadFileApiArg = {
additionalMetadata?: string
body: string
}
export type GetInventoryApiResponse = /** status 200 successful operation */ {
[key: string]: number
}
export type GetInventoryApiArg = {}
export type GetInventoryApiResponse =
/** status 200 successful operation */ Record<string, number>
export type GetInventoryApiArg = AnyNonNullishValue
export type PlaceOrderApiResponse = /** status 200 successful operation */ Order
export type PlaceOrderApiArg = {
order: Order
Expand Down Expand Up @@ -211,7 +211,7 @@ export type LoginUserApiArg = {
password?: string
}
export type LogoutUserApiResponse = unknown
export type LogoutUserApiArg = {}
export type LogoutUserApiArg = AnyNonNullishValue
export type GetUserByNameApiResponse =
/** status 200 successful operation */ User
export type GetUserByNameApiArg = {
Expand Down
6 changes: 3 additions & 3 deletions examples/action-listener/counter/src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Unsubscribe } from '@reduxjs/toolkit'
import React, { useEffect } from 'react'
import { Provider } from 'react-redux'
import type { Unsubscribe } from '@reduxjs/toolkit'
import { setupThemeListeners } from '../../services/theme/listeners'
import { setupCounterListeners } from '../../services/counter/listeners'
import { setupThemeListeners } from '../../services/theme/listeners'
import { startAppListening, store } from '../../store'
import { ChangeThemeForm } from '../ChangeThemeForm/ChangeThemeForm'
import { CounterList } from '../CounterList/CounterList'
import { CreateCounterForm } from '../CreateCounterForm/CreateCounterForm'
import { store, startAppListening } from '../../store'

export function App() {
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { FormEvent, ChangeEvent } from 'react'
import type { ChangeEvent, FormEvent } from 'react'
import type { ThemeState } from '../../services/theme/slice'
import { themeActions } from '../../services/theme/slice'
import { useAppDispatch, useAppSelector } from '../../store'
import { themeActions, ThemeState } from '../../services/theme/slice'
import styles from './changeThemeForm.module.css'

function isChecked(theme: ThemeState): boolean {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { EntityId } from '@reduxjs/toolkit'
import type { EntityId } from '@reduxjs/toolkit'
import clsx from 'clsx'
import { memo } from 'react'
import { counterActions, counterSelectors } from '../../services/counter/slice'
import { useAppDispatch, useAppSelector } from '../../store'
import styles from './counter.module.css'
import clsx from 'clsx'

export interface CounterProps {
counterId: EntityId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { FormEvent, useState } from 'react'
import styles from './createCounter.module.css'
import clsx from 'clsx'
import { useAppDispatch } from '../../store'
import type { FormEvent } from 'react'
import { useState } from 'react'
import { counterActions } from '../../services/counter/slice'
import { useAppDispatch } from '../../store'
import styles from './createCounter.module.css'

const sectionClassname = clsx('paper', styles.section)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { counterActions, counterSelectors } from './slice'
import {
UnknownAction,
isAllOf,
isAnyOf,
import type {
PayloadAction,
UnknownAction,
Unsubscribe,
} from '@reduxjs/toolkit'
import { isAllOf, isAnyOf } from '@reduxjs/toolkit'
import type { AppListenerEffectAPI, AppStartListening } from '../../store'
import { counterActions, counterSelectors } from './slice'

function shouldStopAsyncTasksOf(id: string) {
return isAllOf(
Expand Down
12 changes: 5 additions & 7 deletions examples/action-listener/counter/src/services/counter/slice.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {
createSlice,
createEntityAdapter,
nanoid,
PayloadAction,
} from '@reduxjs/toolkit'
import type { PayloadAction } from '@reduxjs/toolkit'
import { createEntityAdapter, createSlice, nanoid } from '@reduxjs/toolkit'

export interface Counter {
value: number
Expand Down Expand Up @@ -70,7 +66,9 @@ export const counterSlice = createSlice({
updateByAsync(
_,
action: PayloadAction<{ id: string; delta: number; delayMs: number }>,
) {},
) {
/* No-Op */
},
cancelAsyncUpdates(state, { payload }: PayloadAction<string>) {
delete state.counters.entities[payload]?.intervalMs
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { configureStore, createListenerMiddleware } from '@reduxjs/toolkit'
import { setupCounterListeners } from '../listeners'
import { counterSlice, counterActions, counterSelectors } from '../slice'
import type { AppStartListening } from '../../../store'
import { setupCounterListeners } from '../listeners'
import { counterActions, counterSelectors, counterSlice } from '../slice'

function delay(timerMs: number): Promise<number> {
return new Promise((resolve) => {
Expand All @@ -12,7 +12,9 @@ function delay(timerMs: number): Promise<number> {
jest.useRealTimers()

describe('counter - listeners', () => {
const onMiddlewareError = jest.fn((): void => {}) // https://jestjs.io/docs/mock-function-api
const onMiddlewareError = jest.fn((): void => {
/* No-Op */
}) // https://jestjs.io/docs/mock-function-api

/**
* @see https://redux-toolkit.js.org/api/createListenerMiddleware
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { themeActions } from './slice'
import type { Unsubscribe } from '@reduxjs/toolkit'
import type { AppStartListening } from '../../store'
import { Unsubscribe } from '@reduxjs/toolkit'
import { themeActions } from './slice'

function onChangeColorScheme(
action: ReturnType<typeof themeActions.changeColorScheme>,
Expand Down
13 changes: 8 additions & 5 deletions examples/action-listener/counter/src/store.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'
import type {
ListenerEffectAPI,
TypedAddListener,
TypedStartListening,
} from '@reduxjs/toolkit'
import {
addListener,
configureStore,
createListenerMiddleware,
TypedStartListening,
TypedAddListener,
ListenerEffectAPI,
addListener,
} from '@reduxjs/toolkit'
import type { TypedUseSelectorHook } from 'react-redux'
import { useDispatch, useSelector } from 'react-redux'
import { counterSlice } from './services/counter/slice'
import { themeSlice } from './services/theme/slice'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Routes, Route } from 'react-router-dom'
import { Box, Center, VStack } from '@chakra-ui/react'

import { Route, Routes } from 'react-router-dom'
import { Login } from './features/auth/Login'
import { PrivateOutlet } from './utils/PrivateOutlet'
import { ProtectedComponent } from './features/auth/ProtectedComponent'
import { PrivateOutlet } from './utils/PrivateOutlet'

function Hooray() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
import { RootState } from '../store'
import type { RootState } from '../store'

export interface User {
first_name: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import * as React from 'react'
import {
Box,
Button,
Center,
Divider,
Input,
InputGroup,
InputRightElement,
VStack,
Button,
Divider,
Center,
Box,
useToast,
} from '@chakra-ui/react'
import { useNavigate } from 'react-router-dom'
import * as React from 'react'
import { useDispatch } from 'react-redux'

import { ProtectedComponent } from './ProtectedComponent'
import { useLoginMutation } from '../../app/services/auth'
import { useNavigate } from 'react-router-dom'
import type { LoginRequest } from '../../app/services/auth'
import { useLoginMutation } from '../../app/services/auth'
import { ProtectedComponent } from './ProtectedComponent'

function PasswordInput({
name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Center, VStack, Box, Button } from '@chakra-ui/react'
import { Box, Button, Center, VStack } from '@chakra-ui/react'
import { useProtectedMutation } from '../../app/services/auth'

export function ProtectedComponent() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createSlice } from '@reduxjs/toolkit'
import { api, User } from '../../app/services/auth'
import type { User } from '../../app/services/auth'
import { api } from '../../app/services/auth'
import type { RootState } from '../../app/store'

type AuthState = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'
import type { TypedUseSelectorHook } from 'react-redux'
import { useDispatch, useSelector } from 'react-redux'
import type { AppDispatch, RootState } from '../app/store'

export const useTypedSelector: TypedUseSelectorHook<RootState> = useSelector
Expand Down
5 changes: 2 additions & 3 deletions examples/query/react/authentication/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Routes, Route } from 'react-router-dom'
import { Box, Center, VStack } from '@chakra-ui/react'

import { Route, Routes } from 'react-router-dom'
import { Login } from './features/auth/Login'
import { PrivateOutlet } from './utils/PrivateOutlet'
import { ProtectedComponent } from './features/auth/ProtectedComponent'
import { PrivateOutlet } from './utils/PrivateOutlet'

function Hooray() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
import { RootState } from '../store'
import type { RootState } from '../store'

export interface User {
first_name: string
Expand Down
17 changes: 8 additions & 9 deletions examples/query/react/authentication/src/features/auth/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import * as React from 'react'
import {
Box,
Button,
Center,
Divider,
Input,
InputGroup,
InputRightElement,
VStack,
Button,
Divider,
Center,
Box,
useToast,
} from '@chakra-ui/react'
import { useNavigate } from 'react-router-dom'
import * as React from 'react'
import { useDispatch } from 'react-redux'
import { useNavigate } from 'react-router-dom'
import type { LoginRequest } from '../../app/services/auth'
import { useLoginMutation } from '../../app/services/auth'
import { setCredentials } from './authSlice'

import { ProtectedComponent } from './ProtectedComponent'
import { useLoginMutation } from '../../app/services/auth'
import type { LoginRequest } from '../../app/services/auth'

function PasswordInput({
name,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Center, VStack, Box, Button } from '@chakra-ui/react'
import { Box, Button, Center, VStack } from '@chakra-ui/react'
import { useProtectedMutation } from '../../app/services/auth'

export function ProtectedComponent() {
Expand Down
3 changes: 2 additions & 1 deletion examples/query/react/authentication/src/hooks/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'
import type { TypedUseSelectorHook } from 'react-redux'
import { useDispatch, useSelector } from 'react-redux'
import type { AppDispatch, RootState } from '../app/store'

export const useTypedSelector: TypedUseSelectorHook<RootState> = useSelector
Expand Down
10 changes: 5 additions & 5 deletions examples/query/react/basic/src/test/test-utils.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { render } from '@testing-library/react'
import type { PreloadedState } from '@reduxjs/toolkit'
import type { RenderOptions } from '@testing-library/react'
import { render } from '@testing-library/react'
import type React from 'react'
import type { PropsWithChildren, JSX } from 'react'
import type { JSX, PropsWithChildren } from 'react'
import { Provider } from 'react-redux'
import { setupStore } from '../store'
import type { AppStore, RootState } from '../store'
import type { PreloadedState } from '@reduxjs/toolkit'
import { setupStore } from '../store'

// This type interface extends the default options for render from RTL, as well
// as allows the user to specify other things such as initialState, store. For
Expand All @@ -24,7 +24,7 @@ function renderWithProviders(
...renderOptions
}: ExtendedRenderOptions = {},
) {
function Wrapper({ children }: PropsWithChildren<{}>): JSX.Element {
function Wrapper({ children }: PropsWithChildren): JSX.Element {
return <Provider store={store}>{children}</Provider>
}
return { store, ...render(ui, { wrapper: Wrapper, ...renderOptions }) }
Expand Down
3 changes: 2 additions & 1 deletion examples/query/react/conditional-fetching/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react'
import { Pokemon } from './Pokemon'
import { PokemonName, POKEMON_NAMES } from './pokemon.data'
import type { PokemonName } from './pokemon.data'
import { POKEMON_NAMES } from './pokemon.data'
import './styles.css'

const getRandomPokemonName = () =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type Maybe<T> = T
export type Exact<T extends { [key: string]: unknown }> = {
export type Exact<T extends Record<string, unknown>> = {
[K in keyof T]: T[K]
}
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
Expand Down Expand Up @@ -30,9 +30,9 @@ export type Mutation = {
__typename?: 'Mutation'
createPost?: Maybe<Post>
updatePost?: Maybe<Post>
updatePosts?: Maybe<Array<Maybe<Post>>>
updatePosts?: Maybe<Maybe<Post>[]>
deletePost?: Maybe<Post>
deletePosts?: Maybe<Array<Maybe<Post>>>
deletePosts?: Maybe<Maybe<Post>[]>
}

export type MutationCreatePostArgs = {
Expand Down Expand Up @@ -94,7 +94,7 @@ export type PostQueryInput = {
export type Query = {
__typename?: 'Query'
post?: Maybe<Post>
posts?: Maybe<Array<Maybe<Post>>>
posts?: Maybe<Maybe<Post>[]>
}

export type QueryPostArgs = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as React from 'react'
import {
Badge,
Box,
Button,
Divider,
Flex,
Heading,
HStack,
Heading,
Icon,
List,
ListIcon,
Expand All @@ -16,6 +15,7 @@ import {
StatLabel,
StatNumber,
} from '@chakra-ui/react'
import * as React from 'react'
import { MdArrowBack, MdArrowForward, MdBook } from 'react-icons/md'
import { useGetPostsQuery } from './GetPosts.generated'

Expand Down
Loading
Loading