DevTools: Make presubmit support ES9 (2018) features
In the previous commit https://crrev.com/a9840d6 we enabled eslint
support of ES9 features, that change supported linting via
npm run-script lint however it did not cover the eslint format in
devtools/PRESUBMIT.py
This change updates the devtools/PRESUBMIT.py script to support
parsing ES9 syntax unblocking the use of ES9 features such as the object
spread operator.
Change-Id: Ia81583d0836226c58abe21a96e9d856f244beb61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1647254
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: John Emau <johnemau@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#674379}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d2af1fc67a09754c12d1a59eb81c41a64425ebed
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 4dcfae3..0749c1a 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -79,7 +79,8 @@
# Also fix semicolon to avoid confusing clang-format.
eslint_process = popen([
local_node.node_path(), local_node.eslint_path(),
- '--no-eslintrc', '--fix', '--env=es6', '--rule={"curly": [2, "multi-or-nest", "consistent"], "semi": 2}'
+ '--no-eslintrc', '--fix', '--env=es6', '--parser-options=ecmaVersion:9',
+ '--rule={"curly": [2, "multi-or-nest", "consistent"], "semi": 2}'
] + affected_files)
eslint_process.communicate()