I'm wondering if there's a standardized file extension for ES6 yet. So far I've seen .es6
and .es6.js
as two options, but I'm curious if one is generally better supported by third party packages and tools. And if Mozilla is leaning a particular direction.
There's no formal ES6/JS extension, although majority of people seem to prefer .js
. ECMAScript specific suffixes aren't common.
Mozilla is using two extensions within Firefox and FirefoxOS: .js
and .jsm
. No ECMA Script specific suffixes.
For Gecko (the layout engine written largely in JS), they use both .js
and .jsm
. Example: one of the DOM modules source code.
In some other subprojects, such as Gaia, they use .js
only. Example: "system" app for Firefox OS.
Note: .jsm
is something specific to Gecko - it's a Javascript module.
Note: ECMAScript 6 is a standard that is later implemented in Firefox as Javascript. So those two terms are closely related, and are almost synonyms (source).
Heads up: source code on the Gecko side has the syntax that is plain JS with some extensions - some of which ended up in ECMA Script 6, some not. In general, though, Mozillians tend to follow ECMA Script spec closely. Possible differences are listed here.
.es6
and .es6.js
as two options, but I'm curious if one is generally better supported by third party packages and tools. And if Mozilla is leaning a particular direction. Nowhere has the OP mentioned file extensions for JavaScript extensions/addons or anything more general. –
Madriene you can add ecmascript from extensions from compiler visual studio ex instate of word all component word by word you can write only rafc
© 2022 - 2024 — McMap. All rights reserved.
.js
is all i've seen so far.. which makes sense. We didn't start using.4.cs
when c# came out withawait
/async
in .NET 4 – Cobby.es3.js
,.es4.js
,.es5.js
– Doxology.js
ES is the foundation of JS so it is JS. Options you have seen are most likely for IDEs to let them know that you are writing ES6 so it can provide auto completion and such. – Busk.es6
as their ES6 JS files extension. You can check their GitHub: github.com/Foundry376/Mailspring/blob/master/app/src/… – Arsinesrc/es6/filename.js
andsrc/less/filename.less
. – Charger