From 40c3abd0ab049449acab5f2e12c34b9cc3199482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Tue, 2 Jun 2020 13:45:08 +0200 Subject: [PATCH] Build:Event: Make sure all source modules' exports are used (#4648) To achieve that, use `eslint-plugin-import`'s `no-unused-modules` rule. Also, explicitly import `event/trigger.js` from `jquery.js`; so far it was only imported from ajax.js, making it mistakenly skipped in the `custom:slim,-deprecated` build. --- src/.eslintrc.json | 4 ++++ src/core/init.js | 2 -- src/core/parseXML.js | 2 -- src/core/var/rhtml.js | 1 - src/event/trigger.js | 2 -- src/jquery.js | 1 + src/manipulation/_evalUrl.js | 2 -- 7 files changed, 5 insertions(+), 9 deletions(-) delete mode 100644 src/core/var/rhtml.js diff --git a/src/.eslintrc.json b/src/.eslintrc.json index 8b0b90f16..96b83ff10 100644 --- a/src/.eslintrc.json +++ b/src/.eslintrc.json @@ -13,6 +13,10 @@ "rules": { "import/extensions": [ "error", "always" ], "import/no-cycle": "error", + "import/no-unused-modules": [ "error", { + "unusedExports": true, + "ignoreExports": [ "src/*.js" ] + } ], "indent": [ "error", "tab", { "outerIIFEBody": 0 } ] diff --git a/src/core/init.js b/src/core/init.js index c2f35e1f4..a97fc1060 100644 --- a/src/core/init.js +++ b/src/core/init.js @@ -118,5 +118,3 @@ init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); - -export default init; diff --git a/src/core/parseXML.js b/src/core/parseXML.js index d547eab53..715f59f1f 100644 --- a/src/core/parseXML.js +++ b/src/core/parseXML.js @@ -20,5 +20,3 @@ jQuery.parseXML = function( data ) { } return xml; }; - -export default jQuery.parseXML; diff --git a/src/core/var/rhtml.js b/src/core/var/rhtml.js deleted file mode 100644 index 3dace14c5..000000000 --- a/src/core/var/rhtml.js +++ /dev/null @@ -1 +0,0 @@ -export default ( /HTML$/i ); diff --git a/src/event/trigger.js b/src/event/trigger.js index f36000af7..7919a5013 100644 --- a/src/event/trigger.js +++ b/src/event/trigger.js @@ -190,5 +190,3 @@ jQuery.fn.extend( { } } } ); - -export default jQuery; diff --git a/src/jquery.js b/src/jquery.js index d9fd61afa..a0d5d3647 100644 --- a/src/jquery.js +++ b/src/jquery.js @@ -11,6 +11,7 @@ import "./queue.js"; import "./queue/delay.js"; import "./attributes.js"; import "./event.js"; +import "./event/trigger.js"; import "./manipulation.js"; import "./manipulation/_evalUrl.js"; import "./wrap.js"; diff --git a/src/manipulation/_evalUrl.js b/src/manipulation/_evalUrl.js index f88b747cc..0f7559ff0 100644 --- a/src/manipulation/_evalUrl.js +++ b/src/manipulation/_evalUrl.js @@ -22,5 +22,3 @@ jQuery._evalUrl = function( url, options, doc ) { } } ); }; - -export default jQuery._evalUrl;