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
// to ignore these same files/folders for clang-format
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/lighthouse/
front_end/cm/
......
......@@ -117,18 +117,14 @@ def _CheckDevtoolsLocalization(input_api, output_api): # pylint: disable=invali
def _CheckDevtoolsStyle(input_api, output_api):
affected_front_end_files = _getAffectedFrontEndFiles(input_api)
if len(affected_front_end_files) > 0:
lint_path = input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts", "lint_javascript.py")
process = input_api.subprocess.Popen(
[input_api.python_executable, lint_path] + affected_front_end_files,
process = input_api.subprocess.Popen([input_api.python_executable, lint_path],
stdout=input_api.subprocess.PIPE,
stderr=input_api.subprocess.STDOUT)
out, _ = process.communicate()
if process.returncode != 0:
return [output_api.PresubmitError(out)]
return [output_api.PresubmitNotifyResult(out)]
return []
def _CompileDevtoolsFrontend(input_api, output_api):
......
......@@ -5,6 +5,7 @@
/**
* @interface
*/
// eslint-disable-next-line
const LighthousePort = class {
/**
* @param {!string} eventName, 'message', 'close'
......
......@@ -147,7 +147,7 @@ ColorPicker.Spectrum = class extends UI.VBox {
UI.ARIAUtils.markAsButton(paletteSwitcher);
UI.ARIAUtils.setAccessibleName(paletteSwitcher, ls`Preview palettes`);
paletteSwitcher.tabIndex = 0;
onInvokeElement(paletteSwitcher, event => {
self.onInvokeElement(paletteSwitcher, event => {
this._togglePalettePanel(true);
event.consume(true);
});
......@@ -533,7 +533,7 @@ ColorPicker.Spectrum = class extends UI.VBox {
previewElement.appendChild(this._createPaletteColor(palette.colors[i], palette.colorNames[i]));
for (; i < colorsPerPreviewRow; i++)
previewElement.createChild('div', 'spectrum-palette-color empty-color');
onInvokeElement(previewElement, event => {
self.onInvokeElement(previewElement, event => {
this._paletteSelected(palette);
event.consume(true);
});
......
......@@ -101,7 +101,7 @@ Console.ConsolePin = class extends Common.Object {
constructor(expression, pinPane) {
super();
const deletePinIcon = UI.Icon.create('smallicon-cross', 'console-delete-pin');
onInvokeElement(deletePinIcon, () => pinPane._removePin(this));
self.onInvokeElement(deletePinIcon, () => pinPane._removePin(this));
deletePinIcon.tabIndex = 0;
UI.ARIAUtils.setAccessibleName(deletePinIcon, ls`Remove expression`);
UI.ARIAUtils.markAsButton(deletePinIcon);
......
......@@ -814,13 +814,13 @@ Node.prototype.getComponentRoot = function() {
* @param {!Element} element
* @param {function(!Event)} callback
*/
function onInvokeElement(element, callback) {
self.onInvokeElement = function(element, callback) {
element.addEventListener('keydown', event => {
if (self.isEnterOrSpaceKey(event))
callback(event);
});
element.addEventListener('click', event => callback(event));
}
};
/**
* @param {!Event} event
......
......@@ -37,7 +37,7 @@ Resources.ServiceWorkersView = class extends UI.VBox {
this._otherSWFilter.setAttribute('aria-checked', false);
const filterLabel = this._otherSWFilter.createChild('label', 'service-worker-filter-label');
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)
this._toggleFilter();
});
......@@ -437,7 +437,7 @@ Resources.ServiceWorkersView.Section = class {
errorsLabel.classList.add('link');
errorsLabel.tabIndex = 0;
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);
}
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