chore: upgrade lint tools#2720
Conversation
| var data = {}; | ||
|
|
||
| var persistPermissions = function (that, form) { | ||
| // construct an appropriate data object from the form | ||
| data.elementID = $(form) | ||
| .find('[name=nodeId]') | ||
| .val(); | ||
| data.action = 'updatePermissions'; | ||
| data.deletable = $(form.deletable).is(':checked'); | ||
| data.movable = $(form.movable).is(':checked'); |
There was a problem hiding this comment.
SonarQube caught this could be flattened
| var uportal = uportal || {}; | ||
|
|
||
| (function($, fluid) { | ||
| (function ($, fluid) { |
There was a problem hiding this comment.
prettier now adds a space between function and params
| if ($.browser.msie) { | ||
| if ($.browser.version === '7.0') { |
There was a problem hiding this comment.
these conditions were flattened
|
|
||
| var tree = {children: []}; | ||
| $(results).each(function(idx, result) { | ||
| $(results).each(function (index, result) { |
There was a problem hiding this comment.
unicorn aims to have abbreviations like idx, msg, e, spelled out in clear English words.
| }, | ||
| listeners: { | ||
| onUpdatePermissions: function(element, newPermissions) { | ||
| if (!newPermissions.movable) { |
There was a problem hiding this comment.
conditions were reversed automatically to avoid negation
| that.state.portlets.push(portlet); | ||
| that.state.portlets['portlet.' + portlet.id] = | ||
| that.state.portlets[that.state.portlets.length - 1]; | ||
| that.state.portlets.at(-1); |
There was a problem hiding this comment.
automatically changed to simpler way to access final element
| * be included in the uPortal.war package. | ||
| */ | ||
| @import url("../../../../webjars/bootstrap/less/bootstrap.less"); | ||
| @import "../../../../webjars/bootstrap/less/bootstrap.less"; |
There was a problem hiding this comment.
less does not require the url function for imports
| } | ||
| } | ||
|
|
||
| .active { |
There was a problem hiding this comment.
.active was declared in two places this was manually moved to combine them
| /** | ||
| * Simple function to escape specific HTML characters so they aren't | ||
| * a problem. &, quote, and single quote are handled by jQuery so | ||
| * only need to deal with < and > | ||
| * @param {string} str - unescaped input | ||
| * @return {string} escaped output | ||
| */ | ||
| function htmlEscape(string_) { | ||
| return String(string_).replaceAll('<', '<').replaceAll('>', '>'); | ||
| } | ||
|
|
||
| /** | ||
| * Helper method for making it a little easier to format the output in the menu | ||
| * @param {object} item A JavaScript Object containing the item values | ||
| * @return {string} Returns a formatted string that will be injected into the menu | ||
| */ | ||
| var formatOutput = function (item) { | ||
| return ( | ||
| '<a><span class="autocomplete-header">' + | ||
| htmlEscape(item.title) + | ||
| '</span><br>' + | ||
| htmlEscape(item.desc) + | ||
| '</a>' | ||
| ); | ||
| }; |
There was a problem hiding this comment.
these are pure functions, and were extracted up a level to avoid unnecessary reallocation.
| updateCountdown = function() { | ||
| var now = new Date().getTime(); | ||
| updateCountdown = function () { | ||
| var now = Date.now(); |
There was a problem hiding this comment.
automatically updated, same timestamp, but avoids instantiating a new class to generate it.
c6b710f to
c001b13
Compare
Checklist
Description of change
eslint-config-googlewhich is deprecated by Google📓⚠️ if/when this is merged, please squash merge to avoid unnecessary churn in files.