diff --git a/test/tsconfig.json b/test/tsconfig.json index 3b0ad18e33519..1e198fbb8d53a 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,23 +1,6 @@ -// Make development mode typescript module resolving and jsx parsing correct for all tests +// Make development mode typescript module resolving and jsx parsing correct for all tests. +// We want to apply the compiler options to the testing app, but we don't want to do strict type checking for them. +// e.g. testing app could have import a from '3rd-lib-nextjs-ws-doesnt-have' { - "compilerOptions": { - "strict": false, - "noEmit": true, - "allowJs": true, - "resolveJsonModule": true, - "jsx": "react-jsx", - "module": "esnext", - "target": "ESNext", - "esModuleInterop": true, - "moduleResolution": "node", - "baseUrl": ".", - "types": ["react", "jest", "node", "trusted-types", "jest-extended"], - "paths": { - "development-sandbox": ["./lib/development-sandbox"], - "next-test-utils": ["./lib/next-test-utils"], - "amp-test-utils": ["./lib/amp-test-utils"], - "next-webdriver": ["./lib/next-webdriver"], - "e2e-utils": ["./lib/e2e-utils"] - } - } + "extends": "../tsconfig.base.json" } diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000000000..e47763a169c70 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "strict": false, + "noEmit": true, + "allowJs": true, + "resolveJsonModule": true, + "jsx": "react-jsx", + "module": "esnext", + "target": "ESNext", + "esModuleInterop": true, + "moduleResolution": "node", + "baseUrl": ".", + "types": ["react", "jest", "node", "trusted-types", "jest-extended"], + "paths": { + "development-sandbox": ["test/lib/development-sandbox"], + "next-test-utils": ["test/lib/next-test-utils"], + "amp-test-utils": ["test/lib/amp-test-utils"], + "next-webdriver": ["test/lib/next-webdriver"], + "e2e-utils": ["test/lib/e2e-utils"] + } + } +} diff --git a/tsconfig.json b/tsconfig.json index 81b35adbf0bf4..f35f67680c5c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,24 +1,5 @@ { - "compilerOptions": { - "strict": false, - "noEmit": true, - "allowJs": true, - "resolveJsonModule": true, - "jsx": "react-jsx", - "module": "esnext", - "target": "ESNext", - "esModuleInterop": true, - "moduleResolution": "node", - "baseUrl": ".", - "types": ["react", "jest", "node", "trusted-types", "jest-extended"], - "paths": { - "development-sandbox": ["test/lib/development-sandbox"], - "next-test-utils": ["test/lib/next-test-utils"], - "amp-test-utils": ["test/lib/amp-test-utils"], - "next-webdriver": ["test/lib/next-webdriver"], - "e2e-utils": ["test/lib/e2e-utils"] - } - }, + "extends": "./tsconfig.base.json", "include": ["test/**/*.test.ts", "test/**/*.test.tsx"], "exclude": ["node_modules"] }