Build: Require extensions for ES6 imports, prevent import cycles

jQuery source is now authored in ECMAScript modules. Native browser support
for them requires full file names including extensions. Rollup works even
if import paths don't specify extensions, though, so one import slipped
through without such an extension, breaking native browser import of
src/jquery.js.

A new ESLint rule using eslint-plugin-import prevents us from regressing
on that front.

Also, eslint-plugin-import's no-cycle rule is used to avoid import cycles.

Closes gh-4544
Ref gh-4541
Ref 075320149a
This commit is contained in:
Michał Gołębiowski-Owczarek 2019-11-25 20:16:53 +01:00 committed by GitHub
parent 075320149a
commit 44ac8c8529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,7 @@
"commitplease": "3.2.0",
"core-js-bundle": "3.0.0",
"eslint-config-jquery": "2.0.0",
"eslint-plugin-import": "2.18.2",
"grunt": "1.0.4",
"grunt-babel": "8.0.0",
"grunt-cli": "1.3.2",

View File

@ -8,6 +8,13 @@
"sourceType": "module"
},
"plugins": [ "import" ],
"rules": {
"import/extensions": [ "error", "always" ],
"import/no-cycle": "error"
},
"overrides": [
{
"files": "wrapper.js",