From 22322c9acc3197e43337b5415755823f09f410fe Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Sun, 2 Oct 2022 16:04:22 +0300 Subject: [PATCH] refactor: use a single root tsconfig for type tests (#13358) --- packages/expect-utils/__typetests__/tsconfig.json | 10 +--------- packages/expect/__typetests__/tsconfig.json | 10 +--------- packages/jest-expect/__typetests__/tsconfig.json | 10 +--------- packages/jest-mock/__typetests__/tsconfig.json | 7 +------ packages/jest-reporters/__typetests__/tsconfig.json | 10 +--------- packages/jest-resolve/__typetests__/tsconfig.json | 10 +--------- packages/jest-runner/__typetests__/tsconfig.json | 10 +--------- packages/jest-snapshot/__typetests__/tsconfig.json | 10 +--------- packages/jest-types/__typetests__/tsconfig.json | 10 +--------- packages/jest-worker/__typetests__/tsconfig.json | 7 +------ packages/jest/__typetests__/tsconfig.json | 10 +--------- tsconfig.typetest.json | 13 +++++++++++++ 12 files changed, 24 insertions(+), 93 deletions(-) create mode 100644 tsconfig.typetest.json diff --git a/packages/expect-utils/__typetests__/tsconfig.json b/packages/expect-utils/__typetests__/tsconfig.json index 165ba1343021..c40dd08441df 100644 --- a/packages/expect-utils/__typetests__/tsconfig.json +++ b/packages/expect-utils/__typetests__/tsconfig.json @@ -1,12 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - - "types": [] - }, + "extends": "../../../tsconfig.typetest.json", "include": ["./**/*"] } diff --git a/packages/expect/__typetests__/tsconfig.json b/packages/expect/__typetests__/tsconfig.json index 165ba1343021..c40dd08441df 100644 --- a/packages/expect/__typetests__/tsconfig.json +++ b/packages/expect/__typetests__/tsconfig.json @@ -1,12 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - - "types": [] - }, + "extends": "../../../tsconfig.typetest.json", "include": ["./**/*"] } diff --git a/packages/jest-expect/__typetests__/tsconfig.json b/packages/jest-expect/__typetests__/tsconfig.json index 165ba1343021..c40dd08441df 100644 --- a/packages/jest-expect/__typetests__/tsconfig.json +++ b/packages/jest-expect/__typetests__/tsconfig.json @@ -1,12 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - - "types": [] - }, + "extends": "../../../tsconfig.typetest.json", "include": ["./**/*"] } diff --git a/packages/jest-mock/__typetests__/tsconfig.json b/packages/jest-mock/__typetests__/tsconfig.json index d1974ed987b7..0bfc4191f022 100644 --- a/packages/jest-mock/__typetests__/tsconfig.json +++ b/packages/jest-mock/__typetests__/tsconfig.json @@ -1,11 +1,6 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.typetest.json", "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - "types": ["node"] }, "include": ["./**/*"] diff --git a/packages/jest-reporters/__typetests__/tsconfig.json b/packages/jest-reporters/__typetests__/tsconfig.json index 165ba1343021..c40dd08441df 100644 --- a/packages/jest-reporters/__typetests__/tsconfig.json +++ b/packages/jest-reporters/__typetests__/tsconfig.json @@ -1,12 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - - "types": [] - }, + "extends": "../../../tsconfig.typetest.json", "include": ["./**/*"] } diff --git a/packages/jest-resolve/__typetests__/tsconfig.json b/packages/jest-resolve/__typetests__/tsconfig.json index 165ba1343021..c40dd08441df 100644 --- a/packages/jest-resolve/__typetests__/tsconfig.json +++ b/packages/jest-resolve/__typetests__/tsconfig.json @@ -1,12 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - - "types": [] - }, + "extends": "../../../tsconfig.typetest.json", "include": ["./**/*"] } diff --git a/packages/jest-runner/__typetests__/tsconfig.json b/packages/jest-runner/__typetests__/tsconfig.json index 165ba1343021..c40dd08441df 100644 --- a/packages/jest-runner/__typetests__/tsconfig.json +++ b/packages/jest-runner/__typetests__/tsconfig.json @@ -1,12 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - - "types": [] - }, + "extends": "../../../tsconfig.typetest.json", "include": ["./**/*"] } diff --git a/packages/jest-snapshot/__typetests__/tsconfig.json b/packages/jest-snapshot/__typetests__/tsconfig.json index 165ba1343021..c40dd08441df 100644 --- a/packages/jest-snapshot/__typetests__/tsconfig.json +++ b/packages/jest-snapshot/__typetests__/tsconfig.json @@ -1,12 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - - "types": [] - }, + "extends": "../../../tsconfig.typetest.json", "include": ["./**/*"] } diff --git a/packages/jest-types/__typetests__/tsconfig.json b/packages/jest-types/__typetests__/tsconfig.json index 165ba1343021..c40dd08441df 100644 --- a/packages/jest-types/__typetests__/tsconfig.json +++ b/packages/jest-types/__typetests__/tsconfig.json @@ -1,12 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - - "types": [] - }, + "extends": "../../../tsconfig.typetest.json", "include": ["./**/*"] } diff --git a/packages/jest-worker/__typetests__/tsconfig.json b/packages/jest-worker/__typetests__/tsconfig.json index d1974ed987b7..0bfc4191f022 100644 --- a/packages/jest-worker/__typetests__/tsconfig.json +++ b/packages/jest-worker/__typetests__/tsconfig.json @@ -1,11 +1,6 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.typetest.json", "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - "types": ["node"] }, "include": ["./**/*"] diff --git a/packages/jest/__typetests__/tsconfig.json b/packages/jest/__typetests__/tsconfig.json index 165ba1343021..c40dd08441df 100644 --- a/packages/jest/__typetests__/tsconfig.json +++ b/packages/jest/__typetests__/tsconfig.json @@ -1,12 +1,4 @@ { - "extends": "../../../tsconfig.json", - "compilerOptions": { - "composite": false, - "noUnusedLocals": false, - "noUnusedParameters": false, - "skipLibCheck": true, - - "types": [] - }, + "extends": "../../../tsconfig.typetest.json", "include": ["./**/*"] } diff --git a/tsconfig.typetest.json b/tsconfig.typetest.json new file mode 100644 index 000000000000..674fcd2c0cfa --- /dev/null +++ b/tsconfig.typetest.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "composite": false, + "emitDeclarationOnly": false, + "noEmit": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "skipLibCheck": true, + + "types": [] + } +}