-
-
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
[Bug]: Error when using flat config #3688
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Quick update: I was able to use the plugin with flat config by following these instructions from the readme. Would you like me to close this ticket, or is there more work to be done to fully support flat configs? |
lol oops, i forgot we do support flat config :-) glad you found the section in the readme! |
If anyone finds this issue, I was using ESM and according to the docs, we need to import this plugin with the My code is as follows: import eslint from '@eslint/js'
import react from 'eslint-plugin-react/configs/recommended.js' <---- Note the extension here
import tseslint from 'typescript-eslint'
export default tseslint.config( <--- This is the same as export default [...]
react,
eslint.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
},
},
) |
When using ESM, I get a TS error: Could not find a declaration file for module |
Is there an existing issue for this?
Description Overview
I receive an "Oops! Something went wrong!" error when using
eslint-plugin-react
with a flat config.eslint.config.js
Error message
When I remove eslint-plugin-react, the error goes away.
eslint.config.js without eslint-plugin-react
Expected Behavior
When a flat config is used with eslint-plugin-react, running the linter from the CLI returns either a success code or a list of linter errors.
eslint-plugin-react version
7.33.2
eslint version
8.56.0
node version
20.7.0
The text was updated successfully, but these errors were encountered: