Skip to content
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

Apply changes required by the centralized tooling configs #4607

Draft
wants to merge 43 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
17116a4
Add `configs` to `workspaces`
aryaemami59 Aug 27, 2024
e81c07b
use foreach so publish doesn't fail if package doesn't have tests, an…
EskiMojo14 Feb 8, 2024
6a46588
Build `config` packages on `install`
aryaemami59 Aug 27, 2024
4d3698a
Initialize all the `config` packages
aryaemami59 Aug 27, 2024
40048d5
Use the shareable Prettier config
aryaemami59 Aug 27, 2024
aa98019
Use the shareable ESLint config
aryaemami59 Aug 27, 2024
cd4c2d7
Use shareable `tsconfig.json` files
aryaemami59 Aug 28, 2024
b78b7eb
Use the shareable Vitest config
aryaemami59 Aug 28, 2024
1534850
Run `yarn format` to format all files
aryaemami59 Sep 3, 2024
070ef4e
Add `AnyNonNullishValue` helper type
aryaemami59 Sep 3, 2024
fcf7db3
Add `AnyFunction` helper type
aryaemami59 Sep 3, 2024
38ee6ee
Add `EmptyObject` helper type
aryaemami59 Sep 3, 2024
3be36c9
Add `AnyObject` helper type
aryaemami59 Sep 3, 2024
d15dcbd
Add `isObject` and `hasBodyAndHeaders` utility functions
aryaemami59 Sep 3, 2024
6753020
Change all `let` variables to `const` to comply with `prefer-const` rule
aryaemami59 Sep 3, 2024
d21f6ff
Make `hasBodyAndHeaders` assertion looser
aryaemami59 Sep 3, 2024
2123701
Use `hasBodyAndHeaders` to fix TS issues in `fetchBaseQuery.test.tsx`
aryaemami59 Sep 3, 2024
34fbd44
Fix lint issues related to the `no-prototype-builtins` rule
aryaemami59 Sep 3, 2024
b7c0bc2
Fix `no-unsafe-optional-chaining` related problems
aryaemami59 Feb 3, 2024
7de5515
Fix `@typescript-eslint/prefer-as-const` related problems
aryaemami59 Sep 3, 2024
2000e4e
Fix `no-useless-escape` related problems
aryaemami59 Sep 3, 2024
0e6b034
Fix `no-extra-boolean-cast` related problems
aryaemami59 Sep 3, 2024
9ed3c4d
Fix `no-constant-condition` related problems
aryaemami59 Feb 3, 2024
231e69f
Fix `no-empty` related problems
aryaemami59 Feb 3, 2024
2452d6d
Replace all `Function` references with `AnyFunction`
aryaemami59 Feb 3, 2024
8bef633
Move custom matchers into `vitest.setup.ts`
aryaemami59 Feb 8, 2024
7d0d8d3
Fix `@typescript-eslint/no-unnecessary-type-constraint` related problems
aryaemami59 Sep 3, 2024
57acfc8
Disable `prefer-rest-params` inside `composeWithDevTools`
aryaemami59 Feb 8, 2024
e390af2
Fix `@typescript-eslint/no-var-requires` related problems
aryaemami59 Feb 3, 2024
28301e9
Fix issues related to the `@typescript-eslint/prefer-function-type` rule
aryaemami59 Feb 3, 2024
c5dffa3
Fix problems related to the `@typescript-eslint/no-empty-function` rule
aryaemami59 Feb 7, 2024
fc01108
Fix problems related to the `sort-imports` rule
aryaemami59 Sep 3, 2024
29b29a7
Replace all `{}` types with `AnyNonNullishValue`
aryaemami59 Feb 3, 2024
494c9d9
Remove unused ESLint disable directives
aryaemami59 Sep 4, 2024
7728a6c
Fix `@typescript-eslint/no-unused-expressions` related issues
aryaemami59 Jul 31, 2024
5f943f3
Fix problems related to the `@typescript-eslint/array-type` rule
aryaemami59 Sep 4, 2024
cb6a44e
Fix `noImplicitReturns`-related issues in `src/tests/utils/helpers.tsx`
aryaemami59 Sep 4, 2024
13d6caf
Fix issues related to `hasBodyAndHeaders` usage
aryaemami59 Sep 4, 2024
dac4ca7
Lint files and check formatting during CI
aryaemami59 Sep 4, 2024
66b3d16
Fix TS issues related to `AnyNonNullishValue`
aryaemami59 Sep 5, 2024
4c0d09f
Fix TS issues related to `EmptyObject`
aryaemami59 Sep 5, 2024
9dba6db
Fix `@typescript-eslint/consistent-indexed-object-style` related issues
aryaemami59 Nov 4, 2024
10f8314
Remove unused imports
aryaemami59 Sep 21, 2024
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
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 }}
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
34 changes: 30 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
**/dist/**
**/etc/**
**/temp/**
**/__testfixtures__/**
dist/
temp/
tmp/
__testfixtures__/
build/
lib/

.yalc
yalc.lock
yalc.sig

.idea/
.vscode/
.tmp-projections
coverage/

typesversions
.cache
.yarnrc
.yarn/*
.yarn/releases
**/.yarn/cache
.pnp.*
*.tgz

tsconfig.vitest-temp.json
.eslintcache

.docusaurus/
.next/
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
1 change: 1 addition & 0 deletions 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 Down
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
2 changes: 1 addition & 1 deletion errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"37": "Warning: Middleware for RTK-Query API at reducerPath \"\" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!",
"38": "Cannot refetch a query that has not been started yet.",
"39": "called \\`injectEndpoints\\` to override already-existing endpointName without specifying \\`overrideExisting: true\\`"
}
}
7 changes: 7 additions & 0 deletions eslint.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createESLintConfig } from '@reduxjs/eslint-config'
import { configs } from 'typescript-eslint'

export default createESLintConfig([
{ name: 'root-workspace/global-ignores', ignores: ['**/'] },
configs.disableTypeChecked,
])
1 change: 1 addition & 0 deletions examples/action-listener/counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
]
},
"devDependencies": {
"@reduxjs/tsconfig": "workspace:^",
"jest-watch-typeahead": "^1.1.0"
}
}
6 changes: 3 additions & 3 deletions examples/action-listener/counter/src/index.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
Expand Down
19 changes: 2 additions & 17 deletions examples/action-listener/counter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"extends": "@reduxjs/tsconfig/create-react-app",
"compilerOptions": {},
"include": ["src"]
}
6 changes: 3 additions & 3 deletions examples/publish-ci/cra4/src/index.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
Expand Down
6 changes: 3 additions & 3 deletions examples/publish-ci/cra5/src/index.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
Expand Down
6 changes: 3 additions & 3 deletions examples/publish-ci/vite/src/index.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
Expand Down
1 change: 1 addition & 0 deletions examples/query/react/advanced/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"react-scripts": "5.0.1"
},
"devDependencies": {
"@reduxjs/tsconfig": "workspace:^",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"typescript": "~4.9"
Expand Down
21 changes: 3 additions & 18 deletions examples/query/react/advanced/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
{
"include": ["./src/**/*"],
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"lib": ["dom", "es2015"],
"jsx": "react-jsx",
"target": "es5",
"allowJs": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
"extends": "@reduxjs/tsconfig/create-react-app",
"compilerOptions": {},
"include": ["src"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"react-scripts": "5.0.1"
},
"devDependencies": {
"@reduxjs/tsconfig": "workspace:^",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"typescript": "~4.9"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
{
"include": ["./src/**/*"],
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"lib": ["dom", "es2015"],
"jsx": "react-jsx",
"target": "es5",
"allowJs": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
"extends": "@reduxjs/tsconfig/create-react-app",
"compilerOptions": {},
"include": ["src"]
}
1 change: 1 addition & 0 deletions examples/query/react/authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"react-scripts": "5.0.1"
},
"devDependencies": {
"@reduxjs/tsconfig": "workspace:^",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"typescript": "~4.9"
Expand Down
21 changes: 3 additions & 18 deletions examples/query/react/authentication/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
{
"include": ["./src/**/*"],
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"lib": ["dom", "es2015"],
"jsx": "react-jsx",
"target": "es5",
"allowJs": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
"extends": "@reduxjs/tsconfig/create-react-app",
"compilerOptions": {},
"include": ["src"]
}
1 change: 1 addition & 0 deletions examples/query/react/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"react-scripts": "5.0.1"
},
"devDependencies": {
"@reduxjs/tsconfig": "workspace:^",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.1.0",
"@types/jest": "^26.0.23",
Expand Down
21 changes: 3 additions & 18 deletions examples/query/react/basic/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
{
"include": ["./src/**/*"],
"compilerOptions": {
"strict": true,
"esModuleInterop": true,
"lib": ["dom", "es2015"],
"jsx": "react-jsx",
"target": "es5",
"allowJs": true,
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
"extends": "@reduxjs/tsconfig/create-react-app",
"compilerOptions": {},
"include": ["src"]
}
Loading
Loading