From 9c37216ecb9edae2a693470c20c5ce0be2d400ef Mon Sep 17 00:00:00 2001 From: Jack Works Date: Mon, 26 Jul 2021 10:50:41 +0800 Subject: [PATCH 1/2] feat: enable es2020 syntax --- packages/.eslintrc.json | 17 +++++++++++++++++ tsconfig.json | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/.eslintrc.json b/packages/.eslintrc.json index 15f8504a4536..decf568f6be7 100644 --- a/packages/.eslintrc.json +++ b/packages/.eslintrc.json @@ -33,6 +33,23 @@ "component": true, "html": true } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "types": { + "bigint": "BigInt not supported until Safari 15.", + "Bigint": "BigInt not supported until Safari 15." + }, + "extendDefaults": false + } + ], + "no-restricted-syntax": [ + "error", + { + "selector": "Literal[raw=/n$/]", + "message": "BigInt not supported until Safari 15." + } ] } } diff --git a/tsconfig.json b/tsconfig.json index 17aea484fff6..a90a47244315 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "compilerOptions": { /* Basic Options */ "incremental": true /* Enable incremental compilation */, - "target": "ES2019" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, + "target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, "module": "ESNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, "lib": ["DOM", "DOM.Iterable", "ES2020"] /* Specify library files to be included in the compilation. */, "allowJs": true /* Allow javascript files to be compiled. */, From d3f0cdd7ec36a83f7d1d3f1f608e7a36bb0b337c Mon Sep 17 00:00:00 2001 From: Jack Works Date: Mon, 26 Jul 2021 11:15:00 +0800 Subject: [PATCH 2/2] Update packages/.eslintrc.json Co-authored-by: Septs --- packages/.eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/.eslintrc.json b/packages/.eslintrc.json index decf568f6be7..c772c3d7c114 100644 --- a/packages/.eslintrc.json +++ b/packages/.eslintrc.json @@ -39,7 +39,7 @@ { "types": { "bigint": "BigInt not supported until Safari 15.", - "Bigint": "BigInt not supported until Safari 15." + "BigInt": "BigInt not supported until Safari 15." }, "extendDefaults": false }