Skip to content

Commit dcf1bba

Browse files
authored
Merge pull request #18752 from danidoni/remove-jshint-unused-comments
Replace jshint ignore lines with propper function exports
2 parents 832ea2d + 4589dd4 commit dcf1bba

35 files changed

+150
-72
lines changed

src/api/app/assets/javascripts/webui/autocomplete.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
function setupAutocomplete(selector) { // jshint ignore:line
1+
/* exported setupAutocomplete */
2+
3+
function setupAutocomplete(selector) {
24
$(selector).autocomplete({
35
// Note: 'append' is optional and only needed when there is no element with class ui-front
46
appendTo: $(selector).data('append'),
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
/* exported badgeTextCopy */
2+
/* global BASE_BADGE_URL, BASE_PACKAGE_URL */
3+
14
// BASE_BADGE_URL and BASE_PACKAGE_URL are set in the view
25
function buildBadge() {
3-
var badgeImageUrl = new URL(BASE_BADGE_URL); // jshint ignore:line
6+
var badgeImageUrl = new URL(BASE_BADGE_URL);
47
badgeImageUrl.searchParams.set('type', $('#badge-style-selector').val());
58
$('#badge-preview').attr("src", badgeImageUrl);
6-
return '[![build result](' + badgeImageUrl + ')](' + BASE_PACKAGE_URL + ')'; // jshint ignore:line
9+
return '[![build result](' + badgeImageUrl + ')](' + BASE_PACKAGE_URL + ')';
710
}
811

9-
function badgeTextCopy() { // jshint ignore:line
12+
function badgeTextCopy() {
1013
$('#copy-to-clipboard-readonly').val(buildBadge());
1114
}

src/api/app/assets/javascripts/webui/banners.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
function dismissBanner(bannerId, cookieId) { // jshint ignore:line
1+
/* exported dismissBanner */
2+
3+
function dismissBanner(bannerId, cookieId) {
24
const btn = document.getElementById(bannerId);
35
if (btn) {
46
btn.addEventListener("click", function () {

src/api/app/assets/javascripts/webui/buildresult.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
/* exported updateRpmlintResult, updateBuildResult, updateArchDisplay, toggleBuildInfo */
2+
/* global initializePopovers */
3+
14
// TODO: replace with the content of
25
// app/assets/javascripts/webui/request_show_redesign/build_results.js
36
// after the rollout of 'request_show_redesign'.
47

5-
function updateRpmlintResult(index) { // jshint ignore:line
8+
function updateRpmlintResult(index) {
69
$('#rpm'+index+'-reload').addClass('fa-spin');
710
$.ajax({
811
url: '/package/rpmlint_result',
@@ -19,7 +22,7 @@ function updateRpmlintResult(index) { // jshint ignore:line
1922
});
2023
}
2124

22-
function updateBuildResult(index) { // jshint ignore:line
25+
function updateBuildResult(index) {
2326
var collapsedPackages = [];
2427
var collapsedRepositories = {};
2528
$('.result div.collapse:not(.show)').map(function(_index, domElement) {
@@ -49,12 +52,12 @@ function updateBuildResult(index) { // jshint ignore:line
4952
},
5053
complete: function() {
5154
$('#build' + index + '-reload').removeClass('fa-spin');
52-
initializePopovers('[data-toggle="popover"]'); // jshint ignore:line
55+
initializePopovers('[data-toggle="popover"]');
5356
}
5457
});
5558
}
5659

57-
function updateArchDisplay(index) { // jshint ignore:line
60+
function updateArchDisplay(index) {
5861
$('.rpmlint_arch_select_' + index).hide();
5962
$('select[name="rpmlint_arch_select_' + index + '_' + $('#rpmlint_repo_select_' + index + ' option:selected').attr('value') + '"]').show();
6063
updateRpmlintDisplay(index);
@@ -75,7 +78,7 @@ function updateRpmlintDisplay(index) {
7578
}
7679

7780
// TODO: Stop using toggleBuildInfo in favor of the generic toggleCollapsibleTooltip
78-
function toggleBuildInfo() { // jshint ignore:line
81+
function toggleBuildInfo() {
7982
$('.toggle-build-info').on('click', function(){
8083
var replaceTitle = $(this).attr('title') === 'Click to keep it open' ? 'Click to close it' : 'Click to keep it open';
8184
var infoContainer = $(this).parents('.toggle-build-info-parent').next();

src/api/app/assets/javascripts/webui/canned_responses.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
function setupCannedResponses() { // jshint ignore:line
1+
/* exported setupCannedResponses */
2+
3+
function setupCannedResponses() {
24
$('[data-canned-controller]').on('click', '[data-canned-response]', function(e) {
35
$(e.target).closest('[data-canned-controller]').find('textarea').val(e.target.dataset.cannedResponse);
46
// let's make sure this exists first, to avoid errors

src/api/app/assets/javascripts/webui/collapsible_text.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
function setCollapsible() { // jshint ignore:line
1+
/* exported setCollapsible */
2+
3+
function setCollapsible() {
24
$('.obs-collapsible-textbox').each(function() {
35
var container = $(this);
46
var textBox = container.find('.obs-collapsible-text');

src/api/app/assets/javascripts/webui/collapsible_tooltip.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
function toggleCollapsibleTooltip() { // jshint ignore:line
1+
/* exported toggleCollapsibleTooltip */
2+
3+
function toggleCollapsibleTooltip() {
24
$('.collapsible-tooltip').on('click', function(){
35
var replaceTitle = $(this).attr('title') === 'Click to keep it open' ? 'Click to close it' : 'Click to keep it open';
46
var infoContainer = $(this).parents('.collapsible-tooltip-parent').next();

src/api/app/assets/javascripts/webui/comment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function resizeTextarea(textarea) { // jshint ignore:line
1+
function resizeTextarea(textarea) {
22
var heightPerRow = Math.ceil(textarea.clientHeight / textarea.rows);
33
var linesOfText = Math.ceil(textarea.scrollHeight / heightPerRow);
44
var rowsToIncrease = linesOfText - textarea.rows;

src/api/app/assets/javascripts/webui/datatables.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* exported initializeDataTable, initializeRemoteDatatable */
2+
13
//= require datatables/jquery.dataTables
24
//= require datatables/dataTables.bootstrap5
35
//= require datatables/extensions/Responsive/dataTables.responsive
@@ -27,12 +29,12 @@ var DEFAULT_DT_PARAMS = {
2729
}
2830
};
2931

30-
function initializeDataTable(cssSelector, params){ // jshint ignore:line
32+
function initializeDataTable(cssSelector, params){
3133
var newParams = $.extend({}, DEFAULT_DT_PARAMS, params);
3234
$(cssSelector).DataTable(newParams);
3335
}
3436

35-
function initializeRemoteDatatable(cssSelector, params) { // jshint ignore:line
37+
function initializeRemoteDatatable(cssSelector, params) {
3638
var defaultRemoteParams = {
3739
processing: true,
3840
serverSide: true,

src/api/app/assets/javascripts/webui/delete_confirmation_dialog.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
function collectDeleteConfirmationModalsAndSetValues() { // jshint ignore:line
1+
/* exported collectDeleteConfirmationModalsAndSetValues */
2+
3+
function collectDeleteConfirmationModalsAndSetValues() {
24
$.each(modalIds(), function( _index, modalId ) {
35
setValuesOnDeleteConfirmationDialog(modalId);
46
});

0 commit comments

Comments
 (0)