-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Feature Request]: Improve documention for new eslint 9 flat configuration for shared monorepo project #3816
Comments
It sounds like the issue is just that you were confused about the use of jsx-runtime, which is described in the eslintrc section of the readme, but not in [the flat config section(https://github.com/jsx-eslint/eslint-plugin-react?tab=readme-ov-file#flat-configs) of the readme. It's currently written assuming you've read the entire thing, but certainly could be improved. |
I had similar bouts of confusion from the minimal examples for flat config in the README because I wanted to use the flat
I think you could get away with just spreading the |
I'd love a PR to improve the docs here. |
Given: I had: pluginReact.configs.flat.recommended,
pluginReact.configs.flat["jsx-runtime"], No No other changes or configuration 🔧 were needed. |
Is there an existing issue for this?
Description Overview
I had some difficulties setting up a shared Eslint 9 flat configuration project in a mono repo structure. I couldn't find clear examples in the documentation, so I ended up creating a configuration file that I'm not entirely confident about.
I created a project
@acme/eslint-config
with the folllowing index file:I initially encountered multiple errors, but it was resolved after using "reactPlugin.configs.flat['jsx-runtime']". However, I'm still unsure about the correctness of my configuration.
In the project where I want to use this configuration, I created an
eslint.config.mjs
file with the following:This setup is working for me, but I couldn't find a simple tutorial anywhere, only examples using .eslintrc. I'm also uncertain if my configuration is the best for creating documentation on this topic.
I opened this issue in this library because if I removed
reactPlugin.configs.flat.recommended,
it would work and with it I would always get'React' must be in scope when using JSX
, usingreactPlugin.configs.flat['jsx-runtime']
fix it, but it wasn't clear at first.Expected Behavior
I wanted a clearer tutorial using the new flat config.
eslint-plugin-react version
v7.35.0
eslint version
v9.9.1
node version
v20.10.0
The text was updated successfully, but these errors were encountered: