From a44728c38a61c8260f8015c0b81733e460252de3 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Tue, 27 Aug 2024 21:42:20 -0500 Subject: [PATCH] Use shareable `tsconfig.json` files --- docs/package.json | 1 + docs/tsconfig.json | 9 +-- examples/action-listener/counter/package.json | 1 + .../action-listener/counter/tsconfig.json | 19 +---- examples/query/react/advanced/package.json | 1 + examples/query/react/advanced/tsconfig.json | 21 +----- .../package.json | 1 + .../tsconfig.json | 21 +----- .../query/react/authentication/package.json | 1 + .../query/react/authentication/tsconfig.json | 21 +----- examples/query/react/basic/package.json | 1 + examples/query/react/basic/tsconfig.json | 21 +----- .../react/conditional-fetching/package.json | 1 + .../react/conditional-fetching/tsconfig.json | 21 +----- .../query/react/deduping-queries/package.json | 1 + .../react/deduping-queries/tsconfig.json | 21 +----- .../query/react/graphql-codegen/package.json | 1 + .../query/react/graphql-codegen/tsconfig.json | 22 +----- examples/query/react/graphql/package.json | 1 + examples/query/react/graphql/tsconfig.json | 21 +----- .../query/react/kitchen-sink/package.json | 1 + .../query/react/kitchen-sink/tsconfig.json | 21 +----- examples/query/react/mutations/package.json | 1 + examples/query/react/mutations/tsconfig.json | 21 +----- .../react/optimistic-update/package.json | 1 + .../react/optimistic-update/tsconfig.json | 21 +----- examples/query/react/pagination/package.json | 1 + examples/query/react/pagination/tsconfig.json | 21 +----- examples/query/react/polling/package.json | 1 + examples/query/react/polling/tsconfig.json | 21 +----- .../package.json | 1 + .../tsconfig.json | 21 +----- .../react/prefetching-automatic/package.json | 1 + .../react/prefetching-automatic/tsconfig.json | 21 +----- examples/query/react/prefetching/package.json | 1 + .../query/react/prefetching/tsconfig.json | 21 +----- .../query/react/with-apiprovider/package.json | 1 + .../react/with-apiprovider/tsconfig.json | 21 +----- .../type-portability/bundler/package.json | 1 + .../type-portability/bundler/tsconfig.json | 16 +---- .../nodenext-cjs/package.json | 1 + .../nodenext-cjs/tsconfig.json | 16 +---- .../nodenext-esm/package.json | 1 + .../nodenext-esm/tsconfig.json | 16 +---- packages/rtk-codemods/package.json | 2 + packages/rtk-codemods/tsconfig.json | 24 +------ .../rtk-query-codegen-openapi/package.json | 1 + .../rtk-query-codegen-openapi/tsconfig.json | 29 ++------ .../package.json | 1 + .../tsconfig.json | 72 ++----------------- packages/toolkit/package.json | 1 + packages/toolkit/tsconfig.base.json | 33 +-------- packages/toolkit/tsconfig.build.json | 15 ++-- packages/toolkit/tsconfig.json | 5 +- packages/toolkit/tsconfig.test.json | 16 +---- yarn.lock | 27 +++++++ 56 files changed, 139 insertions(+), 543 deletions(-) diff --git a/docs/package.json b/docs/package.json index 2eef2575c0..abfbb177e6 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,6 +2,7 @@ "name": "docs", "devDependencies": { "@manaflair/redux-batch": "^1.0.0", + "@reduxjs/tsconfig": "workspace:^", "@types/nanoid": "^2.1.0", "@types/react": "^18.0", "async-mutex": "^0.3.2", diff --git a/docs/tsconfig.json b/docs/tsconfig.json index dd2cb4f5b7..c679d476ce 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,17 +1,10 @@ { + "extends": "@reduxjs/tsconfig/base", "compilerOptions": { - "allowSyntheticDefaultImports": true, "esModuleInterop": true, - "moduleResolution": "node", - "noUnusedLocals": false, - "noUnusedParameters": false, "allowUnusedLabels": true, - "skipLibCheck": true, "noEmitOnError": false, - "strict": true, "removeComments": false, - "module": "ESNext", - "target": "ESNext", "allowJs": true, "checkJs": true, "alwaysStrict": false, diff --git a/examples/action-listener/counter/package.json b/examples/action-listener/counter/package.json index 1743b64577..b8ea951cb6 100644 --- a/examples/action-listener/counter/package.json +++ b/examples/action-listener/counter/package.json @@ -41,6 +41,7 @@ ] }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "jest-watch-typeahead": "^1.1.0" } } diff --git a/examples/action-listener/counter/tsconfig.json b/examples/action-listener/counter/tsconfig.json index 9d379a3c4a..6812fef180 100644 --- a/examples/action-listener/counter/tsconfig.json +++ b/examples/action-listener/counter/tsconfig.json @@ -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"] } diff --git a/examples/query/react/advanced/package.json b/examples/query/react/advanced/package.json index d8c2e34b32..08cbb86e4a 100644 --- a/examples/query/react/advanced/package.json +++ b/examples/query/react/advanced/package.json @@ -13,6 +13,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", "typescript": "~4.9" diff --git a/examples/query/react/advanced/tsconfig.json b/examples/query/react/advanced/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/advanced/tsconfig.json +++ b/examples/query/react/advanced/tsconfig.json @@ -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"] } diff --git a/examples/query/react/authentication-with-extrareducers/package.json b/examples/query/react/authentication-with-extrareducers/package.json index d4b648e3ed..ededbd3341 100644 --- a/examples/query/react/authentication-with-extrareducers/package.json +++ b/examples/query/react/authentication-with-extrareducers/package.json @@ -20,6 +20,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", "typescript": "~4.9" diff --git a/examples/query/react/authentication-with-extrareducers/tsconfig.json b/examples/query/react/authentication-with-extrareducers/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/authentication-with-extrareducers/tsconfig.json +++ b/examples/query/react/authentication-with-extrareducers/tsconfig.json @@ -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"] } diff --git a/examples/query/react/authentication/package.json b/examples/query/react/authentication/package.json index 01eaab4aec..2e70c287f0 100644 --- a/examples/query/react/authentication/package.json +++ b/examples/query/react/authentication/package.json @@ -20,6 +20,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", "typescript": "~4.9" diff --git a/examples/query/react/authentication/tsconfig.json b/examples/query/react/authentication/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/authentication/tsconfig.json +++ b/examples/query/react/authentication/tsconfig.json @@ -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"] } diff --git a/examples/query/react/basic/package.json b/examples/query/react/basic/package.json index 709c27b6c8..f71a36c220 100644 --- a/examples/query/react/basic/package.json +++ b/examples/query/react/basic/package.json @@ -13,6 +13,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@testing-library/react": "^13.3.0", "@types/jest": "^26.0.23", "@types/react": "^18.0.5", diff --git a/examples/query/react/basic/tsconfig.json b/examples/query/react/basic/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/basic/tsconfig.json +++ b/examples/query/react/basic/tsconfig.json @@ -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"] } diff --git a/examples/query/react/conditional-fetching/package.json b/examples/query/react/conditional-fetching/package.json index 371d14db7e..56534cd11b 100644 --- a/examples/query/react/conditional-fetching/package.json +++ b/examples/query/react/conditional-fetching/package.json @@ -13,6 +13,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", "typescript": "~4.9" diff --git a/examples/query/react/conditional-fetching/tsconfig.json b/examples/query/react/conditional-fetching/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/conditional-fetching/tsconfig.json +++ b/examples/query/react/conditional-fetching/tsconfig.json @@ -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"] } diff --git a/examples/query/react/deduping-queries/package.json b/examples/query/react/deduping-queries/package.json index 1db08cf570..23251086af 100644 --- a/examples/query/react/deduping-queries/package.json +++ b/examples/query/react/deduping-queries/package.json @@ -13,6 +13,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", "typescript": "~4.9" diff --git a/examples/query/react/deduping-queries/tsconfig.json b/examples/query/react/deduping-queries/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/deduping-queries/tsconfig.json +++ b/examples/query/react/deduping-queries/tsconfig.json @@ -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"] } diff --git a/examples/query/react/graphql-codegen/package.json b/examples/query/react/graphql-codegen/package.json index a3383139b5..9d3f26a282 100644 --- a/examples/query/react/graphql-codegen/package.json +++ b/examples/query/react/graphql-codegen/package.json @@ -33,6 +33,7 @@ "@graphql-codegen/typescript-operations": "^1.18.0", "@graphql-codegen/typescript-rtk-query": "^1.1.0", "@graphql-typed-document-node/core": "^3.1.0", + "@reduxjs/tsconfig": "workspace:^", "@types/faker": "^5.5.5", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", diff --git a/examples/query/react/graphql-codegen/tsconfig.json b/examples/query/react/graphql-codegen/tsconfig.json index 4842cab6c4..6812fef180 100644 --- a/examples/query/react/graphql-codegen/tsconfig.json +++ b/examples/query/react/graphql-codegen/tsconfig.json @@ -1,21 +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, - "baseUrl": "src" - } + "extends": "@reduxjs/tsconfig/create-react-app", + "compilerOptions": {}, + "include": ["src"] } diff --git a/examples/query/react/graphql/package.json b/examples/query/react/graphql/package.json index 17d65186a2..e96439e041 100644 --- a/examples/query/react/graphql/package.json +++ b/examples/query/react/graphql/package.json @@ -25,6 +25,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/faker": "^5.5.5", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", diff --git a/examples/query/react/graphql/tsconfig.json b/examples/query/react/graphql/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/graphql/tsconfig.json +++ b/examples/query/react/graphql/tsconfig.json @@ -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"] } diff --git a/examples/query/react/kitchen-sink/package.json b/examples/query/react/kitchen-sink/package.json index 2e1675c6fc..b1ed0e838e 100644 --- a/examples/query/react/kitchen-sink/package.json +++ b/examples/query/react/kitchen-sink/package.json @@ -15,6 +15,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@testing-library/jest-dom": "^5.11.5", "@testing-library/react": "^13.3.0", "@types/jest": "^26.0.23", diff --git a/examples/query/react/kitchen-sink/tsconfig.json b/examples/query/react/kitchen-sink/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/kitchen-sink/tsconfig.json +++ b/examples/query/react/kitchen-sink/tsconfig.json @@ -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"] } diff --git a/examples/query/react/mutations/package.json b/examples/query/react/mutations/package.json index 1715dbb44b..d375db0699 100644 --- a/examples/query/react/mutations/package.json +++ b/examples/query/react/mutations/package.json @@ -21,6 +21,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", "typescript": "~4.9" diff --git a/examples/query/react/mutations/tsconfig.json b/examples/query/react/mutations/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/mutations/tsconfig.json +++ b/examples/query/react/mutations/tsconfig.json @@ -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"] } diff --git a/examples/query/react/optimistic-update/package.json b/examples/query/react/optimistic-update/package.json index 84317eb1b2..66a56f626b 100644 --- a/examples/query/react/optimistic-update/package.json +++ b/examples/query/react/optimistic-update/package.json @@ -22,6 +22,7 @@ "uuid": "^8.3.2" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", "typescript": "~4.9", diff --git a/examples/query/react/optimistic-update/tsconfig.json b/examples/query/react/optimistic-update/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/optimistic-update/tsconfig.json +++ b/examples/query/react/optimistic-update/tsconfig.json @@ -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"] } diff --git a/examples/query/react/pagination/package.json b/examples/query/react/pagination/package.json index edec3a9c0e..a7acbc6fe0 100644 --- a/examples/query/react/pagination/package.json +++ b/examples/query/react/pagination/package.json @@ -21,6 +21,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/faker": "^5.5.5", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", diff --git a/examples/query/react/pagination/tsconfig.json b/examples/query/react/pagination/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/pagination/tsconfig.json +++ b/examples/query/react/pagination/tsconfig.json @@ -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"] } diff --git a/examples/query/react/polling/package.json b/examples/query/react/polling/package.json index 01db92d160..750af3e403 100644 --- a/examples/query/react/polling/package.json +++ b/examples/query/react/polling/package.json @@ -13,6 +13,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", "typescript": "~4.9" diff --git a/examples/query/react/polling/tsconfig.json b/examples/query/react/polling/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/polling/tsconfig.json +++ b/examples/query/react/polling/tsconfig.json @@ -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"] } diff --git a/examples/query/react/prefetching-automatic-waterfall/package.json b/examples/query/react/prefetching-automatic-waterfall/package.json index 16d3860cfb..bf2586b48d 100644 --- a/examples/query/react/prefetching-automatic-waterfall/package.json +++ b/examples/query/react/prefetching-automatic-waterfall/package.json @@ -22,6 +22,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/faker": "^5.5.5", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", diff --git a/examples/query/react/prefetching-automatic-waterfall/tsconfig.json b/examples/query/react/prefetching-automatic-waterfall/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/prefetching-automatic-waterfall/tsconfig.json +++ b/examples/query/react/prefetching-automatic-waterfall/tsconfig.json @@ -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"] } diff --git a/examples/query/react/prefetching-automatic/package.json b/examples/query/react/prefetching-automatic/package.json index d1daa496c3..53c22a450f 100644 --- a/examples/query/react/prefetching-automatic/package.json +++ b/examples/query/react/prefetching-automatic/package.json @@ -22,6 +22,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/faker": "^5.5.5", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", diff --git a/examples/query/react/prefetching-automatic/tsconfig.json b/examples/query/react/prefetching-automatic/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/prefetching-automatic/tsconfig.json +++ b/examples/query/react/prefetching-automatic/tsconfig.json @@ -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"] } diff --git a/examples/query/react/prefetching/package.json b/examples/query/react/prefetching/package.json index 5ef7c8a136..ff0c4391a8 100644 --- a/examples/query/react/prefetching/package.json +++ b/examples/query/react/prefetching/package.json @@ -22,6 +22,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/faker": "^5.5.5", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", diff --git a/examples/query/react/prefetching/tsconfig.json b/examples/query/react/prefetching/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/prefetching/tsconfig.json +++ b/examples/query/react/prefetching/tsconfig.json @@ -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"] } diff --git a/examples/query/react/with-apiprovider/package.json b/examples/query/react/with-apiprovider/package.json index 6895d5981d..52339fc83b 100644 --- a/examples/query/react/with-apiprovider/package.json +++ b/examples/query/react/with-apiprovider/package.json @@ -13,6 +13,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/react": "^18.0.5", "@types/react-dom": "^18.0.5", "typescript": "~4.9" diff --git a/examples/query/react/with-apiprovider/tsconfig.json b/examples/query/react/with-apiprovider/tsconfig.json index 2e7afa3896..6812fef180 100644 --- a/examples/query/react/with-apiprovider/tsconfig.json +++ b/examples/query/react/with-apiprovider/tsconfig.json @@ -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"] } diff --git a/examples/type-portability/bundler/package.json b/examples/type-portability/bundler/package.json index 895920e39a..ff9b0a3ab5 100644 --- a/examples/type-portability/bundler/package.json +++ b/examples/type-portability/bundler/package.json @@ -14,6 +14,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/node": "^20.14.11", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", diff --git a/examples/type-portability/bundler/tsconfig.json b/examples/type-portability/bundler/tsconfig.json index cf66260624..276ea2856e 100644 --- a/examples/type-portability/bundler/tsconfig.json +++ b/examples/type-portability/bundler/tsconfig.json @@ -1,27 +1,13 @@ { + "extends": "@reduxjs/tsconfig/bundler/esnext", "compilerOptions": { "allowJs": true, - "allowSyntheticDefaultImports": true, "checkJs": true, - "declaration": true, "emitDeclarationOnly": false, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, "jsx": "react-jsx", - "module": "ESNext", - "moduleResolution": "Bundler", "noEmit": false, "noEmitOnError": true, - "noErrorTruncation": true, - "noFallthroughCasesInSwitch": true, "outDir": "./dist", - "resolveJsonModule": true, - "skipLibCheck": true, - "strict": true, - "target": "ESNext", - "useDefineForClassFields": true, - "useUnknownInCatchVariables": true, "verbatimModuleSyntax": true }, "include": ["src"] diff --git a/examples/type-portability/nodenext-cjs/package.json b/examples/type-portability/nodenext-cjs/package.json index 79ba210383..4c61599416 100644 --- a/examples/type-portability/nodenext-cjs/package.json +++ b/examples/type-portability/nodenext-cjs/package.json @@ -15,6 +15,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/node": "^20.14.11", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", diff --git a/examples/type-portability/nodenext-cjs/tsconfig.json b/examples/type-portability/nodenext-cjs/tsconfig.json index 4287809949..26ccdbcd8e 100644 --- a/examples/type-portability/nodenext-cjs/tsconfig.json +++ b/examples/type-portability/nodenext-cjs/tsconfig.json @@ -1,27 +1,13 @@ { + "extends": "@reduxjs/tsconfig/node-next", "compilerOptions": { "allowJs": true, - "allowSyntheticDefaultImports": true, "checkJs": true, - "declaration": true, "emitDeclarationOnly": false, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, "jsx": "react-jsx", - "module": "NodeNext", - "moduleResolution": "NodeNext", "noEmit": false, "noEmitOnError": true, - "noErrorTruncation": true, - "noFallthroughCasesInSwitch": true, "outDir": "./dist", - "resolveJsonModule": true, - "skipLibCheck": true, - "strict": true, - "target": "ESNext", - "useDefineForClassFields": true, - "useUnknownInCatchVariables": true, "verbatimModuleSyntax": true }, "include": ["src"] diff --git a/examples/type-portability/nodenext-esm/package.json b/examples/type-portability/nodenext-esm/package.json index 95534bc103..54d1a6a830 100644 --- a/examples/type-portability/nodenext-esm/package.json +++ b/examples/type-portability/nodenext-esm/package.json @@ -15,6 +15,7 @@ "react-scripts": "5.0.1" }, "devDependencies": { + "@reduxjs/tsconfig": "workspace:^", "@types/node": "^20.14.11", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", diff --git a/examples/type-portability/nodenext-esm/tsconfig.json b/examples/type-portability/nodenext-esm/tsconfig.json index 4287809949..26ccdbcd8e 100644 --- a/examples/type-portability/nodenext-esm/tsconfig.json +++ b/examples/type-portability/nodenext-esm/tsconfig.json @@ -1,27 +1,13 @@ { + "extends": "@reduxjs/tsconfig/node-next", "compilerOptions": { "allowJs": true, - "allowSyntheticDefaultImports": true, "checkJs": true, - "declaration": true, "emitDeclarationOnly": false, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, "jsx": "react-jsx", - "module": "NodeNext", - "moduleResolution": "NodeNext", "noEmit": false, "noEmitOnError": true, - "noErrorTruncation": true, - "noFallthroughCasesInSwitch": true, "outDir": "./dist", - "resolveJsonModule": true, - "skipLibCheck": true, - "strict": true, - "target": "ESNext", - "useDefineForClassFields": true, - "useUnknownInCatchVariables": true, "verbatimModuleSyntax": true }, "include": ["src"] diff --git a/packages/rtk-codemods/package.json b/packages/rtk-codemods/package.json index 604977cd21..7fd6c133fd 100644 --- a/packages/rtk-codemods/package.json +++ b/packages/rtk-codemods/package.json @@ -34,6 +34,8 @@ "devDependencies": { "@reduxjs/eslint-config": "workspace:^", "@reduxjs/prettier-config": "workspace:^", + "@reduxjs/toolkit": "workspace:^", + "@reduxjs/tsconfig": "workspace:^", "@types/jscodeshift": "^0.11.11", "eslint": "^9.11.1", "jiti": "^2.0.0", diff --git a/packages/rtk-codemods/tsconfig.json b/packages/rtk-codemods/tsconfig.json index 0f323fb7c5..8493249869 100644 --- a/packages/rtk-codemods/tsconfig.json +++ b/packages/rtk-codemods/tsconfig.json @@ -1,28 +1,10 @@ { + "extends": "@reduxjs/tsconfig/base", "compilerOptions": { - "allowSyntheticDefaultImports": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "isolatedModules": true, "checkJs": true, - "baseUrl": ".", "noEmit": true, - "strict": true, - "target": "ESNext", - "module": "ESNext", - "moduleResolution": "Node", - "esModuleInterop": true, - "skipLibCheck": true, "allowJs": true, - "jsx": "preserve", - "noErrorTruncation": true, - "forceConsistentCasingInFileNames": true, - "paths": { - "@reduxjs/toolkit": ["../toolkit/src/index.ts"], // @remap-prod-remove-line - "@reduxjs/toolkit/query": ["../toolkit/src/query/index.ts"], // @remap-prod-remove-line - "@reduxjs/toolkit/react": ["../toolkit/src/react/index.ts"], // @remap-prod-remove-line - "@reduxjs/toolkit/query/react": ["../toolkit/src/query/react/index.ts"] // @remap-prod-remove-line - } + "jsx": "preserve" }, - "include": ["**/*.ts", "**/*.tsx", "bin/cli.mjs"] + "exclude": ["**/__testfixtures__/**"] } diff --git a/packages/rtk-query-codegen-openapi/package.json b/packages/rtk-query-codegen-openapi/package.json index 602e34d3e0..a12830b612 100644 --- a/packages/rtk-query-codegen-openapi/package.json +++ b/packages/rtk-query-codegen-openapi/package.json @@ -54,6 +54,7 @@ "@oazapfts/runtime": "^1.0.3", "@reduxjs/prettier-config": "workspace:^", "@reduxjs/toolkit": "^1.6.0", + "@reduxjs/tsconfig": "workspace:^", "@types/commander": "^2.12.2", "@types/glob-to-regexp": "^0.4.0", "@types/lodash.camelcase": "^4.3.9", diff --git a/packages/rtk-query-codegen-openapi/tsconfig.json b/packages/rtk-query-codegen-openapi/tsconfig.json index 3774910f1d..fb6e31810c 100644 --- a/packages/rtk-query-codegen-openapi/tsconfig.json +++ b/packages/rtk-query-codegen-openapi/tsconfig.json @@ -1,29 +1,8 @@ { + "extends": "@reduxjs/tsconfig/bundler/esnext", "compilerOptions": { - "allowJs": true, - "allowSyntheticDefaultImports": true, - "checkJs": true, - "declaration": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "jsx": "react", - "module": "ESNext", - "moduleResolution": "Bundler", - "noEmit": true, - "noErrorTruncation": true, - "noImplicitReturns": true, - "noUnusedLocals": false, "outDir": "lib", - "rootDir": ".", - "paths": { - "@rtk-query/codegen-openapi": ["./src/index.ts"] // @remap-prod-remove-line - }, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "target": "ESNext", - "types": ["vitest/globals", "vitest/importMeta"] - } + "rootDir": "src" + }, + "exclude": ["test", "lib", "vitest.config.mts"] } diff --git a/packages/rtk-query-graphql-request-base-query/package.json b/packages/rtk-query-graphql-request-base-query/package.json index d3f5301089..093365de08 100644 --- a/packages/rtk-query-graphql-request-base-query/package.json +++ b/packages/rtk-query-graphql-request-base-query/package.json @@ -32,6 +32,7 @@ }, "devDependencies": { "@reduxjs/toolkit": "^1.6.0 || ^2.0.0", + "@reduxjs/tsconfig": "workspace:^", "graphql": "^16.5.0", "microbundle": "^0.13.3", "rimraf": "^3.0.2", diff --git a/packages/rtk-query-graphql-request-base-query/tsconfig.json b/packages/rtk-query-graphql-request-base-query/tsconfig.json index 1e6ed61d6e..77e5b0889c 100644 --- a/packages/rtk-query-graphql-request-base-query/tsconfig.json +++ b/packages/rtk-query-graphql-request-base-query/tsconfig.json @@ -1,73 +1,9 @@ { + "extends": "@reduxjs/tsconfig/base", "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - - /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - // "lib": [], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ - // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - - /* Strict Type-Checking Options */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ - - /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - - /* Experimental Options */ - // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ - // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - - /* Advanced Options */ - "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + "module": "CommonJS", + "outDir": "./dist", + "target": "ES5" }, "include": ["**/*.ts"] } diff --git a/packages/toolkit/package.json b/packages/toolkit/package.json index 93b3d1c441..625bcbc5a2 100644 --- a/packages/toolkit/package.json +++ b/packages/toolkit/package.json @@ -56,6 +56,7 @@ "@phryneas/ts-version": "^1.0.2", "@reduxjs/eslint-config": "workspace:^", "@reduxjs/prettier-config": "workspace:^", + "@reduxjs/tsconfig": "workspace:^", "@size-limit/file": "^11.0.1", "@size-limit/webpack": "^11.0.1", "@testing-library/react": "^13.3.0", diff --git a/packages/toolkit/tsconfig.base.json b/packages/toolkit/tsconfig.base.json index a1981275f3..9dfc77bfa8 100644 --- a/packages/toolkit/tsconfig.base.json +++ b/packages/toolkit/tsconfig.base.json @@ -1,37 +1,8 @@ { + "extends": "@reduxjs/tsconfig/base", "compilerOptions": { - "target": "ESnext", - "module": "ESnext", - "lib": ["DOM", "ESNext"], - "importHelpers": true, - // output .d.ts declaration files for consumers - "declaration": true, - // match output dir to input dir. e.g. dist/index instead of dist/src/index "rootDir": "./src", - // stricter type-checking for stronger correctness. Recommended by TS - "strict": true, - // linter checks for common issues - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - // noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative - "noUnusedLocals": false, - "noUnusedParameters": false, - // use Node's module resolution algorithm, instead of the legacy TS one - "moduleResolution": "Node", - // transpile JSX to React.createElement - "jsx": "react", - // interop between ESM and CJS modules. Recommended by TS - "esModuleInterop": true, - // significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS - "skipLibCheck": true, - // error out if import and file system have a casing mismatch. Recommended by TS - "forceConsistentCasingInFileNames": true, - // ensure that each file can be safely transpiled by babel (etc.) without relying on other imports - "isolatedModules": true, - "downlevelIteration": false, - "allowSyntheticDefaultImports": true, - "emitDeclarationOnly": true, - "types": ["vitest/globals", "vitest/importMeta"], + "jsx": "react-jsx", "paths": { "@reduxjs/toolkit": ["./src/index.ts"], // @remap-prod-remove-line "@reduxjs/toolkit/react": ["./src/react/index.ts"], // @remap-prod-remove-line diff --git a/packages/toolkit/tsconfig.build.json b/packages/toolkit/tsconfig.build.json index c643ccc7c0..7c169d5135 100644 --- a/packages/toolkit/tsconfig.build.json +++ b/packages/toolkit/tsconfig.build.json @@ -2,14 +2,17 @@ // For building the library. "extends": "./tsconfig.base.json", "compilerOptions": { - "outDir": "dist" + "emitDeclarationOnly": true, + "jsx": "react", + "outDir": "./dist", + "rootDir": "./src" }, - "include": ["src"], "exclude": [ - "src/**/*.test.ts*", "src/**/*.test-d.ts*", + "src/**/*.spec-d.ts*", + "src/**/*.test.ts*", "src/**/*.spec.ts*", - "src/**/tests/*", - "src/**/*.typetest.ts*" - ] + "src/**/tests/*" + ], + "include": ["src"] } diff --git a/packages/toolkit/tsconfig.json b/packages/toolkit/tsconfig.json index 2c4a93a02e..0999f8f315 100644 --- a/packages/toolkit/tsconfig.json +++ b/packages/toolkit/tsconfig.json @@ -4,8 +4,9 @@ // we are using during development. "extends": "./tsconfig.test.json", "compilerOptions": { - "skipLibCheck": true, - "rootDir": "." + "allowJs": true, + "checkJs": true, + "rootDir": "./" }, "include": ["."] } diff --git a/packages/toolkit/tsconfig.test.json b/packages/toolkit/tsconfig.test.json index 2bb74da6da..7e794b70c6 100644 --- a/packages/toolkit/tsconfig.test.json +++ b/packages/toolkit/tsconfig.test.json @@ -1,20 +1,10 @@ { - // For runtime and type tests during CI. + // For type tests during CI. "extends": "./tsconfig.base.json", "compilerOptions": { - "emitDeclarationOnly": false, "noEmit": true, - "rootDir": "./src", - "jsx": "react-jsx", - "skipLibCheck": true, - "noImplicitReturns": false + "rootDir": "./src" }, "exclude": ["dist"], - "include": [ - "src/**/*.test.ts*", - "src/**/*.test-d.ts*", - "src/**/*.spec.ts*", - "src/**/tests/**/*", - "src/**/*.typetest.ts*" - ] + "include": ["src/**/*.test-d.ts*", "src/**/*.spec-d.ts*"] } diff --git a/yarn.lock b/yarn.lock index b7491e4a45..8866095b65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4376,6 +4376,7 @@ __metadata: resolution: "@examples-action-listener/counter@workspace:examples/action-listener/counter" dependencies: "@reduxjs/toolkit": "npm:^1.8.0" + "@reduxjs/tsconfig": "workspace:^" "@types/node": "npm:^12.0.0" "@types/react": "npm:^18.0.12" "@types/react-dom": "npm:^18.0.5" @@ -4394,6 +4395,7 @@ __metadata: resolution: "@examples-query-react/advanced@workspace:examples/query/react/advanced" dependencies: "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" react: "npm:^18.1.0" @@ -4412,6 +4414,7 @@ __metadata: "@emotion/react": "npm:^11.4.0" "@emotion/styled": "npm:^11.3.0" "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" framer-motion: "npm:^2.9.5" @@ -4434,6 +4437,7 @@ __metadata: "@emotion/react": "npm:^11.4.0" "@emotion/styled": "npm:^11.3.0" "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" framer-motion: "npm:^2.9.5" @@ -4453,6 +4457,7 @@ __metadata: resolution: "@examples-query-react/basic@workspace:examples/query/react/basic" dependencies: "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@testing-library/react": "npm:^13.3.0" "@types/jest": "npm:^26.0.23" "@types/react": "npm:^18.0.5" @@ -4471,6 +4476,7 @@ __metadata: resolution: "@examples-query-react/conditional-fetching@workspace:examples/query/react/conditional-fetching" dependencies: "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" react: "npm:^18.1.0" @@ -4486,6 +4492,7 @@ __metadata: resolution: "@examples-query-react/deduping-queries@workspace:examples/query/react/deduping-queries" dependencies: "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" react: "npm:^18.1.0" @@ -4514,6 +4521,7 @@ __metadata: "@graphql-typed-document-node/core": "npm:^3.1.0" "@mswjs/data": "npm:^0.4.0" "@reduxjs/toolkit": "npm:^1.6.0" + "@reduxjs/tsconfig": "workspace:^" "@rtk-query/graphql-request-base-query": "npm:^2.0.0" "@types/faker": "npm:^5.5.5" "@types/react": "npm:^18.0.5" @@ -4546,6 +4554,7 @@ __metadata: "@emotion/styled": "npm:^11.3.0" "@mswjs/data": "npm:^0.3.0" "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@rtk-query/graphql-request-base-query": "npm:^2.0.0" "@types/faker": "npm:^5.5.5" "@types/react": "npm:^18.0.5" @@ -4570,6 +4579,7 @@ __metadata: resolution: "@examples-query-react/kitchen-sink@workspace:examples/query/react/kitchen-sink" dependencies: "@reduxjs/toolkit": "npm:1.8.1" + "@reduxjs/tsconfig": "workspace:^" "@testing-library/jest-dom": "npm:^5.11.5" "@testing-library/react": "npm:^13.3.0" "@types/jest": "npm:^26.0.23" @@ -4596,6 +4606,7 @@ __metadata: "@emotion/styled": "npm:^11.3.0" "@mswjs/data": "npm:^0.3.0" "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" framer-motion: "npm:^2.9.5" @@ -4619,6 +4630,7 @@ __metadata: "@emotion/styled": "npm:^11.3.0" "@mswjs/data": "npm:^0.3.0" "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" framer-motion: "npm:^2.9.5" @@ -4644,6 +4656,7 @@ __metadata: "@emotion/styled": "npm:^11.3.0" "@mswjs/data": "npm:^0.3.0" "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/faker": "npm:^5.5.5" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" @@ -4664,6 +4677,7 @@ __metadata: resolution: "@examples-query-react/polling@workspace:examples/query/react/polling" dependencies: "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" react: "npm:^18.1.0" @@ -4683,6 +4697,7 @@ __metadata: "@emotion/styled": "npm:^11.3.0" "@mswjs/data": "npm:^0.3.0" "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/faker": "npm:^5.5.5" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" @@ -4708,6 +4723,7 @@ __metadata: "@emotion/styled": "npm:^11.3.0" "@mswjs/data": "npm:^0.3.0" "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/faker": "npm:^5.5.5" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" @@ -4733,6 +4749,7 @@ __metadata: "@emotion/styled": "npm:^11.3.0" "@mswjs/data": "npm:^0.3.0" "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/faker": "npm:^5.5.5" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" @@ -4754,6 +4771,7 @@ __metadata: resolution: "@examples-query-react/with-apiprovider@workspace:examples/query/react/with-apiprovider" dependencies: "@reduxjs/toolkit": "npm:^1.6.0-rc.1" + "@reduxjs/tsconfig": "workspace:^" "@types/react": "npm:^18.0.5" "@types/react-dom": "npm:^18.0.5" react: "npm:^18.1.0" @@ -4769,6 +4787,7 @@ __metadata: resolution: "@examples-type-portability/bundler@workspace:examples/type-portability/bundler" dependencies: "@reduxjs/toolkit": "workspace:^" + "@reduxjs/tsconfig": "workspace:^" "@types/node": "npm:^20.14.11" "@types/react": "npm:^18.3.3" "@types/react-dom": "npm:^18.3.0" @@ -4786,6 +4805,7 @@ __metadata: resolution: "@examples-type-portability/nodenext-cjs@workspace:examples/type-portability/nodenext-cjs" dependencies: "@reduxjs/toolkit": "workspace:^" + "@reduxjs/tsconfig": "workspace:^" "@types/node": "npm:^20.14.11" "@types/react": "npm:^18.3.3" "@types/react-dom": "npm:^18.3.0" @@ -4803,6 +4823,7 @@ __metadata: resolution: "@examples-type-portability/nodenext-esm@workspace:examples/type-portability/nodenext-esm" dependencies: "@reduxjs/toolkit": "workspace:^" + "@reduxjs/tsconfig": "workspace:^" "@types/node": "npm:^20.14.11" "@types/react": "npm:^18.3.3" "@types/react-dom": "npm:^18.3.0" @@ -6548,6 +6569,8 @@ __metadata: dependencies: "@reduxjs/eslint-config": "workspace:^" "@reduxjs/prettier-config": "workspace:^" + "@reduxjs/toolkit": "workspace:^" + "@reduxjs/tsconfig": "workspace:^" "@types/jscodeshift": "npm:^0.11.11" eslint: "npm:^9.11.1" execa: "npm:^8.0.1" @@ -6634,6 +6657,7 @@ __metadata: "@phryneas/ts-version": "npm:^1.0.2" "@reduxjs/eslint-config": "workspace:^" "@reduxjs/prettier-config": "workspace:^" + "@reduxjs/tsconfig": "workspace:^" "@size-limit/file": "npm:^11.0.1" "@size-limit/webpack": "npm:^11.0.1" "@testing-library/react": "npm:^13.3.0" @@ -6941,6 +6965,7 @@ __metadata: "@oazapfts/runtime": "npm:^1.0.3" "@reduxjs/prettier-config": "workspace:^" "@reduxjs/toolkit": "npm:^1.6.0" + "@reduxjs/tsconfig": "workspace:^" "@types/commander": "npm:^2.12.2" "@types/glob-to-regexp": "npm:^0.4.0" "@types/lodash.camelcase": "npm:^4.3.9" @@ -6990,6 +7015,7 @@ __metadata: resolution: "@rtk-query/graphql-request-base-query@workspace:packages/rtk-query-graphql-request-base-query" dependencies: "@reduxjs/toolkit": "npm:^1.6.0 || ^2.0.0" + "@reduxjs/tsconfig": "workspace:^" graphql: "npm:^16.5.0" graphql-request: "npm:^4.0.0 || ^5.0.0 || ^6.0.0" microbundle: "npm:^0.13.3" @@ -12857,6 +12883,7 @@ __metadata: resolution: "docs@workspace:docs" dependencies: "@manaflair/redux-batch": "npm:^1.0.0" + "@reduxjs/tsconfig": "workspace:^" "@types/nanoid": "npm:^2.1.0" "@types/react": "npm:^18.0" async-mutex: "npm:^0.3.2"