Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Conversation

calebmer
Copy link

No JSX package on atom compares this one to parsing JavaScript. I'd like to just not use any of these packages in my .jsx files and just have language-javascript render them.

@lee-dohm
Copy link
Contributor

You can add this yourself by adding a customFileTypes declaration to your config.cson:

'*':
  'core':
    'customFileTypes':
      'source.js': [
        'jsx'
      ]

This way you get what you want and it won't break other people using JSX packages 😀

@calebmer
Copy link
Author

That sounds sensible, but including JSX seems like a reasonable default
include to me.
On Mon, Jan 25, 2016 at 5:59 PM Lee Dohm notifications@github.com wrote:

You can add this yourself by adding a customFileTypes declaration to your
config.cson:

'*':
'core':
'customFileTypes':
'source.js': [
'jsx'
]

This way you get what you want and it won't break other people using JSX
packages [image: 😀]


Reply to this email directly or view it on GitHub
#313 (comment)
.

@lee-dohm
Copy link
Contributor

I didn't close this for now, going to bounce the idea off the team.

@winstliu
Copy link
Contributor

linguist, the parser GitHub uses to highlight files on its website, used to include .jsx as JavaScript, which led to pretty bad experiences (see #220 or github-linguist/linguist#2624 as an example). Since language-javascript doesn't explicitly support JSX, that leads to subpar tokenization at best.

I think going with the customFileTypes option is your best bet here other than waiting for the JSX packages to improve. Out of curiousity, have you tried language-babel? That's what linguist uses now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants