aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-21 09:31:21 -0500
committerGitHub <noreply@github.com>2023-12-21 14:31:21 +0000
commitf041f808891d6fc16e02a05b96a398ab432c756a (patch)
treef56c7ddbb4ec11a09822c5c53e23a9d7031a83e5 /ext/js/pages/settings
parent7dcf023dcc164b24f2c18ed6ba1140342c2797c5 (diff)
Enable no-new eslint rule (#411)
Diffstat (limited to 'ext/js/pages/settings')
-rw-r--r--ext/js/pages/settings/profile-conditions-ui.js1
-rw-r--r--ext/js/pages/settings/translation-text-replacements-controller.js1
2 files changed, 2 insertions, 0 deletions
diff --git a/ext/js/pages/settings/profile-conditions-ui.js b/ext/js/pages/settings/profile-conditions-ui.js
index 715aeb69..8e5da3d8 100644
--- a/ext/js/pages/settings/profile-conditions-ui.js
+++ b/ext/js/pages/settings/profile-conditions-ui.js
@@ -389,6 +389,7 @@ export class ProfileConditionsUI extends EventDispatcher {
*/
_validateRegExp(value) {
try {
+ // eslint-disable-next-line no-new
new RegExp(value, 'i');
return true;
} catch (e) {
diff --git a/ext/js/pages/settings/translation-text-replacements-controller.js b/ext/js/pages/settings/translation-text-replacements-controller.js
index a54c3dd9..ebd1b58d 100644
--- a/ext/js/pages/settings/translation-text-replacements-controller.js
+++ b/ext/js/pages/settings/translation-text-replacements-controller.js
@@ -268,6 +268,7 @@ class TranslationTextReplacementsEntry {
let okay = false;
try {
if (typeof value === 'string') {
+ // eslint-disable-next-line no-new
new RegExp(value, 'g');
okay = true;
}