standard: Problems with JSX support

I’ve recently started playing with segmentio/deku, an alternative to React, and I’m also using Babel to transpile my js and jsx code.

The first issue that I ran into was that eslint expects to see React imported whenever it sees JSX. In my .babelrc I have already configured Deku’s element function as the jsx pragma to use versus react, however standard has no way to know that and in order to get my files to properly lint I have to annoyingly include /** @jsx element */ at the top of my files.

The second issue is that React’s JSX uses className to denote the class property on an element, whereas Deku uses class. Therefor JSX written for Deku will always error when linted by standard.

It makes me wonder what would happen if yet another popular framework were to be released that used a JSX-like syntax that wasn’t exactly like React’s JSX.

If there are any possible workarounds I would be happy to try them.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 27 (15 by maintainers)

Most upvoted comments

@yoshuawuyts @malandrew @jprichardson Just wanted to make sure you’re aware of https://www.npmjs.com/package/hyperx which is a much nicer solution than JSX. Doesn’t require the use of transpiler or modifications to all JS tooling ever invented.

I’m using it in https://github.com/feross/webtorrent-app and it’s working great!