From: Jérôme Benoit Date: Tue, 14 Feb 2023 20:38:44 +0000 (+0100) Subject: feat(simulator): switch TS transpiler to ECMAScript 2022 X-Git-Tag: v1.1.95~54 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c5f2c258852408a3b18c7a5b12d076b6b5728172;p=e-mobility-charging-stations-simulator.git feat(simulator): switch TS transpiler to ECMAScript 2022 Signed-off-by: Jérôme Benoit --- 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'. */