Skip to content

Commit 44ac8c8

Browse files
authored
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 0753201
1 parent 0753201 commit 44ac8c8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"commitplease": "3.2.0",
3131
"core-js-bundle": "3.0.0",
3232
"eslint-config-jquery": "2.0.0",
33+
"eslint-plugin-import": "2.18.2",
3334
"grunt": "1.0.4",
3435
"grunt-babel": "8.0.0",
3536
"grunt-cli": "1.3.2",

src/.eslintrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
"sourceType": "module"
99
},
1010

11+
"plugins": [ "import" ],
12+
13+
"rules": {
14+
"import/extensions": [ "error", "always" ],
15+
"import/no-cycle": "error"
16+
},
17+
1118
"overrides": [
1219
{
1320
"files": "wrapper.js",

0 commit comments

Comments
 (0)