- 
                Notifications
    You must be signed in to change notification settings 
- Fork 49.7k
          feat(eslint-plugin-react-hooks): merge rule from eslint-plugin-react-compiler into react-hooks plugin
          #32416
        
          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
          
     Merged
      
      
            poteto
  merged 37 commits into
  facebook:main
from
michaelfaith:feat/merge-compiler-eslint-plugin
  
      
      
   
  Mar 13, 2025 
      
    
                
     Merged
            
            
  
    feat(eslint-plugin-react-hooks): merge rule from eslint-plugin-react-compiler into react-hooks plugin
  
  #32416
              
                    poteto
  merged 37 commits into
  facebook:main
from
michaelfaith:feat/merge-compiler-eslint-plugin
  
      
      
   
  Mar 13, 2025 
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    185347d    to
    bf841c6      
    Compare
  
    bf841c6    to
    0b1f3a0      
    Compare
  
    0b1f3a0    to
    1e2d02b      
    Compare
  
    1e2d02b    to
    dfd79bd      
    Compare
  
    
    
  michaelfaith 
      added a commit
        to michaelfaith/react
      that referenced
      this pull request
    
      Feb 22, 2025 
    
    
      
  
    
      
    
  
In preparation for the merging of the compiler plugin into this one (facebook#32416), this change proactively updates the plugin's `engines` declaration to require Node versions greater than or equal to 18 BREAKING CHANGE
    
  michaelfaith 
      added a commit
        to michaelfaith/react
      that referenced
      this pull request
    
      Feb 22, 2025 
    
    
      
  
    
      
    
  
In preparation for the merging of the compiler plugin into this one (facebook#32416), this change proactively updates the plugin's `engines` declaration to require Node versions greater than or equal to 18 BREAKING CHANGE
5261b0f    to
    f920d88      
    Compare
  
    f920d88    to
    6cd87fc      
    Compare
  
    79b148c    to
    639cd8f      
    Compare
  
    639cd8f    to
    011250b      
    Compare
  
    011250b    to
    ab2a7e1      
    Compare
  
    
      
        
              This comment was marked as off-topic.
        
        
      
    
  This comment was marked as off-topic.
…ild compiler as part of its build This change updates the "prebuild" step of the eslint-plugin-react-hooks package to create a shim index.js under the compiler's `dist` dir, rather than building the compiler with tsup. In order for this to work, I had to tweak the eslint-plugin's tsconfig: - I changed the paths entry back to pointing at the src dir, since the .d.ts file was not longer being generated in dist. - I also had to add the "dom" lib, since the compiler uses `PerformanceMeasure`. - I had to expand the `rootDir` to be the root of the repo, so that all source being compiled was under the rootDir (which now also includes the compiler code) - I had to change `target` back to es2015 (due to this error when trying to build the compiler through rollup: `@rollup/plugin-typescript TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.`)
Now that we're relying on rollup to handle building the compiler, we no longer need this.
With earlier changes building the compiler in rollup instead this command is now unnecessary
1eb54b0    to
    84b54b9      
    Compare
  
    | This looks ready to land. Thanks @michaelfaith for all the hard work! | 
    
  github-actions bot
      pushed a commit
      that referenced
      this pull request
    
      Mar 13, 2025 
    
    
      
  
    
      
    
  
…compiler into `react-hooks` plugin (#32416) This change merges the `react-compiler` rule from `eslint-plugin-react-compiler` into the `eslint-plugin-react-hooks` plugin. In order to do the move in a way that keeps commit history with the moved files, but also no remove them from their origin until a future cleanup change can be done, I did the `git mv` first, and then recreated the files that were moved in their original places, as a separate commit. Unfortunately GH shows the moved files as new instead of the ones that are truly new. But in the IDE and `git blame`, commit history is intact with the moved files. Since this change adds new dependencies, and one of those dependencies has a higher `engines` declaration for `node` than what the plugin currently has, this is technically a breaking change and will have to go out as part of a major release. ### Related Changes - #32458 --------- Co-authored-by: Lauren Tan <poteto@users.noreply.github.com> DiffTrain build for [5ccfcd1](5ccfcd1)
    
  github-actions bot
      pushed a commit
      that referenced
      this pull request
    
      Mar 13, 2025 
    
    
      
  
    
      
    
  
…compiler into `react-hooks` plugin (#32416) This change merges the `react-compiler` rule from `eslint-plugin-react-compiler` into the `eslint-plugin-react-hooks` plugin. In order to do the move in a way that keeps commit history with the moved files, but also no remove them from their origin until a future cleanup change can be done, I did the `git mv` first, and then recreated the files that were moved in their original places, as a separate commit. Unfortunately GH shows the moved files as new instead of the ones that are truly new. But in the IDE and `git blame`, commit history is intact with the moved files. Since this change adds new dependencies, and one of those dependencies has a higher `engines` declaration for `node` than what the plugin currently has, this is technically a breaking change and will have to go out as part of a major release. ### Related Changes - #32458 --------- Co-authored-by: Lauren Tan <poteto@users.noreply.github.com> DiffTrain build for [5ccfcd1](5ccfcd1)
  This was referenced Mar 13, 2025 
      
  This was referenced Aug 6, 2025 
      
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  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.
  
    
  
    
This change merges the
react-compilerrule fromeslint-plugin-react-compilerinto theeslint-plugin-react-hooksplugin. In order to do the move in a way that keeps commit history with the moved files, but also no remove them from their origin until a future cleanup change can be done, I did thegit mvfirst, and then recreated the files that were moved in their original places, as a separate commit. Unfortunately GH shows the moved files as new instead of the ones that are truly new. But in the IDE andgit blame, commit history is intact with the moved files.Since this change adds new dependencies, and one of those dependencies has a higher
enginesdeclaration fornodethan what the plugin currently has, this is technically a breaking change and will have to go out as part of a major release.Related Changes
enginesdeclaration #32458