Comments (10)
ESLint v9 isn't supported yet. Either roll back to 8.57 or you can try working around it with @eslint/compat, but that's not guaranteed to work.
from eslint-plugin-react.
Thanks; in that case let's land it in its own PR?
Makes sense, I can prepare a separate PR for this issue.
I mentioned #3759 because it adds tests with flat configs (ef6f9c5 for the start) which seem particularly useful for this problem, but those tests can be extracted into the other PR and run with eslint >= 8.57.0 instead of just >= 9.
from eslint-plugin-react.
I have this error when runing eslint: Key "plugins": Cannot redefine plugin "react"
This happens because eslint-plugin-react's flat configs have their own plugins.react
object that, although functionally the same, is not the same instance as react
in import react from 'eslint-plugin-react'
.
A quick fix in your eslint.config.js would be to remove one of these two plugin definitions:
- plugins: {
- react,
- },
Nevertheless, I think that eslint-plugin-react should be fixed so that it always uses the same plugin object.
from eslint-plugin-react.
@mdjermanovic what would be the impact of that change?
from eslint-plugin-react.
Either way, closing, because you simply can't use eslint 9 with a plugin that doesn't declare peerDep compatibility with it.
Wait to upgrade eslint until all your things support it explicitly.
from eslint-plugin-react.
@mdjermanovic what would be the impact of that change?
This can be fixed in a way that wouldn't be a breaking change for eslint-plugin-react. We could include the fix in #3759.
Note that this isn't eslint 9 specific. the same problem exists with eslint-plugin-react + eslint 8 flat config.
from eslint-plugin-react.
Thanks; in that case let's land it in its own PR?
from eslint-plugin-react.
Also perhaps #3694 is a good fit for it.
from eslint-plugin-react.
Also perhaps #3694 is a good fit for it.
Hm, yes, I didn't see that. The issue it references (#3693) is the same as this one. But there's a question of what to do with existing exports (eslint-plugin-react/configs/recommended
and others)?
from eslint-plugin-react.
The existing imports would need to keep working the same for eslintrc users. I'm not sure what that would entail.
from eslint-plugin-react.
Related Issues (20)
- [Bug]: 'React' must be in scope when using JSXeslintreact/react-in-jsx-scope HOT 1
- [Bug]: `non-jsx` is listed in `react/jsx-one-expression-per-line` options but is not available HOT 1
- [Bug]: Not compatible with eslint HOT 4
- Missing type declarations HOT 3
- Failed prop type: its value is `undefined`. HOT 2
- [Bug]: react/jsx-filename-extension ignoreFilesWithoutCode option not working with eslint v8 HOT 2
- Add option to `react/destructuring-assignment` to skip destructuring on union types on `always` HOT 4
- [Bug]: `sort-prop-types`'s autofix doesn't move the semicolon, producing broken code, on single-line Props types HOT 9
- [Bug]: `prefer-read-only-props` rule doesn't work with namespaces
- Latest version forces users to use Eslint 9.7 HOT 5
- [Bug]: `reactPlugin.configs.flat.recommended` part in documentation throws error HOT 14
- Rule proposal: No return ternary HOT 1
- [Bug]: Not working with @typescript-eslint/parser v8 HOT 4
- [Bug]: autofix for jsx-closing-bracket-location deletes comments HOT 1
- [Bug]: autofix for `sort-prop-types` breaks code containing comments
- [Bug]: `jsx-curly-brace-presence` doesn't trigger on strings containing a quote character
- [Bug]: react/prop-types false positives since upgrading typescript-eslint to v8 HOT 2
- [Feature Request]: Add TypeScript types HOT 3
- [Bug]: Cannot ban only explicitSpread for jsx-props-no-spreading
- [Bug]: Support ESLint v9.9.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-react.