Package: media-types
Version: 10.0.0
Currently /etc/mime.types has .es as first suffix associated with the
text/javascript media type
text/javascript es js mjs
I suggest to put the "es" extension last, or perhaps even to add
text/ecmascript record for it. It would allow to avoid accidents like
python3 -c 'import mimetypes;
print(mimetypes.guess_extension("text/javascript"))'
.es
Certainly I expect the ".js" result.
My reading of RFC 9239 Updates to ECMAScript Media Types
https://datatracker.ietf.org/doc/rfc9239/
is that ".es" is associated with the obsolete media type
text/ecmascript, but not with text/javascript.
In Fedora /etc/mime.types has a record for text/ecmascript
https://pagure.io/mailcap/blob/master/f/mime.types#_137
XDG shared-mime-info has the application/ecmascript entry as well
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/master/data/freedesktop.org.xml.in?ref_type=heads#L1948
I believe that obsolete mappings still have some value.
Please, consider
text/javascript js mjs
text/ecmascript es
or at least
text/javascript js mjs es