From c5f2c258852408a3b18c7a5b12d076b6b5728172 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 14 Feb 2023 21:38:44 +0100 Subject: [PATCH] feat(simulator): switch TS transpiler to ECMAScript 2022 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .eslintrc.json | 4 ++-- src/utils/Utils.ts | 4 +--- tsconfig.json | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index b9b190f5..f61fc080 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,12 +1,12 @@ { "root": true, "env": { - "es2020": true, + "es2022": true, "node": true, "mocha": true }, "parserOptions": { - "ecmaVersion": 2020, + "ecmaVersion": 2022, "sourceType": "module" }, "plugins": ["import"], diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 8a66d92d..7b59118c 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -186,9 +186,7 @@ export class Utils { } public static objectHasOwnProperty(object: unknown, property: string): boolean { - return ( - Utils.isObject(object) && (Object.prototype.hasOwnProperty.call(object, property) as boolean) - ); + return Utils.isObject(object) && Object.hasOwn(object as object, property); } public static isCFEnvironment(): boolean { diff --git a/tsconfig.json b/tsconfig.json index 9e4fe44e..d84bff42 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,9 +4,9 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ - "module": "es2020", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ - "lib": ["es2020"], /* Specify library files to be included in the compilation. */ + "target": "es2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ + "module": "es2022", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + "lib": ["es2022"], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ -- 2.34.1