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.
This commit is contained in:
Michał Gołębiowski-Owczarek 2020-06-02 13:45:08 +02:00 committed by GitHub
parent 0b676ae12d
commit 40c3abd0ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 5 additions and 9 deletions

View File

@ -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
} ]

View File

@ -118,5 +118,3 @@ init.prototype = jQuery.fn;
// Initialize central reference
rootjQuery = jQuery( document );
export default init;

View File

@ -20,5 +20,3 @@ jQuery.parseXML = function( data ) {
}
return xml;
};
export default jQuery.parseXML;

View File

@ -1 +0,0 @@
export default ( /HTML$/i );

View File

@ -190,5 +190,3 @@ jQuery.fn.extend( {
}
}
} );
export default jQuery;

1
src/jquery.js vendored
View File

@ -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";

View File

@ -22,5 +22,3 @@ jQuery._evalUrl = function( url, options, doc ) {
}
} );
};
export default jQuery._evalUrl;