From aa82f082eb9aa47aafe656d0db06c9c923deff71 Mon Sep 17 00:00:00 2001
From: Winnie Hellmann <winnie@gitlab.com>
Date: Mon, 16 Dec 2019 21:02:50 +0000
Subject: [PATCH] Enable no-jquery/slim ESLint profile

---
 .eslintrc.yml                  | 8 ++++----
 app/assets/javascripts/main.js | 1 +
 package.json                   | 2 +-
 yarn.lock                      | 8 ++++----
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/.eslintrc.yml b/.eslintrc.yml
index 5fc4af97e2d73..7ede62ec979e4 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -1,6 +1,7 @@
 extends:
   - '@gitlab'
   - plugin:promise/recommended
+  - plugin:no-jquery/slim
 globals:
   __webpack_public_path__: true
   gl: false
@@ -44,10 +45,9 @@ rules:
   vue/no-use-v-if-with-v-for: off
   vue/no-v-html: off
   vue/use-v-on-exact: off
-  no-jquery/no-ajax: error
-  no-jquery/no-ajax-events: error
-  no-jquery/no-load: error
-  no-jquery/no-load-shorthand: error
+  no-jquery/no-animate: off
+  no-jquery/no-animate-toggle: off
+  no-jquery/no-fade: off
   no-jquery/no-serialize: error
   promise/always-return: off
   promise/no-callback-in-promise: off
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js
index 465c9a362ba4c..674415c9d01de 100644
--- a/app/assets/javascripts/main.js
+++ b/app/assets/javascripts/main.js
@@ -222,6 +222,7 @@ document.addEventListener('DOMContentLoaded', () => {
     }
   });
 
+  // eslint-disable-next-line no-jquery/no-ajax-events
   $(document).ajaxError((e, xhrObj) => {
     const ref = xhrObj.status;
 
diff --git a/package.json b/package.json
index da69960107da2..e60ae6d5a80ec 100644
--- a/package.json
+++ b/package.json
@@ -159,7 +159,7 @@
     "eslint-import-resolver-webpack": "^0.10.1",
     "eslint-plugin-jasmine": "^2.10.1",
     "eslint-plugin-jest": "^22.3.0",
-    "eslint-plugin-no-jquery": "^2.1.0",
+    "eslint-plugin-no-jquery": "^2.3.0",
     "gettext-extractor": "^3.4.3",
     "gettext-extractor-vue": "^4.0.2",
     "graphql-tag": "^2.10.0",
diff --git a/yarn.lock b/yarn.lock
index d20fef4bb6a3c..fbc6733fea4ab 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4270,10 +4270,10 @@ eslint-plugin-jest@^22.3.0:
   resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.3.0.tgz#a10f10dedfc92def774ec9bb5bfbd2fb8e1c96d2"
   integrity sha512-P1mYVRNlOEoO5T9yTqOfucjOYf1ktmJ26NjwjH8sxpCFQa6IhBGr5TpKl3hcAAT29hOsRJVuMWmTsHoUVo9FoA==
 
-eslint-plugin-no-jquery@^2.1.0:
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-2.1.0.tgz#d03b74224c5cfbc7fc0bdd12ce4eb400d09e0c0b"
-  integrity sha512-5sr5tOJRfuRviyAvFTe/mr80TXWxTteD/JHRuJtDN8q/bxAh16eSKoKLAevLC7wZCRN2iwnEfhQPQV4rp/gYtg==
+eslint-plugin-no-jquery@^2.3.0:
+  version "2.3.0"
+  resolved "https://registry.yarnpkg.com/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-2.3.0.tgz#fccdad84afa61baa4c0527dd6249cdcbfa0f74a8"
+  integrity sha512-XQQZM5yKO72Y8QAojNhH8oYLnLZU34FovNHVoJlPLBuBPJk0kkiPNOS/K6wRFbVgn47iZHsT6E+7mSLwbcQEsg==
 
 eslint-plugin-promise@^4.1.1:
   version "4.1.1"
-- 
GitLab