Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
59 changes: 27 additions & 32 deletions packages/toolkit/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion packages/toolkit/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// For building the library.
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "dist"
"noEmit": false
},
"include": ["src"],
"exclude": [
Expand Down
6 changes: 3 additions & 3 deletions packages/toolkit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
7 changes: 1 addition & 6 deletions packages/toolkit/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
Loading