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

[Bug]: Rule "react/no-direct-mutation-state" failing in a stateless component #3751

Closed
2 tasks done
Lucasdsk opened this issue May 9, 2024 · 1 comment
Closed
2 tasks done
Labels

Comments

@Lucasdsk
Copy link

Lucasdsk commented May 9, 2024

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

I've created a new project using eslint 9 that brings the eslint-plugin-react config, then I've installed storybook that brings the default Button component as an example.

Default Button component:

image

Eslint config

image

Error

image

Expected Behavior

I believe it shouldn't happen on a function component since the rule is related to not direct mutate a state. I understand I can't disble that rule, otherwise it wont throw an error if there's a code where the state is being directly mutated.

eslint-plugin-react version

7.34.1

eslint version

9.2.0

node version

v20.13.0

@Lucasdsk Lucasdsk added the bug label May 9, 2024
@Lucasdsk
Copy link
Author

Lucasdsk commented May 9, 2024

Closing this issue since the work is still in progress to adapt to the eslint 9.
Work in progress: #3743

I'll use eslint 8 meanwhile.

@Lucasdsk Lucasdsk closed this as completed May 9, 2024
@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants