From 5706d71dbdb2e9837785542a8473dc4e7de74e4c Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Wed, 29 Dec 2021 08:51:41 +0100 Subject: [PATCH] chore(tsconfig): remove dom types (#12192) --- package.json | 1 + patches/@types-jsdom.patch | 13 +++++++++++++ tsconfig.json | 2 +- yarn.lock | 19 +++++++++++++++---- 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 patches/@types-jsdom.patch diff --git a/package.json b/package.json index 6feb36db9a57..b1cb22f42e03 100644 --- a/package.json +++ b/package.json @@ -153,6 +153,7 @@ "@testing-library/dom/pretty-format": "26.6.1", "@types/jest/jest-diff": "^25.1.0", "@types/jest/pretty-format": "^25.1.0", + "@types/jsdom": "patch:@types/jsdom@*#./patches/@types-jsdom.patch", "babel-jest": "workspace:*", "jest": "workspace:*", "jest-environment-node": "workspace:*", diff --git a/patches/@types-jsdom.patch b/patches/@types-jsdom.patch new file mode 100644 index 000000000000..0dfbaf671150 --- /dev/null +++ b/patches/@types-jsdom.patch @@ -0,0 +1,13 @@ +diff --git a/base.d.ts b/base.d.ts +index fcfed640a5652394461bc49cc426c1119eef2635..acce8ed3958e575427a705c3dcba2b7114ab1ad8 100755 +--- a/base.d.ts ++++ b/base.d.ts +@@ -71,7 +71,7 @@ declare module "jsdom" { + sendTo(console: Console, options?: VirtualConsoleSendToOptions): this; + } + +- type BinaryData = ArrayBufferLike | NodeJS.ArrayBufferView; ++ type BinaryData = ArrayBufferLike; + interface BaseOptions { + /** + * referrer just affects the value read from document.referrer. diff --git a/tsconfig.json b/tsconfig.json index 27867b680cc8..1064bd907307 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "extends": "@tsconfig/node10/tsconfig.json", "compilerOptions": { // Object.fromEntries - "lib": ["dom", "es2019.object"], + "lib": ["es2019.object"], "declaration": true, "composite": true, "emitDeclarationOnly": true, diff --git a/yarn.lock b/yarn.lock index 67b22f214c6c..66cbc580cc06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4718,14 +4718,25 @@ __metadata: languageName: node linkType: hard -"@types/jsdom@npm:^16.2.4": - version: 16.2.7 - resolution: "@types/jsdom@npm:16.2.7" +"@types/jsdom@*": + version: 16.2.14 + resolution: "@types/jsdom@npm:16.2.14" dependencies: "@types/node": "*" "@types/parse5": "*" "@types/tough-cookie": "*" - checksum: 2acc361cf2aea5a13d78c3d9e63f4101f19ed02d202d6c870279dc51aa06c1f4e060a52322f9dcd660653334f890ccb3c594c23fc714cb3edf3b8641c7c66565 + checksum: ff0c6c17c9a499c8444808874ac8d731fea90a5fc909ecdbd38145a7ce47a8fa3d2b2d26f2389a6061d6e19df9e27bde88613d65c48d3689fe1bc0ba451fb6e0 + languageName: node + linkType: hard + +"@types/jsdom@patch:@types/jsdom@*#./patches/@types-jsdom.patch::locator=%40jest%2Fmonorepo%40workspace%3A.": + version: 16.2.14 + resolution: "@types/jsdom@patch:@types/jsdom@npm%3A16.2.14#./patches/@types-jsdom.patch::version=16.2.14&hash=f9e5dd&locator=%40jest%2Fmonorepo%40workspace%3A." + dependencies: + "@types/node": "*" + "@types/parse5": "*" + "@types/tough-cookie": "*" + checksum: fdcf637b490d478f282744cdd86a33bd76e5001f6437d01f2fdb805b6f1b3b1a5faed1f628aada0ffeca1e69c25d0b4994345b553ac3d25c02a1739517ce6b24 languageName: node linkType: hard