Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Class is defined but never used #81

Closed
bartek opened this issue Mar 25, 2015 · 9 comments

Comments

@bartek
Copy link

commented Mar 25, 2015

Hi there,

Love this project, but I'm curious if there's a way to handle this common React scenario?

var App = React.createClass({
   render: function () {
         return (
                 <div></div>
          )
    }
})

React.render(<App />, document.getElementById('application'))

App is obviously defined and being used, but I can see how the linter would be confused due to the JSX syntax. Any ideas?

Thanks!

@dcposch

This comment has been minimized.

Copy link

commented Mar 25, 2015

I ran into the same issue. I found a workaround: putting the React class in its own file and require()ing it

@dcposch dcposch closed this Mar 25, 2015

@dcposch dcposch reopened this Mar 25, 2015

@dcposch

This comment has been minimized.

Copy link

commented Mar 25, 2015

I'll see if this still happens with just eslint, because jscs is going away soon! See #45

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented Mar 26, 2015

@dcposch 3.3.0 is out which has jscs removed.

@justin808

This comment has been minimized.

Copy link

commented Mar 27, 2015

Is ReactJS, ES6, and JSX supported now?

@feross

This comment has been minimized.

Copy link
Member

commented Mar 27, 2015

@justin808 Yes, they're supported now.

@justin808

This comment has been minimized.

Copy link

commented Mar 27, 2015

@feross Maybe I need the github tip? I got errors when converting these: https://github.com/justin808/react-webpack-rails-tutorial/tree/master/client/assets/javascripts

I'm considering converting my example of using Rails with React/Webpack/ES6.

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented Mar 28, 2015

@justin808 Can you create a separate issue for this with your error messages included? Thanks!

@bartek

This comment has been minimized.

Copy link
Author

commented Mar 28, 2015

Thanks @dcposch and co.!

@bartek bartek closed this Mar 28, 2015

@feross

This comment has been minimized.

Copy link
Member

commented Apr 2, 2015

I think @dcposch's workaround might not be needed in the latest version of standard (3.3.1, just released) because of a bugfix in eslint 0.18.0: eslint/eslint#2093

Hope that makes things smoother for you guys :)

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
5 participants
You can’t perform that action at this time.