From 9f6a682ca9a792561af78f9d8d867822dcbcceda Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Wed, 3 Feb 2021 23:52:14 -0700
Subject: [PATCH] chore: eslint no-script-url
---
.eslintrc | 1 -
public/src/ajaxify.js | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/.eslintrc b/.eslintrc
index 2aed010487..2290d9a6be 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -114,7 +114,6 @@
"prefer-template": "off",
"no-var": "off",
"vars-on-top": "off",
- "no-script-url": "off",
"import/newline-after-import": "off",
// TODO
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index 8dddd5c73a..02d5269fd8 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -446,6 +446,7 @@ $(document).ready(function () {
function ajaxifyAnchors() {
function hrefEmpty(href) {
+ // eslint-disable-next-line no-script-url
return href === undefined || href === '' || href === 'javascript:;';
}
var location = document.location || window.location;
@@ -516,6 +517,7 @@ $(document).ready(function () {
return;
}
+ // eslint-disable-next-line no-script-url
if (hrefEmpty(this.href) || this.protocol === 'javascript:' || href === '#' || href === '') {
return e.preventDefault();
}