From a2304cb163ce5e097078e71f49d4d5cb4c8b20d9 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 10 Jun 2024 12:12:31 +0200 Subject: [PATCH] Remove jQuery `.text()` (#30506) Remove and forbid [.text()](https://api.jquery.com/text/). Tested some, but not all functionality, but I think these are pretty safe replacements. --------- Co-authored-by: wxiaoguang --- .eslintrc.yaml | 4 +- templates/repo/editor/commit_form.tmpl | 6 +- templates/repo/settings/collaboration.tmpl | 8 +- web_src/js/features/common-global.js | 95 ++++++++++-------- web_src/js/features/imagediff.js | 10 +- web_src/js/features/notification.js | 14 +-- web_src/js/features/repo-editor.js | 111 ++++++++------------- web_src/js/features/repo-issue-edit.js | 7 +- web_src/js/features/repo-issue.js | 22 ++-- web_src/js/features/repo-legacy.js | 4 +- web_src/js/features/repo-settings.js | 45 ++++----- web_src/js/index.js | 4 +- 12 files changed, 161 insertions(+), 169 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 0eda8a1877..cbfe0220e8 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -324,7 +324,7 @@ rules: jquery/no-sizzle: [2] jquery/no-slide: [2] jquery/no-submit: [2] - jquery/no-text: [0] + jquery/no-text: [2] jquery/no-toggle: [2] jquery/no-trigger: [0] jquery/no-trim: [2] @@ -477,7 +477,7 @@ rules: no-jquery/no-slide: [2] no-jquery/no-sub: [2] no-jquery/no-support: [2] - no-jquery/no-text: [0] + no-jquery/no-text: [2] no-jquery/no-trigger: [0] no-jquery/no-trim: [2] no-jquery/no-type: [2] diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl index 21ef63288f..61122417d2 100644 --- a/templates/repo/editor/commit_form.tmpl +++ b/templates/repo/editor/commit_form.tmpl @@ -23,7 +23,7 @@
- +