diff options
author | silverwind <me@silverwind.io> | 2023-05-18 03:14:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-18 09:14:31 +0800 |
commit | 4aacc3ac784601339f663881e5cc253e982b3f37 (patch) | |
tree | ac5d3d2d8a1b88f190bbef3124e904b6cc3d0463 /web_src/js | |
parent | 71451ab8441b67a3629052e29b26b7ac815953f2 (diff) | |
download | gitea-4aacc3ac784601339f663881e5cc253e982b3f37.tar.gz gitea-4aacc3ac784601339f663881e5cc253e982b3f37.zip |
Add two eslint plugins (#24776)
Add these two plugins and autofix issues:
-
[eslint-plugin-no-use-extend-native](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native)
-
[eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func)
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/features/copycontent.js | 2 | ||||
-rw-r--r-- | web_src/js/features/repo-projects.js | 2 | ||||
-rw-r--r-- | web_src/js/utils/match.js | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/web_src/js/features/copycontent.js b/web_src/js/features/copycontent.js index 646fafeb0f..621d6dab73 100644 --- a/web_src/js/features/copycontent.js +++ b/web_src/js/features/copycontent.js @@ -36,7 +36,7 @@ export function initCopyContent() { } } else { // text, read from DOM const lineEls = document.querySelectorAll('.file-view .lines-code'); - content = Array.from(lineEls).map((el) => el.textContent).join(''); + content = Array.from(lineEls, (el) => el.textContent).join(''); } // try copy original first, if that fails and it's an image, convert it to png diff --git a/web_src/js/features/repo-projects.js b/web_src/js/features/repo-projects.js index abbe23458e..b8cb651f69 100644 --- a/web_src/js/features/repo-projects.js +++ b/web_src/js/features/repo-projects.js @@ -15,7 +15,7 @@ function moveIssue({item, from, to, oldIndex}) { updateIssueCount(to); const columnSorting = { - issues: [...columnCards].map((card, i) => ({ + issues: Array.from(columnCards, (card, i) => ({ issueID: parseInt($(card).attr('data-issue')), sorting: i })) diff --git a/web_src/js/utils/match.js b/web_src/js/utils/match.js index 0d20ca336f..31763b0940 100644 --- a/web_src/js/utils/match.js +++ b/web_src/js/utils/match.js @@ -3,7 +3,7 @@ import emojis from '../../../assets/emoji.json'; const maxMatches = 6; function sortAndReduce(map) { - const sortedMap = new Map([...map.entries()].sort((a, b) => a[1] - b[1])); + const sortedMap = new Map(Array.from(map.entries()).sort((a, b) => a[1] - b[1])); return Array.from(sortedMap.keys()).slice(0, maxMatches); } |