From 0c27d42e10a6b384a1ed88508a264444e9124759 Mon Sep 17 00:00:00 2001 From: Billy Janitsch Date: Wed, 27 Nov 2024 10:51:49 -0500 Subject: [PATCH] Require TS 5.7 and update target to ES2024 (#12) * Require TS 5.7 and update target to ES2024 * Add fixtures --- fixtures/dom-iterable.tsx | 6 ++++++ fixtures/es2024.tsx | 14 ++++++++++++++ package-lock.json | 10 +++++----- package.json | 4 ++-- tsconfig.json | 3 ++- 5 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 fixtures/dom-iterable.tsx create mode 100644 fixtures/es2024.tsx diff --git a/fixtures/dom-iterable.tsx b/fixtures/dom-iterable.tsx new file mode 100644 index 0000000..1deeac8 --- /dev/null +++ b/fixtures/dom-iterable.tsx @@ -0,0 +1,6 @@ +const formData = new FormData() +formData.set('name', 'Aliza') + +for (const [key, value] of formData) { + console.log(key, value) +} diff --git a/fixtures/es2024.tsx b/fixtures/es2024.tsx new file mode 100644 index 0000000..3de70cf --- /dev/null +++ b/fixtures/es2024.tsx @@ -0,0 +1,14 @@ +interface Item { + name: string + type: 'fruit' | 'vegetable' +} + +const produce: Item[] = [ + {name: 'apple', type: 'fruit'}, + {name: 'banana', type: 'fruit'}, + {name: 'carrot', type: 'vegetable'}, +] + +const result = Map.groupBy(produce, (item) => item.type) + +console.log(result.get('fruit')) diff --git a/package-lock.json b/package-lock.json index 569171d..1308c38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@kensho-technologies/prettier-config": "^3.0.0", "@types/react": "^18.3.12", - "prettier": "^3.3.3", + "prettier": "^3.4.1", "react": "^18.3.1" }, "engines": { @@ -19,7 +19,7 @@ "npm": ">=8.0.0" }, "peerDependencies": { - "typescript": "^5.0.0" + "typescript": "^5.7.0" } }, "node_modules/@kensho-technologies/prettier-config": { @@ -82,9 +82,9 @@ } }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.1.tgz", + "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index f420bb4..fb842a2 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,12 @@ "license": "Apache-2.0", "prettier": "@kensho-technologies/prettier-config", "peerDependencies": { - "typescript": "^5.0.0" + "typescript": "^5.7.0" }, "devDependencies": { "@kensho-technologies/prettier-config": "^3.0.0", "@types/react": "^18.3.12", - "prettier": "^3.3.3", + "prettier": "^3.4.1", "react": "^18.3.1" } } diff --git a/tsconfig.json b/tsconfig.json index 0951b96..28bcf70 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,12 +5,13 @@ "incremental": true, "isolatedModules": true, "jsx": "react-jsx", + "lib": ["ES2024", "DOM", "DOM.Iterable"], "module": "ES2022", "moduleResolution": "bundler", "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, "strict": true, - "target": "ES2022", + "target": "ES2024", "tsBuildInfoFile": ".tsbuildinfo" } }