Skip to content

Move eslint-plugin-react-perf from dependencies to devDependencies#6677

Merged
ckifer merged 2 commits intomainfrom
copilot/fix-eslint-plugin-react-perf
Nov 24, 2025
Merged

Move eslint-plugin-react-perf from dependencies to devDependencies#6677
ckifer merged 2 commits intomainfrom
copilot/fix-eslint-plugin-react-perf

Conversation

Copy link
Contributor

Copilot AI commented Nov 23, 2025

Description

eslint-plugin-react-perf was incorrectly placed in dependencies instead of devDependencies, causing the entire ESLint toolchain to be installed in downstream projects using Recharts.

The plugin is only used in eslint.config.mjs for enforcing performance rules during development:

const perfOptimization = {
  name: 'perf-optimization-examples',
  files: ['./www/src/docs/exampleComponents/LineChart/CompareTwoLines.tsx'],
  plugins: { 'react-perf': reactPerf },
  rules: {
    'react-perf/jsx-no-new-array-as-prop': 'error',
    'react-perf/jsx-no-new-function-as-prop': 'error',
    'react-perf/jsx-no-jsx-as-prop': 'error',
  },
};

Related Issue

Fixes #6675

Motivation and Context

Production applications should not install development-only tooling. Moving this to devDependencies prevents unnecessary bloat in downstream projects while maintaining functionality for Recharts development.

How Has This Been Tested?

  • Verified linting works: npm run lint
  • Verified build completes: npm run build
  • All unit tests pass: 3437 tests

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a storybook story or VR test, or extended an existing story or VR test to show my changes
Original prompt

This section details on the original issue you should resolve

<issue_title>[3.5.0] recharts now installs eslint-plugin-react-perf</issue_title>
<issue_description>## What is the current behavior?

recharts@3.5.0 has eslint-plugin-react-perf as a dependncy.
It was added by #6654
This causes this dependency, and entire eslint toolchain, to get installed in downstream projects

What is the expected behavior?

eslint-plugin-react-perf should be a devDependency, as it's only used by repository's own development flow.

Steps to reproduce

mkdir recharts-eslint-dep
cd recharts-eslint-dep
npm init -y
npm i recharts
npm why eslint
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
<comment_new><author>@PavelVanecek</author><body>
Thanks @AviVahl yeah this definitely should have been a devdependency.</body></comment_new>
</comments>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: PavelVanecek <1100170+PavelVanecek@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix eslint-plugin-react-perf dependency in recharts Move eslint-plugin-react-perf from dependencies to devDependencies Nov 23, 2025
Copilot AI requested a review from PavelVanecek November 23, 2025 14:28
@ckifer ckifer marked this pull request as ready for review November 23, 2025 16:19
@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.03%. Comparing base (986928b) to head (996a397).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6677   +/-   ##
=======================================
  Coverage   94.03%   94.03%           
=======================================
  Files         497      497           
  Lines       42609    42609           
  Branches     4871     4871           
=======================================
  Hits        40066    40066           
  Misses       2538     2538           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ckifer ckifer merged commit 331d329 into main Nov 24, 2025
47 of 49 checks passed
@ckifer ckifer deleted the copilot/fix-eslint-plugin-react-perf branch November 24, 2025 01:29
@codecov
Copy link

codecov bot commented Nov 24, 2025

Bundle Report

Bundle size has no change ✅

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.

[3.5.0] recharts now installs eslint-plugin-react-perf

3 participants