Skip to content

React components and unused vars #1

Closed
@trodrigues

Description

@trodrigues

A common react pattern is to store a component name in a var that then only gets used inside of JSX:

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

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

I want to disallow unused variables, but I would like these to be ignored. I wonder if this plugin could handle that or if there would be some other pattern or combination of rules that could be used to cover this use case.

I'll investigate a bit more myself, but for now I was wondering if anyone else had come across this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions