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

consistent-function-scoping: Ignore anything containing JSX #382

Merged
merged 9 commits into from
Sep 18, 2019

Conversation

MrHen
Copy link
Contributor

@MrHen MrHen commented Sep 18, 2019

Fixes #376.
Depends on #378.

I could not find a quick way to include JSX elements in the reference detection. It looks like the scope utilities don't recognize JSX.

We can circle back around to this later but I wanted to get the bugs cleared out first.

},
JSXElement: () => {
// Turn off this rule if we see a JSX element because scope
// references does not include JSXElement nodes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying comment from @sindresorhus:

Can you open an ESLint issue about this afterwards?

Looks like there was a similar issue opened here: eslint/eslint#3622

I can try getting something like that hooked up. Ideally, if someone who uses eslint-plugin-unicorn also had eslint-plugin-react then it would "just work". I'm not sure if we can realistically test for that, though.

@sindresorhus sindresorhus merged commit 8a999c0 into sindresorhus:master Sep 18, 2019
@MrHen MrHen deleted the bug/376-JSX branch September 18, 2019 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consistent-function-scoping breaks down on React HOCs
2 participants