Babel JS package not "Sticking" to JS files


#1

I’m working on a theme with support for a lot of the newer scopes in JS files that the default JS package do not have, such as

.variable.other.object.js {
   color: @teal;
 }
 .meta.property.object.js {
    color: @gold;
 }

The docs for the package say that .js files will use the newer language module, but I’ve found that it I don’t manually switch from js to Babel js at the bottom right of the UI the new colors do not show.

Is there an “always open x with” like in Sublime?

Or, any chance to add the newer scopes to the default js file? Just for hooks to syntax coloring?


#2

Lots of people have been adding support for ES6 stuff to the standard language-javascript package. I feel like it would be better to improve the experience for everyone.

With regard to opening a file type with a specific language setting, no, there isn’t support for that right now. But there is an issue open on it and there is the file-types package.


#3

So, would it be better to stick with the vanilla JS language and wait for it to “fill in”.


#4

That’s a decision that you’ll have to make for yourself. Personally, if I used JS and felt the language package was lacking, I’d submit fixes for it myself.