Remove jQuery .map() and enable eslint rules for it (#29272)

- Use case in `repo-commit` was tested until the point where the POST
request was sent with the same payload.
- Use case in `repo-legacy` was tested completely with comment editing.
- `jquery/no-fade` was disabled as well to stay in sync with
`no-jquery/no-fade`, had no violations.

(cherry picked from commit a5c570c1e02302212a5d8f7cf7d91f24ab0578d5)
This commit is contained in:
silverwind 2024-02-21 01:05:17 +01:00 committed by Earl Warren
parent 0d61f3decc
commit 6068537f8a
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 14 additions and 19 deletions

View file

@ -14,17 +14,15 @@ export function initRepoEllipsisButton() {
}
export function initRepoCommitLastCommitLoader() {
const notReadyEls = document.querySelectorAll('table#repo-files-table tr.notready');
if (!notReadyEls.length) return;
const entryMap = {};
const entries = $('table#repo-files-table tr.notready')
.map((_, v) => {
entryMap[$(v).attr('data-entryname')] = $(v);
return $(v).attr('data-entryname');
})
.get();
if (entries.length === 0) {
return;
const entries = [];
for (const el of notReadyEls) {
const entryname = el.getAttribute('data-entryname');
entryMap[entryname] = $(el);
entries.push(entryname);
}
const lastCommitLoaderURL = $('table#repo-files-table').data('lastCommitLoaderUrl');