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

SCHU-16881: Add eslint-plugin-react-compiler to @open-turo/eslint-plugin-react #295

Conversation

michaeljaltamirano
Copy link
Contributor

@michaeljaltamirano michaeljaltamirano commented Dec 16, 2024

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 existing react-hooks configuration since the "emphasis" of two eslint-disables for react-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

  • feat: add eslint-plugin-react-compiler (no non-beta v19 version yet)
  • feat: add react-compiler/react-compiler to ESLint config with ref false positive disable

🚀 PR created with fotingo

@michaeljaltamirano michaeljaltamirano requested a review from a team as a code owner December 16, 2024 20:35
Copy link
Contributor

@tagoro9 tagoro9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@michaeljaltamirano michaeljaltamirano force-pushed the c/schu-16881_add_eslint-plugin-react-compiler_to_open-turo-eslint-plugin-react branch from 7ab673c to d5ff25d Compare December 17, 2024 22:47
…se positive disable

BREAKING CHANGE: This ESLint plugin will raise new errors in repos, and so we need to cut it as a major
@michaeljaltamirano michaeljaltamirano force-pushed the c/schu-16881_add_eslint-plugin-react-compiler_to_open-turo-eslint-plugin-react branch from d5ff25d to df6e372 Compare December 17, 2024 23:04
Copy link

github-actions bot commented Dec 17, 2024

Release notes preview

Below is a preview of the release notes if your PR gets merged.


13.0.0 (2024-12-17)

⚠ BREAKING CHANGES

  • This ESLint plugin will raise new errors in repos, and so we need to cut it as a major

Features

  • add eslint-plugin-react-compiler (no non-beta v19 version yet) (0be374c)
  • add react-compiler/react-compiler to ESLint config with ref false positive disable (5fd62a6)

Documentation

  • add v13 breaking changes docs for eslint-plugin-react-compiler (df6e372)

Breaking changes file docs/breaking-changes/v13.md

Breaking changes in v13

We are adding eslint-plugin-react-compiler to our React configuration. While there is much more work needed to support React Compiler in production, adding the ESLint rule in advance of the actual compiler (which is recommended by the React team: https://react.dev/learn/react-compiler#installing-eslint-plugin-react-compiler) will help us resolve (or suppress) violations as they come up. This addition requires a major version upgrade since it will raise errors in every repo.


@michaeljaltamirano michaeljaltamirano merged commit d356325 into main Dec 17, 2024
3 checks passed
@michaeljaltamirano michaeljaltamirano deleted the c/schu-16881_add_eslint-plugin-react-compiler_to_open-turo-eslint-plugin-react branch December 17, 2024 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants