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

What does "extend react/jsx-runtime in your eslint config to disable the relevant rules" mean? #3052

Closed
jcollum opened this issue Aug 26, 2021 · 11 comments

Comments

@jcollum
Copy link

jcollum commented Aug 26, 2021

I can't tell if I'm missing something or those instructions are unclear. To me that means:

  1. go to your eslintrc.js file
  2. find the extends array
  3. add the string "react/jsx-runtime" to that array

But I tried that and I got

ESLint: 7.32.0

ESLint couldn't find the config "react/jsx-runtime" to extend from. Please check that the name of the config is correct.

Tried "plugin:react/jsx-runtime" and it worked, but the docs don't say anything about it being a plugin. Docs are a little confusing here.

@ljharb
Copy link
Member

ljharb commented Aug 26, 2021

that is a fair criticism; i'll tweak the instructions.

@ljharb
Copy link
Member

ljharb commented Aug 26, 2021

Hopefully that change would have cleared it up for you?

@jcollum
Copy link
Author

jcollum commented Aug 27, 2021 via email

@pgarciacamou
Copy link

I just want to leave a note for other people.

If you are encountering that adding plugin:react/jsx-runtime doesn't work. Make sure it is added after plugin:react/recommended in the extends array.

@beizhedenglong

This comment has been minimized.

@dcherino
Copy link

I just want to leave a note for other people.

If you are encountering that adding plugin:react/jsx-runtime doesn't work. Make sure it is added after plugin:react/recommended in the extends array.

Thanks for this.
I would like also to add that if you are using 'airbnb-typescript', you need to make sure to add it after this one too.

@MatiSera

This comment was marked as resolved.

@chetbox
Copy link

chetbox commented Sep 20, 2022

For anyone stuck, I also had to update eslint-plugin-react:

yarn add --dev eslint-plugin-react

@emorenoSM

This comment was marked as resolved.

@ljharb

This comment was marked as resolved.

@emorenoSM

This comment was marked as resolved.

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

No branches or pull requests

8 participants