From 380ab1793253b5a3ee67e9bd3182632cec5854de Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Aug 2024 17:14:27 +0100 Subject: [PATCH] Upgrade target to es2022 (#27884) --- babel.config.js | 4 ++-- tsconfig.json | 3 ++- tsconfig.module_system.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/babel.config.js b/babel.config.js index 93920120c6..b63a90e5ff 100644 --- a/babel.config.js +++ b/babel.config.js @@ -10,15 +10,15 @@ module.exports = { "last 2 Safari versions", "last 2 Edge versions", ], + include: ["@babel/plugin-transform-class-properties"], }, ], - "@babel/preset-typescript", + ["@babel/preset-typescript", { allowDeclareFields: true }], "@babel/preset-react", ], plugins: [ "@babel/plugin-proposal-export-default-from", "@babel/plugin-transform-numeric-separator", - "@babel/plugin-transform-class-properties", "@babel/plugin-transform-object-rest-spread", "@babel/plugin-transform-optional-chaining", "@babel/plugin-transform-nullish-coalescing-operator", diff --git a/tsconfig.json b/tsconfig.json index 902b3469b6..bb2e3107ce 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,9 +4,10 @@ "emitDecoratorMetadata": false, "resolveJsonModule": true, "esModuleInterop": true, + "useDefineForClassFields": true, "module": "es2022", "moduleResolution": "node", - "target": "es2018", + "target": "es2022", "noUnusedLocals": true, "sourceMap": false, "outDir": "./lib", diff --git a/tsconfig.module_system.json b/tsconfig.module_system.json index df928f828e..dec7ca9e50 100644 --- a/tsconfig.module_system.json +++ b/tsconfig.module_system.json @@ -4,7 +4,7 @@ "jsx": "preserve", "declaration": false, "outDir": "./lib/module_system", - "lib": ["es2020"], + "lib": ["es2022"], "types": ["node"] }, "include": ["./module_system/**/*.ts"]