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

Add no-unused-state #1103

Merged
merged 6 commits into from Jul 21, 2017
Merged

Commits on Jul 21, 2017

  1. Add no-unused-state

    This adds a new rule, react/no-unused-state, which discovers state fields in a React component and warns if any of them are never read. It was developed internally at Facebook by @rjbailey and has been in use throughout Facebook's JS for a couple months now. It was written against a modern version of node, so has been rebased on @jlharb's branch dropping support for node < 4.
    
    It currently supports es2015 classes extending `React.Component`  (no support currently for `React.createClass()`) and can detect when state is as `this.state = {}`, assigning state in a property initializer, and when calling `this.setState()`.
    wbinnssmith authored and Will Binns-Smith committed Jul 21, 2017
    Copy the full SHA
    e820538 View commit details
    Browse the repository at this point in the history
  2. Port to node 0.10

    wbinnssmith authored and Will Binns-Smith committed Jul 21, 2017
    Copy the full SHA
    b3e911f View commit details
    Browse the repository at this point in the history
  3. Implement React.createClass support and use Component util

    wbinnssmith authored and Will Binns-Smith committed Jul 21, 2017
    Copy the full SHA
    1022c24 View commit details
    Browse the repository at this point in the history
  4. Re-modernize and cleanup with node 4-compatible features

    Will Binns-Smith committed Jul 21, 2017
    Copy the full SHA
    d0973b4 View commit details
    Browse the repository at this point in the history
  5. Only use babel-eslint when necessary for tests

    Will Binns-Smith committed Jul 21, 2017
    Copy the full SHA
    0dd50b2 View commit details
    Browse the repository at this point in the history
  6. use arrow fns

    Will Binns-Smith committed Jul 21, 2017
    Copy the full SHA
    ba1dfc1 View commit details
    Browse the repository at this point in the history