-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
This is the same issue as #9592 that was closed due to old age (and that the TSC, at the time, decided against its consideration).
-
Now we have 2020, and Browser Modules have shipped in all stable Browser channels, see https://caniuse.com/#feat=es6-module
-
All Browsers (meaning Firefox, Chromium, Edgium, Safari 12+ and all downstream forks, including WebKitGTK / QTWebKit) accept the
.mjs
ESM module file extension by default and expressively check against theapplication/javascript
header for that specific file extension when being used as<script type="module">
and it can be assumed that this is the defacto standard file extension for ESM modules now. -
Node.js removed the
--experimental
flag in its stable release channel. -
The IETF is working on an RFC to include
mjs
as the official file extension in the following Draft: https://tools.ietf.org/html/draft-ietf-dispatch-javascript-mjs-05 -
The Python language adapted
mjs
as the file extension for ESM modules: https://bugs.python.org/issue31715 -
Golang adapted
mjs
as the file extension for ESM modules: net/http: add built-in mime type for *.mjs golang/go#30547
Given the circumstances and the state that ESM modules are in, right now, and that mjs
as a file extension was already pushed out on stable channels of above mentioned implementations - and considering the IETF effort that is put this into an RFC - I think it is safe to say that mjs
will be the official file extension soon.
I hope that the file extension mjs
can now be reconsidered to be included in the default file extensions that are linted by eslint
.
Paste the command you used to run ESLint:
eslint --ext js,mjs ./*; # mjs should not be necessary
What did you expect to happen?
eslint ./*; # should behave the same way as above
Are you willing to submit a pull request to fix this bug?
Yes, of course.