Commit 8ff97a7c authored by Tim van der Lippe's avatar Tim van der Lippe Committed by Commit Bot

Always run the full eslint during presubmit

This would prevent us from submitting CLs that would inadvertently
break other code, even if we did not touch it.

Bug: 1004860
Change-Id: I45f2fd8481b45c8d1bafc621965b9498d4dc80ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1813320Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697973}
parent 95f27618
// Do not use glob pattern, this file is used by PRESUBMIT.py // Do not use glob pattern, this file is used by PRESUBMIT.py
// to ignore these same files/folders for clang-format // to ignore these same files/folders for clang-format
front_end/.eslintrc.js front_end/.eslintrc.js
front_end/InspectorBackendCommands.js
front_end/SupportedCSSProperties.js
front_end/accessibility/ARIAProperties.js
front_end/audits_worker/lighthouse/ front_end/audits_worker/lighthouse/
front_end/audits/lighthouse/ front_end/audits/lighthouse/
front_end/cm/ front_end/cm/
...@@ -12,4 +15,4 @@ front_end/formatter_worker/acorn/ ...@@ -12,4 +15,4 @@ front_end/formatter_worker/acorn/
front_end/terminal/xterm.js/ front_end/terminal/xterm.js/
front_end/protocol_externs.js front_end/protocol_externs.js
front_end/javascript_metadata/NativeFunctions.js front_end/javascript_metadata/NativeFunctions.js
scripts/ scripts/
\ No newline at end of file
...@@ -117,18 +117,14 @@ def _CheckDevtoolsLocalization(input_api, output_api): # pylint: disable=invali ...@@ -117,18 +117,14 @@ def _CheckDevtoolsLocalization(input_api, output_api): # pylint: disable=invali
def _CheckDevtoolsStyle(input_api, output_api): def _CheckDevtoolsStyle(input_api, output_api):
affected_front_end_files = _getAffectedFrontEndFiles(input_api) lint_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts", "lint_javascript.py")
if len(affected_front_end_files) > 0: process = input_api.subprocess.Popen([input_api.python_executable, lint_path],
lint_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts", "lint_javascript.py") stdout=input_api.subprocess.PIPE,
process = input_api.subprocess.Popen( stderr=input_api.subprocess.STDOUT)
[input_api.python_executable, lint_path] + affected_front_end_files, out, _ = process.communicate()
stdout=input_api.subprocess.PIPE, if process.returncode != 0:
stderr=input_api.subprocess.STDOUT) return [output_api.PresubmitError(out)]
out, _ = process.communicate() return [output_api.PresubmitNotifyResult(out)]
if process.returncode != 0:
return [output_api.PresubmitError(out)]
return [output_api.PresubmitNotifyResult(out)]
return []
def _CompileDevtoolsFrontend(input_api, output_api): def _CompileDevtoolsFrontend(input_api, output_api):
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
/** /**
* @interface * @interface
*/ */
// eslint-disable-next-line
const LighthousePort = class { const LighthousePort = class {
/** /**
* @param {!string} eventName, 'message', 'close' * @param {!string} eventName, 'message', 'close'
......
...@@ -147,7 +147,7 @@ ColorPicker.Spectrum = class extends UI.VBox { ...@@ -147,7 +147,7 @@ ColorPicker.Spectrum = class extends UI.VBox {
UI.ARIAUtils.markAsButton(paletteSwitcher); UI.ARIAUtils.markAsButton(paletteSwitcher);
UI.ARIAUtils.setAccessibleName(paletteSwitcher, ls`Preview palettes`); UI.ARIAUtils.setAccessibleName(paletteSwitcher, ls`Preview palettes`);
paletteSwitcher.tabIndex = 0; paletteSwitcher.tabIndex = 0;
onInvokeElement(paletteSwitcher, event => { self.onInvokeElement(paletteSwitcher, event => {
this._togglePalettePanel(true); this._togglePalettePanel(true);
event.consume(true); event.consume(true);
}); });
...@@ -533,7 +533,7 @@ ColorPicker.Spectrum = class extends UI.VBox { ...@@ -533,7 +533,7 @@ ColorPicker.Spectrum = class extends UI.VBox {
previewElement.appendChild(this._createPaletteColor(palette.colors[i], palette.colorNames[i])); previewElement.appendChild(this._createPaletteColor(palette.colors[i], palette.colorNames[i]));
for (; i < colorsPerPreviewRow; i++) for (; i < colorsPerPreviewRow; i++)
previewElement.createChild('div', 'spectrum-palette-color empty-color'); previewElement.createChild('div', 'spectrum-palette-color empty-color');
onInvokeElement(previewElement, event => { self.onInvokeElement(previewElement, event => {
this._paletteSelected(palette); this._paletteSelected(palette);
event.consume(true); event.consume(true);
}); });
......
...@@ -101,7 +101,7 @@ Console.ConsolePin = class extends Common.Object { ...@@ -101,7 +101,7 @@ Console.ConsolePin = class extends Common.Object {
constructor(expression, pinPane) { constructor(expression, pinPane) {
super(); super();
const deletePinIcon = UI.Icon.create('smallicon-cross', 'console-delete-pin'); const deletePinIcon = UI.Icon.create('smallicon-cross', 'console-delete-pin');
onInvokeElement(deletePinIcon, () => pinPane._removePin(this)); self.onInvokeElement(deletePinIcon, () => pinPane._removePin(this));
deletePinIcon.tabIndex = 0; deletePinIcon.tabIndex = 0;
UI.ARIAUtils.setAccessibleName(deletePinIcon, ls`Remove expression`); UI.ARIAUtils.setAccessibleName(deletePinIcon, ls`Remove expression`);
UI.ARIAUtils.markAsButton(deletePinIcon); UI.ARIAUtils.markAsButton(deletePinIcon);
......
...@@ -814,13 +814,13 @@ Node.prototype.getComponentRoot = function() { ...@@ -814,13 +814,13 @@ Node.prototype.getComponentRoot = function() {
* @param {!Element} element * @param {!Element} element
* @param {function(!Event)} callback * @param {function(!Event)} callback
*/ */
function onInvokeElement(element, callback) { self.onInvokeElement = function(element, callback) {
element.addEventListener('keydown', event => { element.addEventListener('keydown', event => {
if (self.isEnterOrSpaceKey(event)) if (self.isEnterOrSpaceKey(event))
callback(event); callback(event);
}); });
element.addEventListener('click', event => callback(event)); element.addEventListener('click', event => callback(event));
} };
/** /**
* @param {!Event} event * @param {!Event} event
......
...@@ -37,7 +37,7 @@ Resources.ServiceWorkersView = class extends UI.VBox { ...@@ -37,7 +37,7 @@ Resources.ServiceWorkersView = class extends UI.VBox {
this._otherSWFilter.setAttribute('aria-checked', false); this._otherSWFilter.setAttribute('aria-checked', false);
const filterLabel = this._otherSWFilter.createChild('label', 'service-worker-filter-label'); const filterLabel = this._otherSWFilter.createChild('label', 'service-worker-filter-label');
filterLabel.textContent = Common.UIString('Service workers from other origins'); filterLabel.textContent = Common.UIString('Service workers from other origins');
onInvokeElement(this._otherSWFilter, event => { self.onInvokeElement(this._otherSWFilter, event => {
if (event.target === this._otherSWFilter || event.target === filterLabel) if (event.target === this._otherSWFilter || event.target === filterLabel)
this._toggleFilter(); this._toggleFilter();
}); });
...@@ -437,7 +437,7 @@ Resources.ServiceWorkersView.Section = class { ...@@ -437,7 +437,7 @@ Resources.ServiceWorkersView.Section = class {
errorsLabel.classList.add('link'); errorsLabel.classList.add('link');
errorsLabel.tabIndex = 0; errorsLabel.tabIndex = 0;
UI.ARIAUtils.setAccessibleName(errorsLabel, ls`${this._registration.errors.length} registration errors`); UI.ARIAUtils.setAccessibleName(errorsLabel, ls`${this._registration.errors.length} registration errors`);
onInvokeElement(errorsLabel, () => Common.console.show()); self.onInvokeElement(errorsLabel, () => Common.console.show());
name.appendChild(errorsLabel); name.appendChild(errorsLabel);
} }
this._sourceField.createChild('div', 'report-field-value-subtitle').textContent = this._sourceField.createChild('div', 'report-field-value-subtitle').textContent =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment