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

Exempt variables prefixed with underscore from no-unused-vars rule #640

Merged
merged 2 commits into from
Sep 16, 2016

Commits on Sep 13, 2016

  1. Configuration menu
    Copy the full SHA
    1e1bed9 View commit details
    Browse the repository at this point in the history
  2. Exempt variables prefixed with underscore from no-unused-vars rule

    This is useful when e.g. using object spread operator to remove only a
    certain field from the object.
    
    For example, this can be used to ignore a property from React
    component's `this.props`:
    
        render() {
            const { someAttribute: _unused, ...rest } = this.props;
            return <pre>{ JSON.stringify(rest) }</pre>;
        }
    valscion committed Sep 13, 2016
    Configuration menu
    Copy the full SHA
    29a6eb8 View commit details
    Browse the repository at this point in the history