Add eslint-import-plugin to node_modules
Will be used to make sure no default exports are in DevTools.
The PRESUBMIT.py has been updated to skip running the formatting check
if node_modules files are affected, to workaround crbug.com/1068198.
DISABLE_THIRD_PARTY_CHECK=Add plugin to node_modules
Bug: 1068198
Change-Id: I04d4dc813daa01099f21d40edf47aaefcc0b045f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2135610
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index f1d536d..3652d86 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -108,6 +108,12 @@
def _CheckFormat(input_api, output_api):
+ node_modules_affected_files = _getAffectedFiles(input_api, [input_api.os_path.join(input_api.PresubmitLocalPath(), 'node_modules')], [], [])
+
+ # TODO(crbug.com/1068198): Remove once `git cl format --js` can handle large CLs.
+ if (len(node_modules_affected_files) > 0):
+ return [output_api.PresubmitNotifyResult('Skipping Format Checks because `node_modules` files are affected.')]
+
results = [output_api.PresubmitNotifyResult('Running Format Checks:')]
return _ExecuteSubProcess(input_api, output_api, ['git', 'cl', 'format', '--js'], [], results)
@@ -333,9 +339,8 @@
f.AbsoluteLocalPath() for f in input_api.AffectedFiles() if all(f.Action() != action for action in excluded_actions)
]
affected_files = [
- file_name for file_name in local_paths
- if any(parent_directory in file_name for parent_directory in parent_directories) and any(
- file_name.endswith(accepted_ending) for accepted_ending in accepted_endings)
+ file_name for file_name in local_paths if any(parent_directory in file_name for parent_directory in parent_directories) and
+ (len(accepted_endings) is 0 or any(file_name.endswith(accepted_ending) for accepted_ending in accepted_endings))
]
return affected_files