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 jsx-uses-react rule #6

Merged
merged 1 commit into from
Mar 1, 2015
Merged

Conversation

glenjamin
Copy link
Contributor

See eslint/eslint#1905 for additional context.

This rule somewhat unusual, in that it modifies the behaviour of a core eslint rule.

I'm not hugely keen on this, but it does work. It is possible for the rule to be broken by changes in eslint core.

The alternative would be to copy-paste the original rule and modify it.
That would require users to disable the core rule and replace it with this one - and then any improvements to the core rule would have to be tracked here and updated.

Of those two choices, I think the first one is the most practical, even if it breaks the usual clean separation of rules.

This rule somewhat unusual, in that it modifies the behaviour
of a core eslint rule. The alternative would be to copy-paste
the original rule and modify it. That would require users to
disable the core rule and replace with this one
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 46b9c97 on glenjamin:jsx-uses-react into 9c43de0 on yannickcr:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling ca87883 on glenjamin:jsx-uses-react into 9c43de0 on yannickcr:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling ca87883 on glenjamin:jsx-uses-react into 9c43de0 on yannickcr:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling ca87883 on glenjamin:jsx-uses-react into 9c43de0 on yannickcr:master.

@yannickcr
Copy link
Member

Thanks!

This is a tricky case to check but I am agree with your approach to use the eslintJSXUsed flag used by the no-unused-vars rule.

Like you said it breaks the separation of rules but I can't really see any other way to check this.

yannickcr added a commit that referenced this pull request Mar 1, 2015
@yannickcr yannickcr merged commit b9f894e into jsx-eslint:master Mar 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants