subtleGradient / language-javascript-jsx

JavaScript with JSX Bundle for Atom
45 stars 6 forks source link

How to exclude .js file from the plugin? #29

Open SidKwok opened 8 years ago

franciscop commented 7 years ago

I found a solution. In your config.cson (Edit > Config...), you should have something like this:

"*":
  core:
    audioBeep: false
    customFileTypes:
      "source.jade": [
        "pug"
      ]
      "source.js.jsx": [
        "js"
      ]

the jade>pug one was added by me

So just remove the js in source.js.jsx so it becomes:

"*":
  core:
    audioBeep: false
    customFileTypes:
      "source.jade": [
        "pug"
      ]
      "source.jsx": [
        "js"
      ]

Then close the syntax highlighted file and open it again and it should be showing properly. It'd be much better to be able to check a checkbox that says "JSX" and another that says "JS" in the preferences because it took me a long time to find out that this file existed and how to use it.

drastus commented 6 years ago

Small correction: you should rather remove jsx, so that the working config.cson fragment goes like this:

"*":
  core:
    customFileTypes:
      "source.js": [
        "js"
      ]
franciscop-invast commented 6 years ago

Thanks @franciscop (myself! this is my corporate github) from the past, found this issue through Google after 30 min fighting Atom 😄