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

react/no-invalid-html-attribute Shouldn't be auto-fixable #3458

Closed
Janpot opened this issue Oct 11, 2022 · 3 comments · Fixed by #3474
Closed

react/no-invalid-html-attribute Shouldn't be auto-fixable #3458

Janpot opened this issue Oct 11, 2022 · 3 comments · Fixed by #3474

Comments

@Janpot
Copy link

Janpot commented Oct 11, 2022

The automatic fix that is performed by the react/no-invalid-html-attribute rule removes invalid values. I'd argue this is dangerous behavior as removing the value is probably not the intended outcome, I mean, I've put it there for a reason in the first place. Some examples:

  • I have a typo in one of the values, auto-fix removes it instead of forcing me to correct it
  • I have a non-standard value e.g. rel="sponsored", I'd like to replace it with nofollow instead of automatically removing it. Or I'd like to add an ignore directive to allow for it.
@ljharb
Copy link
Member

ljharb commented Oct 11, 2022

Yes, I agree it should be a suggestion and not an autofix. A PR to fix that is welcome.

@himanshu007-creator
Copy link
Contributor

Hi, i would like to give it a try

@ljharb
Copy link
Member

ljharb commented Oct 19, 2022

Go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants