Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set and keep language syntax type on .babelrc file

In Atom 1.18 every time I open the editor my .babelrc file defaults to the JSON file type, which makes syntax highlighting look way off. And I have to keep changing it back to the Babel type.

enter image description here

How to fix (temporarily):

enter image description here

enter image description here

Have to reset it every time I close and open the .babelrc file.

Now I realize this is a file that will be rarely touched, but would be helpful to know how to fix this for other file type.

like image 652
Leon Gaban Avatar asked Jun 05 '26 10:06

Leon Gaban


1 Answers

There is a very specific way to set this up in the config.cson

https://discuss.atom.io/t/how-do-i-make-atom-recognize-a-file-with-extension-x-as-language-y/26539

http://flight-manual.atom.io/using-atom/sections/basic-customization/#configuring-with-cson

"*":
  core:
    customFileTypes:
      "source.js.jsx": [
        "js"
        "es6"
        "es"
        "babel"
        "babelrc"
        "jsx"
      ]
like image 119
Leon Gaban Avatar answered Jun 06 '26 23:06

Leon Gaban



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!