From d3f8df7296c54fc2b826c6e66d8a9a541b865b99 Mon Sep 17 00:00:00 2001 From: Christopher Allen Date: Tue, 30 Nov 2021 01:24:39 +0000 Subject: [PATCH] chore(build): Update compiler & linter input language to ES2020 Also: - Ensure that the `comma-dangle` rule will not be applied to function parameter lists (even when multi-line). - Update tests/node/.eslintrc.json to make the environment node-specific and not pinned to es6. --- .eslintrc.json | 11 +++++++++-- scripts/gulpfiles/build_tasks.js | 2 +- tests/node/.eslintrc.json | 4 +--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 708e919ec32..5a98b4b4312 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -64,10 +64,17 @@ // Blockly uses objects as maps, but uses Object.create(null) to // instantiate them. "guard-for-in": ["off"], - "prefer-spread": ["off"] + "prefer-spread": ["off"], + "comma-dangle": ["error", { + "arrays": "always-multiline", + "objects": "always-multiline", + "imports": "always-multiline", + "exports": "always-multiline", + "functions": "ignore" + }] }, "env": { - "es6": true, + "es2020": true, "browser": true }, "globals": { diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 529b6200f6e..66175d36e9b 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -453,7 +453,7 @@ function compile(options) { const defaultOptions = { compilation_level: 'SIMPLE_OPTIMIZATIONS', warning_level: argv.verbose ? 'VERBOSE' : 'DEFAULT', - language_in: 'ECMASCRIPT6_STRICT', + language_in: 'ECMASCRIPT_2020', language_out: 'ECMASCRIPT5_STRICT', rewrite_polyfills: true, hide_warnings_for: 'node_modules', diff --git a/tests/node/.eslintrc.json b/tests/node/.eslintrc.json index 50215619b37..287b288a6b5 100644 --- a/tests/node/.eslintrc.json +++ b/tests/node/.eslintrc.json @@ -1,8 +1,6 @@ { - "parserOptions": { - "ecmaVersion": 6 - }, "env": { + "node": true, "browser": false, "mocha": true },