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.

Merge pull request '[PORT] Enable `no-jquery/no-class-state` (gitea#31639) & Remove `eslint-plugin-jquery` (gitea#31402)' (#5107) from gusted/forgejo-port-gt-31402 into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5107
Reviewed-by: Caesar Schinas <caesar@caesarschinas.com>

Gusted cbedd7e5 e726b7ec

+7 -69
+1 -51
.eslintrc.yaml
··· 16 16 - eslint-plugin-array-func 17 17 - eslint-plugin-github 18 18 - eslint-plugin-i 19 - - eslint-plugin-jquery 20 19 - eslint-plugin-no-jquery 21 20 - eslint-plugin-no-use-extend-native 22 21 - eslint-plugin-regexp ··· 280 279 i/prefer-default-export: [0] 281 280 i/unambiguous: [0] 282 281 init-declarations: [0] 283 - jquery/no-ajax-events: [2] 284 - jquery/no-ajax: [2] 285 - jquery/no-animate: [2] 286 - jquery/no-attr: [2] 287 - jquery/no-bind: [2] 288 - jquery/no-class: [0] 289 - jquery/no-clone: [2] 290 - jquery/no-closest: [0] 291 - jquery/no-css: [2] 292 - jquery/no-data: [0] 293 - jquery/no-deferred: [2] 294 - jquery/no-delegate: [2] 295 - jquery/no-each: [0] 296 - jquery/no-extend: [2] 297 - jquery/no-fade: [2] 298 - jquery/no-filter: [0] 299 - jquery/no-find: [0] 300 - jquery/no-global-eval: [2] 301 - jquery/no-grep: [2] 302 - jquery/no-has: [2] 303 - jquery/no-hide: [2] 304 - jquery/no-html: [0] 305 - jquery/no-in-array: [2] 306 - jquery/no-is-array: [2] 307 - jquery/no-is-function: [2] 308 - jquery/no-is: [2] 309 - jquery/no-load: [2] 310 - jquery/no-map: [2] 311 - jquery/no-merge: [2] 312 - jquery/no-param: [2] 313 - jquery/no-parent: [0] 314 - jquery/no-parents: [2] 315 - jquery/no-parse-html: [2] 316 - jquery/no-prop: [2] 317 - jquery/no-proxy: [2] 318 - jquery/no-ready: [2] 319 - jquery/no-serialize: [2] 320 - jquery/no-show: [2] 321 - jquery/no-size: [2] 322 - jquery/no-sizzle: [0] 323 - jquery/no-slide: [2] 324 - jquery/no-submit: [2] 325 - jquery/no-text: [0] 326 - jquery/no-toggle: [2] 327 - jquery/no-trigger: [0] 328 - jquery/no-trim: [2] 329 - jquery/no-val: [0] 330 - jquery/no-when: [2] 331 - jquery/no-wrap: [2] 332 282 line-comment-position: [0] 333 283 logical-assignment-operators: [0] 334 284 max-classes-per-file: [0] ··· 404 354 no-jquery/no-box-model: [2] 405 355 no-jquery/no-browser: [2] 406 356 no-jquery/no-camel-case: [2] 407 - no-jquery/no-class-state: [0] 357 + no-jquery/no-class-state: [2] 408 358 no-jquery/no-class: [0] 409 359 no-jquery/no-clone: [2] 410 360 no-jquery/no-closest: [0]
-11
package-lock.json
··· 73 73 "eslint-plugin-array-func": "4.0.0", 74 74 "eslint-plugin-github": "5.0.1", 75 75 "eslint-plugin-i": "2.29.1", 76 - "eslint-plugin-jquery": "1.5.1", 77 76 "eslint-plugin-no-jquery": "3.0.2", 78 77 "eslint-plugin-no-use-extend-native": "0.5.0", 79 78 "eslint-plugin-playwright": "1.6.2", ··· 8525 8524 "license": "ISC", 8526 8525 "bin": { 8527 8526 "semver": "bin/semver.js" 8528 - } 8529 - }, 8530 - "node_modules/eslint-plugin-jquery": { 8531 - "version": "1.5.1", 8532 - "resolved": "https://registry.npmjs.org/eslint-plugin-jquery/-/eslint-plugin-jquery-1.5.1.tgz", 8533 - "integrity": "sha512-L7v1eaK5t80C0lvUXPFP9MKnBOqPSKhCOYyzy4LZ0+iK+TJwN8S9gAkzzP1AOhypRIwA88HF6phQ9C7jnOpW8w==", 8534 - "dev": true, 8535 - "license": "MIT", 8536 - "peerDependencies": { 8537 - "eslint": ">=5.4.0" 8538 8527 } 8539 8528 }, 8540 8529 "node_modules/eslint-plugin-jsx-a11y": {
-1
package.json
··· 72 72 "eslint-plugin-array-func": "4.0.0", 73 73 "eslint-plugin-github": "5.0.1", 74 74 "eslint-plugin-i": "2.29.1", 75 - "eslint-plugin-jquery": "1.5.1", 76 75 "eslint-plugin-no-jquery": "3.0.2", 77 76 "eslint-plugin-no-use-extend-native": "0.5.0", 78 77 "eslint-plugin-playwright": "1.6.2",
+6 -6
web_src/js/features/repo-legacy.js
··· 64 64 function initBranchSelector() { 65 65 const $selectBranch = $('.ui.select-branch'); 66 66 const $branchMenu = $selectBranch.find('.reference-list-menu'); 67 - const $isNewIssue = $branchMenu.hasClass('new-issue'); 67 + const $isNewIssue = $branchMenu[0]?.classList.contains('new-issue'); 68 68 $branchMenu.find('.item:not(.no-select)').on('click', async function () { 69 69 const selectedValue = $(this).data('id'); 70 70 const editMode = $('#editing_mode').val(); ··· 132 132 133 133 $listMenu.find('.item:not(.no-select)').on('click', function (e) { 134 134 e.preventDefault(); 135 - if ($(this).hasClass('ban-change')) { 135 + if (this.classList.contains('ban-change')) { 136 136 return false; 137 137 } 138 138 ··· 147 147 if (this.getAttribute('data-scope') !== scope) { 148 148 return true; 149 149 } 150 - if (this !== clickedItem && !$(this).hasClass('checked')) { 150 + if (this !== clickedItem && !this.classList.contains('checked')) { 151 151 return true; 152 152 } 153 153 } else if (this !== clickedItem) { ··· 155 155 return true; 156 156 } 157 157 158 - if ($(this).hasClass('checked')) { 158 + if (this.classList.contains('checked')) { 159 159 $(this).removeClass('checked'); 160 160 $(this).find('.octicon-check').addClass('tw-invisible'); 161 161 if (hasUpdateAction) { ··· 194 194 195 195 const listIds = []; 196 196 $(this).parent().find('.item').each(function () { 197 - if ($(this).hasClass('checked')) { 197 + if (this.classList.contains('checked')) { 198 198 listIds.push($(this).data('id')); 199 199 $($(this).data('id-selector')).removeClass('tw-hidden'); 200 200 } else { ··· 605 605 const quote = $(`#${target}`).text().replace(/\n/g, '\n> '); 606 606 const content = `> ${quote}\n\n`; 607 607 let editor; 608 - if ($(this).hasClass('quote-reply-diff')) { 608 + if (this.classList.contains('quote-reply-diff')) { 609 609 const $replyBtn = $(this).closest('.comment-code-cloud').find('button.comment-form-reply'); 610 610 editor = await handleReply($replyBtn); 611 611 } else {