From f7cb977cdef2b37ae45836e4f31039f2fdff647e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Mon, 25 Nov 2024 12:34:34 +0000 Subject: [PATCH] chore(ecmascript): switch to ES2024 --- frontend/src/main.ts | 7 ++++--- frontend/vite.config.ts | 2 +- packages/configs/typescript/base.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 0463ac07449..8dc5828d76a 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,7 +1,8 @@ /** - * Top-level await requires ES2022 (at least) as target and module - * for TypeScript compiler (check tsconfig.json) - * https://caniuse.com/mdn-javascript_operators_await_top_level + * These features are used across the codebase and requires specific + * ECMAScript versions as target in TypeScript compiler (check tsconfig.json): + * - Top-level: ES2022 https://caniuse.com/mdn-javascript_operators_await_top_level + * - Object.groupBy: ES2024 https://caniuse.com/mdn-javascript_builtins_object_groupby */ import { createApp } from 'vue'; import { routes } from 'vue-router/auto-routes'; diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index eee8a41bddc..cfc96977d31 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -80,7 +80,7 @@ export default defineConfig({ /** * See main.ts for an explanation of this target */ - target: 'esnext', + target: 'es2024', /** * Disable chunk size warnings */ diff --git a/packages/configs/typescript/base.json b/packages/configs/typescript/base.json index f0aec441428..3e9fc20ac0b 100644 --- a/packages/configs/typescript/base.json +++ b/packages/configs/typescript/base.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { - "target": "ESNext", + "target": "ES2024", "module": "Preserve", "moduleResolution": "Bundler", "esModuleInterop": true,