loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: enable `no-jquery/no-each-util`

- No longer allow `$.each`. This can easily be done with vanilla javascript.

Gusted c1240141 9eb67ba8

+11 -13
+1 -1
eslint.config.mjs
··· 320 320 'no-jquery/no-delegate': [2], 321 321 'no-jquery/no-done-fail': [2], 322 322 'no-jquery/no-each-collection': [0], 323 - 'no-jquery/no-each-util': [0], 323 + 'no-jquery/no-each-util': [2], 324 324 'no-jquery/no-each': [0], 325 325 'no-jquery/no-error-shorthand': [2], 326 326 'no-jquery/no-error': [2],
+2 -3
web_src/js/features/org-team.js
··· 10 10 url: `${appSubUrl}/repo/search?q={query}&uid=${$searchRepoBox.data('uid')}`, 11 11 onResponse(response) { 12 12 const items = []; 13 - $.each(response.data, (_i, item) => { 13 + for (const item of response.data) { 14 14 items.push({ 15 15 title: item.repository.full_name.split('/')[1], 16 16 description: item.repository.full_name, 17 17 }); 18 - }); 19 - 18 + } 20 19 return {results: items}; 21 20 }, 22 21 },
+4 -4
web_src/js/features/repo-issue.js
··· 139 139 const filteredResponse = {success: true, results: []}; 140 140 const currIssueId = $('#new-dependency-drop-list').data('issue-id'); 141 141 // Parse the response from the api to work with our dropdown 142 - $.each(response, (_i, issue) => { 142 + for (const [_, issue] of Object.entries(response)) { 143 143 // Don't list current issue in the dependency list. 144 144 if (issue.id === currIssueId) { 145 145 return; ··· 149 149 }<div class="text small tw-break-anywhere">${htmlEscape(issue.repository.full_name)}</div>`, 150 150 value: issue.id, 151 151 }); 152 - }); 152 + } 153 153 return filteredResponse; 154 154 }, 155 155 cache: false, ··· 345 345 url: `${appSubUrl}/repo/search?q={query}&limit=20`, 346 346 onResponse(response) { 347 347 const filteredResponse = {success: true, results: []}; 348 - $.each(response.data, (_r, repo) => { 348 + for (const repo of response.data) { 349 349 filteredResponse.results.push({ 350 350 name: htmlEscape(repo.repository.full_name), 351 351 value: repo.repository.full_name, 352 352 }); 353 - }); 353 + } 354 354 return filteredResponse; 355 355 }, 356 356 cache: false,
+2 -3
web_src/js/features/repo-settings.js
··· 55 55 headers: {'X-Csrf-Token': csrfToken}, 56 56 onResponse(response) { 57 57 const items = []; 58 - $.each(response.data, (_i, item) => { 58 + for (const item of response.data) { 59 59 items.push({ 60 60 title: item.name, 61 61 description: `${item.permission} access`, // TODO: translate this string 62 62 }); 63 - }); 64 - 63 + } 65 64 return {results: items}; 66 65 }, 67 66 },
+2 -2
web_src/js/features/repo-template.js
··· 32 32 value: '', 33 33 }); 34 34 // Parse the response from the api to work with our dropdown 35 - $.each(response.data, (_r, repo) => { 35 + for (const repo of response.data) { 36 36 filteredResponse.results.push({ 37 37 name: htmlEscape(repo.repository.full_name), 38 38 value: repo.repository.id, 39 39 }); 40 - }); 40 + } 41 41 return filteredResponse; 42 42 }, 43 43 cache: false,