diff --git a/docs/api/createSelector.mdx b/docs/api/createSelector.mdx index b8b2a96c2b..8697eb84d7 100644 --- a/docs/api/createSelector.mdx +++ b/docs/api/createSelector.mdx @@ -94,7 +94,8 @@ const draftSafeSelector = createWeakMapDraftSafeSelector( As of RTK 2.1, you can define a "pre-typed" version of `createDraftSafeSelector` that can have the type for `state` built in. This lets you set up those types once, so you don't have to repeat them each time you call `createDraftSafeSelector`. ```ts no-transpile -const createTypedDraftSafeSelector = createDraftSafeSelector.withTypes() +const createTypedDraftSafeSelector = + createDraftSafeSelector.withTypes() ``` Import and use the pre-typed `createTypedDraftSafeSelector` function, and it will automatically know that the `state` argument is of type `RootState`. @@ -125,13 +126,14 @@ export interface RootState { alerts: Alert[] } -export const createTypedDraftSafeSelector = createDraftSafeSelector.withTypes() +export const createTypedDraftSafeSelector = + createDraftSafeSelector.withTypes() const selectTodoIds = createTypedDraftSafeSelector( // Type of `state` is set to `RootState`, no need to manually set the type - state => state.todos, + (state) => state.todos, // ❌ Known limitation: Parameter types are not inferred in this scenario // so you will have to manually annotate them. - (todos: Todo[]) => todos.map(({ id }) => id) + (todos: Todo[]) => todos.map(({ id }) => id), ) ``` diff --git a/docs/tsconfig.json b/docs/tsconfig.json index 200ffa3ffe..dd2cb4f5b7 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -23,15 +23,13 @@ "@reduxjs/toolkit": ["packages/toolkit/src/index.ts"], "@reduxjs/toolkit/query": ["packages/toolkit/src/query/index.ts"], "@reduxjs/toolkit/query/react": [ - "packages/toolkit/src/query/react/index.ts", + "packages/toolkit/src/query/react/index.ts" ], "@reduxjs/toolkit/dist/query/*": ["packages/toolkit/src/query/*"], "@virtual/*": ["docs/virtual/*"], "your-cool-library": ["docs/virtual/your-cool-library/index.ts"], "redux-logger": ["docs/virtual/redux-logger/index.ts"], - "petstore-api.generated": [ - "docs/virtual/petstore-api.generated/index.ts", - ], - }, - }, + "petstore-api.generated": ["docs/virtual/petstore-api.generated/index.ts"] + } + } } diff --git a/examples/publish-ci/expo/tsconfig.json b/examples/publish-ci/expo/tsconfig.json index 3e1301fd50..b9567f6052 100644 --- a/examples/publish-ci/expo/tsconfig.json +++ b/examples/publish-ci/expo/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "expo/tsconfig.base", "compilerOptions": { - "strict": true, - }, + "strict": true + } } diff --git a/examples/publish-ci/react-native/tsconfig.json b/examples/publish-ci/react-native/tsconfig.json index 13b5ca4f73..304ab4e2d8 100644 --- a/examples/publish-ci/react-native/tsconfig.json +++ b/examples/publish-ci/react-native/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "@react-native/typescript-config/tsconfig.json", + "extends": "@react-native/typescript-config/tsconfig.json" } diff --git a/packages/rtk-query-codegen-openapi/test/tsconfig.json b/packages/rtk-query-codegen-openapi/test/tsconfig.json index ff5d70bd4a..531a1fac66 100644 --- a/packages/rtk-query-codegen-openapi/test/tsconfig.json +++ b/packages/rtk-query-codegen-openapi/test/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "paths": { "@/*": ["./test/fixtures/*"], - "@rtk-query/codegen-openapi": ["./src"], + "@rtk-query/codegen-openapi": ["./src"] }, "allowSyntheticDefaultImports": true, "esModuleInterop": true, @@ -16,6 +16,6 @@ "resolveJsonModule": true, "types": ["vitest/globals", "vitest/importMeta"], "allowJs": true, - "checkJs": true, - }, + "checkJs": true + } } diff --git a/packages/rtk-query-codegen-openapi/tsconfig.json b/packages/rtk-query-codegen-openapi/tsconfig.json index bc78ba4456..a2d81b5bee 100644 --- a/packages/rtk-query-codegen-openapi/tsconfig.json +++ b/packages/rtk-query-codegen-openapi/tsconfig.json @@ -13,7 +13,7 @@ "types": ["vitest/globals", "vitest/importMeta"], "esModuleInterop": true, "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, + "forceConsistentCasingInFileNames": true }, - "exclude": ["test", "lib", "vitest.config.mts"], + "exclude": ["test", "lib", "vitest.config.mts"] } diff --git a/packages/rtk-query-graphql-request-base-query/tsconfig.json b/packages/rtk-query-graphql-request-base-query/tsconfig.json index 076aee3602..1e6ed61d6e 100644 --- a/packages/rtk-query-graphql-request-base-query/tsconfig.json +++ b/packages/rtk-query-graphql-request-base-query/tsconfig.json @@ -67,7 +67,7 @@ /* Advanced Options */ "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */, + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ }, - "include": ["**/*.ts"], + "include": ["**/*.ts"] } diff --git a/packages/toolkit/tsconfig.json b/packages/toolkit/tsconfig.json index f485db8fd3..2c4a93a02e 100644 --- a/packages/toolkit/tsconfig.json +++ b/packages/toolkit/tsconfig.json @@ -5,7 +5,7 @@ "extends": "./tsconfig.test.json", "compilerOptions": { "skipLibCheck": true, - "rootDir": ".", + "rootDir": "." }, - "include": ["."], + "include": ["."] }