Skip to content

Apply changes required by the centralized tooling configs #4607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 42 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7186c99
Add `configs` to `workspaces`
aryaemami59 Aug 27, 2024
9c45afd
use foreach so publish doesn't fail if package doesn't have tests, an…
EskiMojo14 Feb 8, 2024
8131aaa
Build `config` packages on `postinstall`
aryaemami59 Aug 27, 2024
06e3bd5
Initialize all the `config` packages
aryaemami59 Aug 27, 2024
4fa2bcb
Use the shareable Prettier config
aryaemami59 Aug 27, 2024
420ea8d
Use the shareable ESLint config
aryaemami59 Aug 27, 2024
ac53259
Use shareable `tsconfig.json` files
aryaemami59 Aug 28, 2024
2bf7829
Use the shareable Vitest config
aryaemami59 Aug 28, 2024
275f2c8
Run `yarn format` to format all files
aryaemami59 Sep 3, 2024
96d7011
Add `AnyNonNullishValue` helper type
aryaemami59 Sep 3, 2024
ef386fb
Add `AnyFunction` helper type
aryaemami59 Sep 3, 2024
e4b652d
Add `EmptyObject` helper type
aryaemami59 Sep 3, 2024
ebc74ec
Add `AnyObject` helper type
aryaemami59 Sep 3, 2024
c54dd95
Add `isObject` and `hasBodyAndHeaders` utility functions
aryaemami59 Sep 3, 2024
367f4bd
Change all `let` variables to `const` to comply with `prefer-const` rule
aryaemami59 Sep 3, 2024
4457a19
Make `hasBodyAndHeaders` assertion looser
aryaemami59 Sep 3, 2024
6b26b30
Use `hasBodyAndHeaders` to fix TS issues in `fetchBaseQuery.test.tsx`
aryaemami59 Sep 3, 2024
2fbc654
Fix lint issues related to the `no-prototype-builtins` rule
aryaemami59 Sep 3, 2024
e524c72
Fix `no-unsafe-optional-chaining` related problems
aryaemami59 Feb 3, 2024
02d8936
Fix `@typescript-eslint/prefer-as-const` related problems
aryaemami59 Sep 3, 2024
00ae851
Fix `no-extra-boolean-cast` related problems
aryaemami59 Sep 3, 2024
ad0c481
Fix `no-constant-condition` related problems
aryaemami59 Feb 3, 2024
dbf45d3
Fix `no-empty` related problems
aryaemami59 Feb 3, 2024
75a3786
Replace all `Function` references with `AnyFunction`
aryaemami59 Feb 3, 2024
6c75273
Move custom matchers into `vitest.setup.ts`
aryaemami59 Feb 8, 2024
52fbfcf
Fix `@typescript-eslint/no-unnecessary-type-constraint` related problems
aryaemami59 Sep 3, 2024
e03b433
Disable `prefer-rest-params` inside `composeWithDevTools`
aryaemami59 Feb 8, 2024
bdcebe4
Fix `@typescript-eslint/no-var-requires` related problems
aryaemami59 Feb 3, 2024
0d14880
Fix issues related to the `@typescript-eslint/prefer-function-type` rule
aryaemami59 Feb 3, 2024
3ff1931
Fix problems related to the `@typescript-eslint/no-empty-function` rule
aryaemami59 Feb 7, 2024
3595be9
Fix problems related to the `sort-imports` rule
aryaemami59 Sep 3, 2024
ea7c27f
Replace all `{}` types with `AnyNonNullishValue`
aryaemami59 Feb 3, 2024
9295299
Remove unused ESLint disable directives
aryaemami59 Sep 4, 2024
670c376
Fix `@typescript-eslint/no-unused-expressions` related issues
aryaemami59 Jul 31, 2024
9435d23
Fix problems related to the `@typescript-eslint/array-type` rule
aryaemami59 Sep 4, 2024
cdb86d2
Fix `noImplicitReturns`-related issues in `src/tests/utils/helpers.tsx`
aryaemami59 Sep 4, 2024
710cc16
Fix issues related to `hasBodyAndHeaders` usage
aryaemami59 Sep 4, 2024
5d8132c
Lint files and check formatting during CI
aryaemami59 Sep 4, 2024
9f53dcc
Fix TS issues related to `AnyNonNullishValue`
aryaemami59 Sep 5, 2024
c9610ce
Fix TS issues related to `EmptyObject`
aryaemami59 Sep 5, 2024
64bd897
Remove unused imports
aryaemami59 Sep 21, 2024
388f64a
Resolve remaining lint errors
aryaemami59 Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
61 changes: 0 additions & 61 deletions .eslintrc.js

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
- '@rtk-query/codegen-openapi'
- '@rtk-query/graphql-request-base-query'
- '@reduxjs/rtk-codemods'
- '@reduxjs/eslint-config'
- '@reduxjs/prettier-config'
- '@reduxjs/tsconfig'
- '@reduxjs/vitest-config'
jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -28,7 +32,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn workspace ${{ inputs.package }} test
- run: yarn workspaces foreach --include "${{ inputs.package }}" run test
- run: yarn workspace ${{ inputs.package }} exec npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
117 changes: 117 additions & 0 deletions .github/workflows/test-configs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Test Configs

on: [push, pull_request, workflow_dispatch]

jobs:
test-types:
name: Test types with TypeScript ${{ matrix.ts }} on ${{ matrix.os }} and Node.js ${{ matrix.node }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
package:
[
'@reduxjs/eslint-config',
'@reduxjs/prettier-config',
'@reduxjs/vitest-config',
]
node: ['22.x']
os: [ubuntu-latest]
ts: ['5.3', '5.4', '5.5', '5.6', '5.7', '5.8']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Install TypeScript ${{ matrix.ts }}
run: yarn up typescript@${{ matrix.ts }}

- name: Run type tests
run: yarn workspace ${{ matrix.package }} run test-types

are-the-types-wrong:
name: Check if the type definitions for ${{ matrix.package }} are correct with Node.js ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
node: ['22.x']
package:
[
'@reduxjs/eslint-config',
'@reduxjs/prettier-config',
'@reduxjs/tsconfig',
'@reduxjs/vitest-config',
]
os: [ubuntu-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Run are-the-types-wrong for ${{ matrix.package }} with Node.js ${{ matrix.node }} on ${{ matrix.os }}
run: yarn workspace ${{ matrix.package }} run check-exports --format table

- name: Did we fail?
if: failure()
run: ls -R

publint:
name: Check if the package.json for ${{ matrix.package }} is correct with Node.js ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
node: ['22.x']
package:
[
'@reduxjs/eslint-config',
'@reduxjs/prettier-config',
'@reduxjs/tsconfig',
'@reduxjs/vitest-config',
]
os: [ubuntu-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Run publint for ${{ matrix.package }} with Node.js ${{ matrix.node }} on ${{ matrix.os }}
run: yarn workspace ${{ matrix.package }} run check-package-json

- name: Did we fail?
if: failure()
run: ls -R
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ jobs:
- name: Install deps
run: yarn install

- name: Check formatting
run: yarn workspaces foreach -Ap -j unlimited run format-check

- name: Lint files
run: yarn workspaces foreach -Ap -j unlimited run lint

# Read existing version, reuse that, add a Git short hash
- name: Set build version to Git commit
run: yarn tsx scripts/writeGitVersion.mts $(git rev-parse --short HEAD)
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ typesversions
.pnp.*
*.tgz

tsconfig.vitest-temp.json
tsconfig.vitest-temp.json
.eslintcache
9 changes: 5 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/dist/**
**/etc/**
**/temp/**
**/__testfixtures__/**
__testfixtures__/
.docusaurus/
.next/
examples/publish-ci/
.yarn/
4 changes: 0 additions & 4 deletions .prettierrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api/actionCreatorMiddleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import reducer from './reducer'
// Augment middleware to consider all functions with a static type property to be action creators
const isActionCreator = (
action: unknown,
): action is Function & { type: unknown } =>
): action is (...args: any) => any & { type: unknown } =>
typeof action === 'function' && 'type' in action

const actionCreatorMiddleware = createActionCreatorInvariantMiddleware({
Expand Down
2 changes: 1 addition & 1 deletion docs/api/createListenerMiddleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ To fix this, the middleware provides types for defining "pre-typed" versions of
import { createListenerMiddleware, addListener } from '@reduxjs/toolkit'
import type { RootState, AppDispatch } from './store'

declare type ExtraArgument = {foo: string};
declare type ExtraArgument = { foo: string }

export const listenerMiddleware = createListenerMiddleware()

Expand Down
4 changes: 3 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "docs",
"devDependencies": {
"@manaflair/redux-batch": "^1.0.0",
"@reduxjs/tsconfig": "workspace:^",
"@types/nanoid": "^2.1.0",
"@types/react": "^19.0.1",
"async-mutex": "^0.3.2",
Expand All @@ -12,6 +13,7 @@
"nanoid": "^3.1.23",
"next-redux-wrapper": "^7.0.5",
"redux-persist": "^6.0.0",
"rxjs": "^6.6.2"
"rxjs": "^6.6.2",
"typescript": "^5.8.2"
}
}
1 change: 1 addition & 0 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "@reduxjs/tsconfig/base",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
Expand Down
7 changes: 2 additions & 5 deletions docs/virtual/matchers/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {
createAsyncThunk,
createReducer,
PayloadAction,
} from '@reduxjs/toolkit'
import type { PayloadAction } from '@reduxjs/toolkit'
import { createAsyncThunk, createReducer } from '@reduxjs/toolkit'

export interface Data {
isInteresting: boolean
Expand Down
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
2 changes: 1 addition & 1 deletion errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
"40": "maxPages for endpoint '' must be a number greater than 0",
"41": "getPreviousPageParam for endpoint '' must be a function if maxPages is used",
"42": "Duplicate middleware references found when creating the store. Ensure that each middleware is only included once."
}
}
Loading
Loading