SCHU-16881: Add eslint-plugin-react-compiler to @open-turo/eslint-plugin-react #295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (in Github)
Adding the
eslint-plugin-react-compiler
with one false positive exception to our config and cutting it as a major so we can start fixing React Compiler violations and/or disabling them for greater visibility to React Compiler compatibility in the future. Does not touch existingreact-hooks
configuration since the "emphasis" of twoeslint-disables
forreact-hooks/exhaustive-deps
violations indicates it is not something to be taken lightly.Description (from Jira)
We can add eslint-plugin-react-compiler to @open-turo/eslint-plugin-react so that we can start following compiler rules more thoroughly prior to React 19: https://react.dev/blog/2024/10/21/react-compiler-beta-release#we-recommend-everyone-use-the-react-compiler-linter-today + https://www.npmjs.com/package/eslint-plugin-react-compiler
Some discussion configuration that may be useful: reactwg/react-compiler#24 (reply in thread)
There may be some duplication with eslint-plugin-react-hooks that we’d want to manage: reactwg/react-compiler#18 (comment). Because the compiler plugin is more performance intensive (reactwg/react-compiler#17 ), we may decide to turn off exhaustive-deps in favor of the compiler plugin if the overlap is 100% (to save some budget on performance).
The react compiler is currently in Beta, so this ticket only concerns adding the plugin: https://react.dev/learn/react-compiler, though some understanding of the compiler functionality may be helpful for determining the optimal plugin configuration: reactwg/react-compiler#8 . For this reason, the ticket is pointed as 3, and can be raised accordingly as needed by the assignee.
Fixes #SCHU-16881
Changes
🚀 PR created with fotingo