diff --git a/bin/tsconfig.json b/bin/tsconfig.json index 3ec5d5826a045d..4baf899c9dce9e 100644 --- a/bin/tsconfig.json +++ b/bin/tsconfig.json @@ -16,6 +16,7 @@ "noEmit": true, "outDir": ".cache" }, + "include": [], "files": [ "./api-docs/update-api-docs.js", "./plugin/config.js", diff --git a/bin/validate-tsconfig.mjs b/bin/validate-tsconfig.mjs index 91d74b1bdb413f..47d6a320d7290e 100755 --- a/bin/validate-tsconfig.mjs +++ b/bin/validate-tsconfig.mjs @@ -29,14 +29,33 @@ for ( const packageName of packagesWithTypes ) { hasErrors = true; } - const packageJson = JSON.parse( - readFileSync( `packages/${ packageName }/package.json`, 'utf8' ) - ); - const tsconfigJson = JSON.parse( - stripJsonComments( - readFileSync( `packages/${ packageName }/tsconfig.json`, 'utf8' ) - ) - ); + let packageJson; + try { + packageJson = JSON.parse( + readFileSync( `packages/${ packageName }/package.json`, 'utf8' ) + ); + } catch ( e ) { + console.error( + `Error parsing package.json for package ${ packageName }` + ); + throw e; + } + let tsconfigJson; + try { + tsconfigJson = JSON.parse( + stripJsonComments( + readFileSync( + `packages/${ packageName }/tsconfig.json`, + 'utf8' + ) + ) + ); + } catch ( e ) { + console.error( + `Error parsing tsconfig.json for package ${ packageName }` + ); + throw e; + } if ( packageJson.dependencies ) { for ( const dependency of Object.keys( packageJson.dependencies ) ) { if ( dependency.startsWith( '@wordpress/' ) ) { diff --git a/packages/a11y/tsconfig.json b/packages/a11y/tsconfig.json index 093c2775f96d66..13229eadde8f21 100644 --- a/packages/a11y/tsconfig.json +++ b/packages/a11y/tsconfig.json @@ -1,10 +1,5 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "references": [ { "path": "../dom-ready" }, { "path": "../i18n" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../dom-ready" }, { "path": "../i18n" } ] } diff --git a/packages/api-fetch/tsconfig.json b/packages/api-fetch/tsconfig.json index f9d517286a102f..635fe4a8c0d353 100644 --- a/packages/api-fetch/tsconfig.json +++ b/packages/api-fetch/tsconfig.json @@ -1,11 +1,6 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, "references": [ { "path": "../i18n" }, { "path": "../url" } ], - "include": [ "src/**/*" ], - "exclude": [ "**/test/**/*" ] + "exclude": [ "**/test" ] } diff --git a/packages/autop/tsconfig.json b/packages/autop/tsconfig.json index a09ec7466c435b..f68a855bab79cc 100644 --- a/packages/autop/tsconfig.json +++ b/packages/autop/tsconfig.json @@ -1,10 +1,5 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "references": [ { "path": "../dom-ready" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../dom-ready" } ] } diff --git a/packages/blob/tsconfig.json b/packages/blob/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/blob/tsconfig.json +++ b/packages/blob/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/block-editor/tsconfig.json b/packages/block-editor/tsconfig.json index a3c7d1ffd88077..a3a6bd18f451d5 100644 --- a/packages/block-editor/tsconfig.json +++ b/packages/block-editor/tsconfig.json @@ -1,10 +1,6 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, "references": [ { "path": "../a11y" }, { "path": "../api-fetch" }, @@ -37,5 +33,6 @@ // NOTE: This package is being progressively typed. You are encouraged to // expand this array with files which can be type-checked. At some point in // the future, this can be simplified to an `includes` of `src/**/*`. - "files": [ "src/components/block-context/index.js", "src/utils/dom.js" ] + "files": [ "src/components/block-context/index.js", "src/utils/dom.js" ], + "include": [] } diff --git a/packages/block-library/tsconfig.json b/packages/block-library/tsconfig.json index 2a2cb1653d4285..a8423ee4a27093 100644 --- a/packages/block-library/tsconfig.json +++ b/packages/block-library/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ], "strictNullChecks": true }, diff --git a/packages/block-serialization-default-parser/tsconfig.json b/packages/block-serialization-default-parser/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/block-serialization-default-parser/tsconfig.json +++ b/packages/block-serialization-default-parser/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/components/tsconfig.json b/packages/components/tsconfig.json index 2033a6f43fede6..09bfef2c53b076 100644 --- a/packages/components/tsconfig.json +++ b/packages/components/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env", "gutenberg-test-env", @@ -31,7 +29,6 @@ { "path": "../rich-text" }, { "path": "../warning" } ], - "include": [ "src/**/*" ], "exclude": [ "src/**/*.android.js", "src/**/*.ios.js", diff --git a/packages/core-data/tsconfig.json b/packages/core-data/tsconfig.json index 26602d82ab0c01..57c9d208e4c689 100644 --- a/packages/core-data/tsconfig.json +++ b/packages/core-data/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "checkJs": false, "noImplicitAny": false }, @@ -23,6 +21,5 @@ { "path": "../undo-manager" }, { "path": "../url" }, { "path": "../warning" } - ], - "include": [ "src/**/*" ] + ] } diff --git a/packages/data-controls/tsconfig.json b/packages/data-controls/tsconfig.json index 5ccc6045880d4a..faa13b152672b6 100644 --- a/packages/data-controls/tsconfig.json +++ b/packages/data-controls/tsconfig.json @@ -2,14 +2,11 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ] }, "references": [ { "path": "../api-fetch" }, { "path": "../data" }, { "path": "../deprecated" } - ], - "include": [ "src/**/*" ] + ] } diff --git a/packages/data/tsconfig.json b/packages/data/tsconfig.json index 2bfc881dc6216e..b73eca0d342f04 100644 --- a/packages/data/tsconfig.json +++ b/packages/data/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "checkJs": false }, "references": [ @@ -14,6 +12,5 @@ { "path": "../is-shallow-equal" }, { "path": "../priority-queue" }, { "path": "../redux-routine" } - ], - "include": [ "src/**/*" ] + ] } diff --git a/packages/dataviews/tsconfig.json b/packages/dataviews/tsconfig.json index 3f0865cc398544..a7c8759d257cb2 100644 --- a/packages/dataviews/tsconfig.json +++ b/packages/dataviews/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env", "gutenberg-test-env", @@ -22,7 +20,6 @@ { "path": "../private-apis" }, { "path": "../warning" } ], - "include": [ "src" ], "exclude": [ "src/**/*.android.js", "src/**/*.ios.js", diff --git a/packages/date/tsconfig.json b/packages/date/tsconfig.json index 0c9e6d5ed02b0b..605262dd7cc952 100644 --- a/packages/date/tsconfig.json +++ b/packages/date/tsconfig.json @@ -1,10 +1,5 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "references": [ { "path": "../deprecated" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../deprecated" } ] } diff --git a/packages/deprecated/tsconfig.json b/packages/deprecated/tsconfig.json index f90e327f124d7e..b2186db14f4cc4 100644 --- a/packages/deprecated/tsconfig.json +++ b/packages/deprecated/tsconfig.json @@ -1,10 +1,5 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "references": [ { "path": "../hooks" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../hooks" } ] } diff --git a/packages/docgen/tsconfig.json b/packages/docgen/tsconfig.json index df0072645c53ba..eebc743289aec2 100644 --- a/packages/docgen/tsconfig.json +++ b/packages/docgen/tsconfig.json @@ -2,8 +2,8 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "lib", - "declarationDir": "build-types" + "rootDir": "lib" }, - "include": [ "lib/get-leading-comments.js" ] + "files": [ "lib/get-leading-comments.js" ], + "include": [] } diff --git a/packages/dom-ready/tsconfig.json b/packages/dom-ready/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/dom-ready/tsconfig.json +++ b/packages/dom-ready/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/dom/tsconfig.json b/packages/dom/tsconfig.json index 7cdff6c141151b..e44d6b98c50856 100644 --- a/packages/dom/tsconfig.json +++ b/packages/dom/tsconfig.json @@ -2,10 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ] }, - "include": [ "src/**/*" ], "references": [ { "path": "../deprecated" } ] } diff --git a/packages/e2e-test-utils-playwright/tsconfig.json b/packages/e2e-test-utils-playwright/tsconfig.json index 5e52bb94f706d9..947a4a0f82fc76 100644 --- a/packages/e2e-test-utils-playwright/tsconfig.json +++ b/packages/e2e-test-utils-playwright/tsconfig.json @@ -7,16 +7,13 @@ "module": "Node16", "moduleResolution": "node16", "types": [ "node" ], - "rootDir": "src", "noEmit": false, "outDir": "build", "sourceMap": true, "declaration": true, "declarationMap": true, - "declarationDir": "build-types", "emitDeclarationOnly": false, "allowJs": true, "checkJs": false - }, - "include": [ "src/**/*" ] + } } diff --git a/packages/editor/tsconfig.json b/packages/editor/tsconfig.json index 3c45fbcb10db3d..00a8f3860e2925 100644 --- a/packages/editor/tsconfig.json +++ b/packages/editor/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "checkJs": false }, "references": [ @@ -34,6 +32,5 @@ { "path": "../url" }, { "path": "../warning" }, { "path": "../wordcount" } - ], - "include": [ "src" ] + ] } diff --git a/packages/element/tsconfig.json b/packages/element/tsconfig.json index ad6a489d33e9a5..a1df062eb218b3 100644 --- a/packages/element/tsconfig.json +++ b/packages/element/tsconfig.json @@ -2,12 +2,8 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", - "noImplicitAny": false, "strictNullChecks": false }, - "references": [ { "path": "../escape-html" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../escape-html" } ] } diff --git a/packages/escape-html/tsconfig.json b/packages/escape-html/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/escape-html/tsconfig.json +++ b/packages/escape-html/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/eslint-plugin/tsconfig.json b/packages/eslint-plugin/tsconfig.json index e17815f78a6a16..a769c50a12df4c 100644 --- a/packages/eslint-plugin/tsconfig.json +++ b/packages/eslint-plugin/tsconfig.json @@ -3,12 +3,12 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "module": "CommonJS", - "rootDir": "rules", - "declarationDir": "build-types" + "rootDir": "rules" }, "references": [ { "path": "../prettier-config" } ], // NOTE: This package is being progressively typed. You are encouraged to // expand this array with files which can be type-checked. At some point in // the future, this can be simplified to an `includes` of `src/**/*`. - "files": [ "rules/dependency-group.js", "rules/no-unsafe-wp-apis.js" ] + "files": [ "rules/dependency-group.js", "rules/no-unsafe-wp-apis.js" ], + "include": [] } diff --git a/packages/fields/tsconfig.json b/packages/fields/tsconfig.json index 46ac86d48e11ee..552aa73b8e5cce 100644 --- a/packages/fields/tsconfig.json +++ b/packages/fields/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "checkJs": false }, "references": [ @@ -29,6 +27,5 @@ { "path": "../url" }, { "path": "../block-editor" }, { "path": "../warning" } - ], - "include": [ "src" ] + ] } diff --git a/packages/hooks/tsconfig.json b/packages/hooks/tsconfig.json index 9e3edfe0ae443c..f197b56919708b 100644 --- a/packages/hooks/tsconfig.json +++ b/packages/hooks/tsconfig.json @@ -2,9 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ] - }, - "include": [ "src/**/*" ] + } } diff --git a/packages/html-entities/tsconfig.json b/packages/html-entities/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/html-entities/tsconfig.json +++ b/packages/html-entities/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/i18n/tsconfig.json b/packages/i18n/tsconfig.json index f90e327f124d7e..b2186db14f4cc4 100644 --- a/packages/i18n/tsconfig.json +++ b/packages/i18n/tsconfig.json @@ -1,10 +1,5 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "references": [ { "path": "../hooks" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../hooks" } ] } diff --git a/packages/icons/tsconfig.json b/packages/icons/tsconfig.json index 2877b1d31633bd..75638a3b50a790 100644 --- a/packages/icons/tsconfig.json +++ b/packages/icons/tsconfig.json @@ -1,10 +1,5 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ], "references": [ { "path": "../element" }, { "path": "../primitives" } ] } diff --git a/packages/interactivity-router/tsconfig.json b/packages/interactivity-router/tsconfig.json index f601a26a86f5f4..616718560d02cc 100644 --- a/packages/interactivity-router/tsconfig.json +++ b/packages/interactivity-router/tsconfig.json @@ -2,11 +2,8 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "checkJs": false, "strict": false }, - "references": [ { "path": "../a11y" }, { "path": "../interactivity" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../a11y" }, { "path": "../interactivity" } ] } diff --git a/packages/interactivity/tsconfig.json b/packages/interactivity/tsconfig.json index 1d154e2089065d..a4d86e65fa1dd6 100644 --- a/packages/interactivity/tsconfig.json +++ b/packages/interactivity/tsconfig.json @@ -2,10 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", - "noImplicitAny": false - }, - "include": [ "src/**/*" ] + } } diff --git a/packages/interactivity/tsconfig.test.json b/packages/interactivity/tsconfig.test.json index 6a90abc2ba2210..ad6813d6fec0ff 100644 --- a/packages/interactivity/tsconfig.test.json +++ b/packages/interactivity/tsconfig.test.json @@ -2,12 +2,12 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", "noEmit": true, "emitDeclarationOnly": false, "types": [ "jest" ] }, "references": [ { "path": "./tsconfig.json" } ], "files": [ "src/test/store.ts" ], + "include": [], "exclude": [] } diff --git a/packages/is-shallow-equal/tsconfig.json b/packages/is-shallow-equal/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/is-shallow-equal/tsconfig.json +++ b/packages/is-shallow-equal/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/keycodes/tsconfig.json b/packages/keycodes/tsconfig.json index be13213c265f05..9534c034fa89e7 100644 --- a/packages/keycodes/tsconfig.json +++ b/packages/keycodes/tsconfig.json @@ -1,10 +1,5 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "references": [ { "path": "../i18n" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../i18n" } ] } diff --git a/packages/lazy-import/tsconfig.json b/packages/lazy-import/tsconfig.json index 3bf8bde807404d..9647e449d35454 100644 --- a/packages/lazy-import/tsconfig.json +++ b/packages/lazy-import/tsconfig.json @@ -3,8 +3,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "rootDir": "lib", - "declarationDir": "build-types", "useUnknownInCatchVariables": false }, - "include": [ "lib/**/*" ] + "include": [ "lib" ] } diff --git a/packages/media-utils/tsconfig.json b/packages/media-utils/tsconfig.json index ca3e93c2dee668..380e55bc58ff09 100644 --- a/packages/media-utils/tsconfig.json +++ b/packages/media-utils/tsconfig.json @@ -2,12 +2,9 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ], "checkJs": false }, - "include": [ "src/**/*" ], "references": [ { "path": "../api-fetch" }, { "path": "../blob" }, diff --git a/packages/notices/tsconfig.json b/packages/notices/tsconfig.json index e36a6fe9f4eb6b..9c48147297764e 100644 --- a/packages/notices/tsconfig.json +++ b/packages/notices/tsconfig.json @@ -2,11 +2,8 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ], "checkJs": false }, - "references": [ { "path": "../a11y" }, { "path": "../data" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../a11y" }, { "path": "../data" } ] } diff --git a/packages/plugins/tsconfig.json b/packages/plugins/tsconfig.json index 47c626f9ddedc8..66fb760f8896d0 100644 --- a/packages/plugins/tsconfig.json +++ b/packages/plugins/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ] }, "references": [ @@ -14,6 +12,5 @@ { "path": "../hooks" }, { "path": "../icons" }, { "path": "../is-shallow-equal" } - ], - "include": [ "src/**/*" ] + ] } diff --git a/packages/prettier-config/tsconfig.json b/packages/prettier-config/tsconfig.json index 0636ff7d0081dd..7899aeee7dfbc9 100644 --- a/packages/prettier-config/tsconfig.json +++ b/packages/prettier-config/tsconfig.json @@ -3,8 +3,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "rootDir": "lib", - "declarationDir": "build-types", "types": [ "node" ] }, - "include": [ "lib/**/*" ] + "include": [ "lib" ] } diff --git a/packages/primitives/tsconfig.json b/packages/primitives/tsconfig.json index 59a95359b5ea65..5dea3e64597b43 100644 --- a/packages/primitives/tsconfig.json +++ b/packages/primitives/tsconfig.json @@ -1,10 +1,5 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ], "references": [ { "path": "../element" } ] } diff --git a/packages/priority-queue/tsconfig.json b/packages/priority-queue/tsconfig.json index 96d649eb7a6233..2a790d65e67612 100644 --- a/packages/priority-queue/tsconfig.json +++ b/packages/priority-queue/tsconfig.json @@ -2,9 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "requestidlecallback" ] - }, - "include": [ "src/**/*" ] + } } diff --git a/packages/private-apis/tsconfig.json b/packages/private-apis/tsconfig.json index 9e3edfe0ae443c..f197b56919708b 100644 --- a/packages/private-apis/tsconfig.json +++ b/packages/private-apis/tsconfig.json @@ -2,9 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ] - }, - "include": [ "src/**/*" ] + } } diff --git a/packages/project-management-automation/tsconfig.json b/packages/project-management-automation/tsconfig.json index 0636ff7d0081dd..7899aeee7dfbc9 100644 --- a/packages/project-management-automation/tsconfig.json +++ b/packages/project-management-automation/tsconfig.json @@ -3,8 +3,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "rootDir": "lib", - "declarationDir": "build-types", "types": [ "node" ] }, - "include": [ "lib/**/*" ] + "include": [ "lib" ] } diff --git a/packages/react-i18n/tsconfig.json b/packages/react-i18n/tsconfig.json index e8e7f164f89a34..32b019421ed3d5 100644 --- a/packages/react-i18n/tsconfig.json +++ b/packages/react-i18n/tsconfig.json @@ -1,10 +1,5 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "references": [ { "path": "../element" }, { "path": "../i18n" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../element" }, { "path": "../i18n" } ] } diff --git a/packages/redux-routine/tsconfig.json b/packages/redux-routine/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/redux-routine/tsconfig.json +++ b/packages/redux-routine/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/report-flaky-tests/tsconfig.json b/packages/report-flaky-tests/tsconfig.json index 09fc242db010db..26fcd6f5e51c6f 100644 --- a/packages/report-flaky-tests/tsconfig.json +++ b/packages/report-flaky-tests/tsconfig.json @@ -3,10 +3,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "module": "CommonJS", - "declarationDir": "build-types", - "rootDir": "src", "types": [ "jest" ] }, - "include": [ "src/**/*" ], - "exclude": [ "src/__tests__/**/*", "src/__fixtures__/**/*" ] + "exclude": [ "src/__tests__", "src/__fixtures__" ] } diff --git a/packages/rich-text/tsconfig.json b/packages/rich-text/tsconfig.json index 57fe0ae604215f..5dadcb0ed0045c 100644 --- a/packages/rich-text/tsconfig.json +++ b/packages/rich-text/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ], "checkJs": false }, @@ -16,6 +14,5 @@ { "path": "../escape-html" }, { "path": "../i18n" }, { "path": "../keycodes" } - ], - "include": [ "src/**/*" ] + ] } diff --git a/packages/router/tsconfig.json b/packages/router/tsconfig.json index 8706b546ff304d..7d9ba227795ad6 100644 --- a/packages/router/tsconfig.json +++ b/packages/router/tsconfig.json @@ -2,8 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ] }, "references": [ @@ -11,6 +9,5 @@ { "path": "../element" }, { "path": "../private-apis" }, { "path": "../url" } - ], - "include": [ "src/**/*" ] + ] } diff --git a/packages/shortcode/tsconfig.json b/packages/shortcode/tsconfig.json index 79aa09d0ad56e3..2ab16a25d51788 100644 --- a/packages/shortcode/tsconfig.json +++ b/packages/shortcode/tsconfig.json @@ -2,10 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "checkJs": false - }, - "references": [], - "include": [ "src" ] + } } diff --git a/packages/style-engine/tsconfig.json b/packages/style-engine/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/style-engine/tsconfig.json +++ b/packages/style-engine/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/sync/tsconfig.json b/packages/sync/tsconfig.json index 40b3ecb72f9aba..f0a5cb0530d297 100644 --- a/packages/sync/tsconfig.json +++ b/packages/sync/tsconfig.json @@ -2,10 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "node" ] }, - "include": [ "src/**/*" ], "references": [ { "path": "../url" } ] } diff --git a/packages/token-list/tsconfig.json b/packages/token-list/tsconfig.json index d1947d4c52ffdf..7ff060ab6ce105 100644 --- a/packages/token-list/tsconfig.json +++ b/packages/token-list/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/undo-manager/tsconfig.json b/packages/undo-manager/tsconfig.json index 055c19d5bf513d..a3c336bec45609 100644 --- a/packages/undo-manager/tsconfig.json +++ b/packages/undo-manager/tsconfig.json @@ -2,10 +2,7 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "node" ] }, - "references": [ { "path": "../is-shallow-equal" } ], - "include": [ "src/**/*" ] + "references": [ { "path": "../is-shallow-equal" } ] } diff --git a/packages/upload-media/tsconfig.json b/packages/upload-media/tsconfig.json index 3e9fff3edb53e3..df9f913b1e11b7 100644 --- a/packages/upload-media/tsconfig.json +++ b/packages/upload-media/tsconfig.json @@ -2,11 +2,8 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ] }, - "include": [ "src/**/*" ], "references": [ { "path": "../api-fetch" }, { "path": "../blob" }, diff --git a/packages/url/tsconfig.json b/packages/url/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/url/tsconfig.json +++ b/packages/url/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/vips/tsconfig.json b/packages/vips/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/vips/tsconfig.json +++ b/packages/vips/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/packages/warning/tsconfig.json b/packages/warning/tsconfig.json index 9e3edfe0ae443c..f197b56919708b 100644 --- a/packages/warning/tsconfig.json +++ b/packages/warning/tsconfig.json @@ -2,9 +2,6 @@ "$schema": "https://json.schemastore.org/tsconfig.json", "extends": "../../tsconfig.base.json", "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types", "types": [ "gutenberg-env" ] - }, - "include": [ "src/**/*" ] + } } diff --git a/packages/wordcount/tsconfig.json b/packages/wordcount/tsconfig.json index 6e33d8ff82d47e..7ff060ab6ce105 100644 --- a/packages/wordcount/tsconfig.json +++ b/packages/wordcount/tsconfig.json @@ -1,9 +1,4 @@ { "$schema": "https://json.schemastore.org/tsconfig.json", - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "rootDir": "src", - "declarationDir": "build-types" - }, - "include": [ "src/**/*" ] + "extends": "../../tsconfig.base.json" } diff --git a/tsconfig.base.json b/tsconfig.base.json index a766eedaeddcaa..38c6ac761aab64 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -31,8 +31,12 @@ "resolveJsonModule": true, "typeRoots": [ "./typings", "./node_modules/@types" ], - "types": [] + "types": [], + + "rootDir": "${configDir}/src", + "declarationDir": "${configDir}/build-types" }, + "include": [ "${configDir}/src" ], "exclude": [ "**/*.android.js", "**/*.ios.js",