Skip to content

Bump: Add --ext mjs to default file extensions #13301

@cookiengineer

Description

@cookiengineer

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).

  1. Now we have 2020, and Browser Modules have shipped in all stable Browser channels, see https://caniuse.com/#feat=es6-module

  2. 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 the application/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.

  3. Node.js removed the --experimental flag in its stable release channel.

  4. 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

  5. The Python language adapted mjs as the file extension for ESM modules: https://bugs.python.org/issue31715

  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    archived due to ageThis issue has been archived; please open a new issue for any further discussionauto closedThe bot closed this issuebugESLint is working incorrectlytriageAn ESLint team member will look at this issue soon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions