diff --git a/packages/toolkit/tsconfig.base.json b/packages/toolkit/tsconfig.base.json index efa47af4ac..3ce3355050 100644 --- a/packages/toolkit/tsconfig.base.json +++ b/packages/toolkit/tsconfig.base.json @@ -1,44 +1,39 @@ { "compilerOptions": { - "target": "ESnext", - "module": "ESnext", - "lib": ["DOM", "ESNext"], - "importHelpers": true, - // output .d.ts declaration files for consumers + "allowSyntheticDefaultImports": true, "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 + "declarationMap": true, "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", "node"], + "jsx": "react", + "lib": ["DOM", "ESNext"], + "module": "esnext", + "moduleDetection": "force", + "moduleResolution": "bundler", + "noEmit": true, + "noEmitOnError": true, + "noErrorTruncation": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "outDir": "./dist", "paths": { + // internal imports in tests only + "@internal/*": ["./src/*"], "@reduxjs/toolkit": ["./src/index.ts"], // @remap-prod-remove-line - "@reduxjs/toolkit/react": ["./src/react/index.ts"], // @remap-prod-remove-line "@reduxjs/toolkit/query": ["./src/query/index.ts"], // @remap-prod-remove-line "@reduxjs/toolkit/query/react": ["./src/query/react/index.ts"], // @remap-prod-remove-line - // internal imports in tests only - "@internal/*": ["./src/*"] - } + "@reduxjs/toolkit/react": ["./src/react/index.ts"] // @remap-prod-remove-line + }, + "resolveJsonModule": true, + "rootDir": "./src", + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "target": "esnext", + "types": ["node", "vitest/globals", "vitest/importMeta"], + "useDefineForClassFields": true, + "useUnknownInCatchVariables": true } } diff --git a/packages/toolkit/tsconfig.build.json b/packages/toolkit/tsconfig.build.json index c643ccc7c0..5eb75fec9e 100644 --- a/packages/toolkit/tsconfig.build.json +++ b/packages/toolkit/tsconfig.build.json @@ -2,7 +2,7 @@ // For building the library. "extends": "./tsconfig.base.json", "compilerOptions": { - "outDir": "dist" + "noEmit": false }, "include": ["src"], "exclude": [ diff --git a/packages/toolkit/tsconfig.json b/packages/toolkit/tsconfig.json index 2c4a93a02e..9b9d63d01f 100644 --- a/packages/toolkit/tsconfig.json +++ b/packages/toolkit/tsconfig.json @@ -4,8 +4,8 @@ // we are using during development. "extends": "./tsconfig.test.json", "compilerOptions": { - "skipLibCheck": true, - "rootDir": "." + "rootDir": "./" }, - "include": ["."] + "include": ["."], + "exclude": ["dist", "scripts/issue-triage"] } diff --git a/packages/toolkit/tsconfig.test.json b/packages/toolkit/tsconfig.test.json index 2bb74da6da..990b84a796 100644 --- a/packages/toolkit/tsconfig.test.json +++ b/packages/toolkit/tsconfig.test.json @@ -2,12 +2,7 @@ // For runtime and type tests during CI. "extends": "./tsconfig.base.json", "compilerOptions": { - "emitDeclarationOnly": false, - "noEmit": true, - "rootDir": "./src", - "jsx": "react-jsx", - "skipLibCheck": true, - "noImplicitReturns": false + "jsx": "react-jsx" }, "exclude": ["dist"], "include": [