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

[Tests] no-access-state-in-setstate: passing test for “don't error if it's not a React Component" #1873

Merged
merged 1 commit into from Sep 20, 2021

Conversation

kentcdodds
Copy link
Contributor

unstated uses this.setState and we're getting false positives when using this rule.

I figured this would be better than an issue. Is this something we could add?

@ljharb
Copy link
Member

ljharb commented Jul 3, 2018

@kentcdodds
Copy link
Contributor Author

Neat! Perhaps I will. But if anyone else would like to make that happen before I can get around to it that'd be super 👍

@ljharb
Copy link
Member

ljharb commented Jul 3, 2018

I've pushed up an initial WIP commit; it won't fix the problem quite yet. One will need to check like is done here to ensure that the setState call is inside a React component.

If anyone else wants to help, please do not submit a new PR - post a link to your commits here, and I'll happily pull them into this one.

@ljharb ljharb marked this pull request as draft May 9, 2020 22:38
@ljharb
Copy link
Member

ljharb commented Sep 20, 2021

This seems to have been fixed in #2711. I'll rebase this and land the test case to close it.

@ljharb ljharb changed the title don't error if it's not a React Component [Tests] no-access-state-in-setstate: passing test for “don't error if it's not a React Component" Sep 20, 2021
@ljharb ljharb marked this pull request as ready for review September 20, 2021 20:12
@ljharb ljharb merged commit df939e3 into jsx-eslint:master Sep 20, 2021
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.

None yet

2 participants