cfjedimaster / brackets-jshint

Adds JSHint support to Brackets
MIT License
130 stars 41 forks source link

Support for JSX? #61

Closed EvHaus closed 9 years ago

EvHaus commented 10 years ago

Hey cfjedimaster,

I recently created a clone of brackets-jshint to add support for React.js JSX files (https://github.com/globexdesigns/brackets-jsxhint). The code is almost identical to brackets-jshint, but with with 10 new lines and React.js' JSXTransformer.js file. Which leads me to wonder... would it be better if I created a pull request here to merge that feature in? Or should your extension only focus on Javascript files?

I'm a little torn, because having a bunch of very similar linting extensions in Brackets feels frustrating to users and difficult to maintain for developers, but on the other hard, having JSX support in a JSHint extension might be beyond its original intent.

What do you think?

cfjedimaster commented 10 years ago

Pretend I know nothing about React.js JSX. Can you give me the elevator pitch?

EvHaus commented 10 years ago

React.js JSX is essentially a Javascript file, which also allows for embedded HTML support. For example, a very simple .jsx file might look like this:

var Component = <div/>;

React.js provides a small transformer library called JSXTransformer that will take .jsx files and convert them to valid Javascript. So the output will end up as:

var Component = React.DOM.div();

What my extension does, is takes a .jsx file then turns it through JSXTransformer to convert it to valid Javascript and then feeds it back into JSHint.

cfjedimaster commented 10 years ago

Hmm. That is cool. And I agree with you about limiting the # of linters out there. But this feels a bit too much out of the main scope. How about this - we let the next person who comments be the decider? ;)

EvHaus commented 10 years ago

Haha, deal. All project management should be done this way :)

ringzhz commented 9 years ago

I vote yes! Support for JSX!!!!!

EvHaus commented 9 years ago

I'm closing this as I've moved to using ESlint which has support for custom parsers. The combination of ESLint + Babel-Eslint provides full support JSX.