Commit 1e511b11 authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI: Enable ESLint rule for missing semicolons.

 - Fixing almost all existing violations
   (remaining ones are fixed at crrev.com/2903063007).
 - Enabling http://eslint.org/docs/rules/semi check during PRESUBMIT

This enforces the following section from the styleguide:
https://google.github.io/styleguide/jsguide.html#formatting-semicolons-are-required

BUG=720034
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2909503003
Cr-Commit-Position: refs/heads/master@{#475771}
parent ad6d7db1
......@@ -11,6 +11,7 @@ module.exports = {
'rules': {
// Enabled checks.
'no-extra-semi': 'error',
'semi': ['error', 'always'],
// TODO(dpapad): Add more checks according to our styleguide.
},
};
......@@ -137,5 +137,5 @@ cr.define('expandable_list', function() {
return {
ExpandableListItem: ExpandableListItem,
ExpandableList: ExpandableList,
}
};
});
\ No newline at end of file
......@@ -400,7 +400,7 @@ cr.define('value_control', function() {
'Retry', this.writeValue_.bind(this));
}.bind(this));
},
}
};
return {
ValueControl: ValueControl,
......
......@@ -883,7 +883,7 @@ function getSelectedBookmarkNodes(opt_target) {
*/
function getSelectedBookmarkIds(opt_target) {
var selectedNodes = getSelectedBookmarkNodes(opt_target);
selectedNodes.sort(function(a, b) { return a.index - b.index });
selectedNodes.sort(function(a, b) { return a.index - b.index; });
return selectedNodes.map(function(node) {
return node.id;
});
......
......@@ -76,7 +76,7 @@ cvox.BrailleTable.getAll = function(callback) {
* @return {cvox.BrailleTable.Table} The found table, or null if not found.
*/
cvox.BrailleTable.forId = function(tables, id) {
return tables.filter(function(table) { return table.id === id })[0] || null;
return tables.filter(function(table) { return table.id === id; })[0] || null;
};
......
......@@ -152,7 +152,7 @@ cvox.ExpandingBrailleTranslator.prototype.translate =
function finish() {
var totalCells = chunks.reduce(
function(accum, chunk) { return accum + chunk.cells.byteLength}, 0);
function(accum, chunk) { return accum + chunk.cells.byteLength;}, 0);
var cells = new Uint8Array(totalCells);
var cellPos = 0;
var textToBraille = [];
......
......@@ -27,14 +27,14 @@ cvox.ChromeVoxEventSuspender.suspendLevel_ = 0;
*/
cvox.ChromeVoxEventSuspender.enterSuspendEvents = function() {
cvox.ChromeVoxEventSuspender.suspendLevel_ += 1;
}
};
/**
* Exits a (nested) suspended state.
*/
cvox.ChromeVoxEventSuspender.exitSuspendEvents = function() {
cvox.ChromeVoxEventSuspender.suspendLevel_ -= 1;
}
};
/**
* Returns true if events are currently suspended.
......
......@@ -25,10 +25,10 @@ cvox.ChromeVoxHTMLMediaWidget = function(mediaElem, tts){
this.keyListener_ = function(evt) {
self.eventHandler_(evt);
}
};
this.blurListener_ = function(evt) {
self.shutdown();
}
};
this.mediaElem_.addEventListener('keydown', this.keyListener_, false);
this.mediaElem_.addEventListener('keyup', this.keyListener_, false);
......
......@@ -428,7 +428,7 @@ var serializableSpansByConstructor = new Map();
function spanInstanceOf(constructor) {
return function(span) {
return span.value instanceof constructor;
}
};
}
/**
......@@ -438,7 +438,7 @@ function spanInstanceOf(constructor) {
function spanCoversPosition(position) {
return function(span) {
return span.start <= position && position < span.end;
}
};
}
/**
......@@ -448,7 +448,7 @@ function spanCoversPosition(position) {
function spanValueIs(value) {
return function(span) {
return span.value === value;
}
};
}
/**
......
......@@ -40,7 +40,7 @@ CallbackHelper.prototype = {
return function() {
savedArgs.arguments = Array.prototype.slice.call(arguments);
runAll.invoke();
}
};
}
};
......
......@@ -474,5 +474,5 @@ disableTextSelectAndDrag(function(e) {
// Install a global error handler so stack traces are included in logs.
window.onerror = function(message, file, line, column, error) {
console.error(error.stack);
}
};
})();
......@@ -474,5 +474,5 @@ disableTextSelectAndDrag(function(e) {
// Install a global error handler so stack traces are included in logs.
window.onerror = function(message, file, line, column, error) {
console.error(error.stack);
}
};
})();
......@@ -239,7 +239,7 @@ cr.define('cr.ui.Oobe', function() {
return;
// Simulate click on the checkbox.
e.target.click()
e.target.click();
},
/**
......
......@@ -51,7 +51,7 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
*/
isCancelDisabled_: null,
get isCancelDisabled() { return this.isCancelDisabled_ },
get isCancelDisabled() { return this.isCancelDisabled_; },
set isCancelDisabled(disabled) {
this.isCancelDisabled_ = disabled;
},
......
......@@ -139,7 +139,7 @@ Polymer({
hideAllScreens_: function() {
this.$.welcomeScreen.hidden = true;
var screens = Polymer.dom(this.root).querySelectorAll('oobe-dialog')
var screens = Polymer.dom(this.root).querySelectorAll('oobe-dialog');
for (var i = 0; i < screens.length; ++i) {
screens[i].hidden = true;
}
......@@ -164,7 +164,7 @@ Polymer({
* @private
*/
getActiveScreen_: function() {
var screens = Polymer.dom(this.root).querySelectorAll('oobe-dialog')
var screens = Polymer.dom(this.root).querySelectorAll('oobe-dialog');
for (var i = 0; i < screens.length; ++i) {
if (!screens[i].hidden)
return screens[i];
......
......@@ -836,7 +836,7 @@ function showHideCallback(sectionId, buttonId, requestFunction) {
$(sectionId).hidden = true;
$(buttonId).textContent = loadTimeData.getString('showButton');
}
}
};
}
var powerUI = {
......
......@@ -122,4 +122,4 @@ AutomationPredicate.isInteresting = function(node) {
// The general rule that applies to everything.
return state[chrome.automation.StateType.FOCUSABLE] === true;
}
};
......@@ -74,5 +74,5 @@ cr.define('cleanup', function() {
return {
CleanupBrowserProxy: CleanupBrowserProxy,
CleanupBrowserProxyImpl: CleanupBrowserProxyImpl,
}
};
});
......@@ -213,7 +213,7 @@ Gnubbies.prototype.enumerate = function(cb, opt_type) {
function makeEnumerateCb(namespace) {
return function(devs) {
enumerated(namespace, deviceIds, devs);
}
};
}
this.pendingEnumerate.push(cb);
......
......@@ -225,7 +225,7 @@ function populateRemoteTargets(devices) {
section.remove();
}
var newDeviceIds = devices.map(function(d) { return d.id });
var newDeviceIds = devices.map(function(d) { return d.id; });
Array.prototype.forEach.call(
deviceList.querySelectorAll('.device'),
removeObsolete.bind(null, newDeviceIds));
......@@ -282,7 +282,7 @@ function populateRemoteTargets(devices) {
var browserList = deviceSection.querySelector('.browsers');
var newBrowserIds =
device.browsers.map(function(b) { return b.id });
device.browsers.map(function(b) { return b.id; });
Array.prototype.forEach.call(
browserList.querySelectorAll('.browser'),
removeObsolete.bind(null, newBrowserIds));
......
......@@ -626,7 +626,7 @@ cr.define('bookmarks', function() {
if (getBookmarkNode(overElement).url)
return false;
return !this.dragInfo_.isDraggingChildBookmark(overElement.itemId)
return !this.dragInfo_.isDraggingChildBookmark(overElement.itemId);
},
disableTimeoutsForTesting: function() {
......
......@@ -107,7 +107,7 @@ var ModulesView = (function() {
ModulesView.getLayeredServiceProviderProtocolType =
function(serviceProvider) {
return tryGetValueWithKey(PROTOCOL_TYPE, serviceProvider.socket_protocol);
}
};
var NAMESPACE_PROVIDER_PTYPE = {
'12': 'NS_DNS',
......
......@@ -78,7 +78,7 @@ DumpDatabase.onGetDatabaseDump = function(databaseDump) {
div.appendChild(table);
placeholder.appendChild(div);
}
}
};
function main() {
getDatabaseDump();
......
......@@ -48,7 +48,7 @@ ExtensionStatuses.onGetExtensionStatuses = function(extensionStatuses) {
tr.appendChild(createElementFromText('td', originEntry.status));
itemContainer.appendChild(tr);
}
}
};
function main() {
getExtensionStatuses();
......
......@@ -23,7 +23,7 @@ function getServiceStatus() {
*/
SyncService.onGetServiceStatus = function(statusString) {
$('service-status').textContent = statusString;
}
};
/**
* Request Google Drive Notification Source. e.g. XMPP or polling.
......@@ -38,7 +38,7 @@ function getNotificationSource() {
*/
SyncService.onGetNotificationSource = function(sourceString) {
$('notification-source').textContent = sourceString;
}
};
// Keeps track of the last log event seen so it's not reprinted.
var lastLogEventId = -1;
......@@ -76,7 +76,7 @@ SyncService.onGetLog = function(logEntries) {
lastLogEventId = logEntry.id;
}
}
};
/**
* Get initial sync service values and set listeners to get updated values.
......
......@@ -44,7 +44,7 @@ TaskLog.onTaskLogRecorded = function(taskLog) {
tr.appendChild(details);
$('task-log-entries').appendChild(tr);
}
};
/**
* Get initial sync service values and set listeners to get updated values.
......
......@@ -248,7 +248,7 @@ CertificateManagerWebUITest.prototype = {
'policy': false }],
}],
]
].forEach(CertificateManager.onPopulateTree)}));
].forEach(CertificateManager.onPopulateTree);}));
},
};
......
......@@ -126,7 +126,7 @@ cr.define('cr.ui', function() {
slice: function(opt_from, opt_to) {
var arr = this.array_;
return this.indexes_.slice(opt_from, opt_to).map(function(index) {
return arr[index]
return arr[index];
});
},
......@@ -399,7 +399,7 @@ cr.define('cr.ui', function() {
} else {
return function(a, b) {
return defaultValuesCompareFunction.call(null, a[field], b[field]);
}
};
}
},
......
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