Conversation
hortison
commented
Mar 24, 2026
- Fix: downgrade chai to v5 and react-to-print to v2 for compatibility
- drop node 18 support
- chai@6 breaks on Node.js 22 due to EventTarget.dispatchEvent incompatibility (PluginEvent is not an instance of the built-in Event class) - react-to-print@3 removed the ReactToPrint component and PrintContextConsumer in favor of the useReactToPrint hook; downgrade to v2 keeps existing usage intact All 233 tests pass. Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s tooling and dependency stack (Babel/ESLint/Prettier/Webpack, plus select package version adjustments) and applies the resulting formatting changes across components/tests.
Changes:
- Replaces
eslint-loaderwitheslint-webpack-pluginand updates Babel plugins fromproposal-*totransform-*. - Updates Prettier config (
jsxBracketSameLine→bracketSameLine) and applies corresponding JSX formatting changes. - Adjusts package versions (including downgrading
chaiandreact-to-print), sets Node engine to>=20, and refreshes the lockfile.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.js | Switches from eslint-loader to eslint-webpack-plugin; updates Babel plugin names. |
| test/MUIDataTableHeadCell.test.js | JSX formatting updates from Prettier changes. |
| src/components/TableToolbar.js | JSX formatting updates from Prettier changes. |
| src/components/TableResize.js | JSX formatting updates from Prettier changes. |
| src/components/TableHeadRow.js | JSX formatting updates from Prettier changes. |
| src/components/TableHeadCell.js | JSX formatting updates from Prettier changes. |
| src/components/TableHead.js | JSX formatting updates from Prettier changes. |
| src/components/TableFilter.js | JSX formatting updates from Prettier changes. |
| src/components/TableBodyRow.js | JSX formatting updates from Prettier changes. |
| src/components/TableBodyCell.js | JSX formatting updates from Prettier changes. |
| src/components/TableBody.js | JSX formatting updates from Prettier changes. |
| src/components/Popover.js | JSX formatting updates from Prettier changes. |
| src/components/JumpToPage.js | JSX formatting updates from Prettier changes. |
| src/components/ExpandButton.js | JSX formatting updates from Prettier changes. |
| src/MUIDataTable.js | JSX formatting updates from Prettier changes. |
| prettier.config.js | Updates Prettier option name for v3 (bracketSameLine). |
| package.json | Dependency adjustments (incl. react-to-print, chai), Node engines >=20, coverage script change, overrides. |
| package-lock.json | Lockfile refresh reflecting dependency changes and overrides. |
| docs/utils/layout.js | JSX formatting updates from Prettier changes. |
| docs/utils/Menu.js | JSX formatting updates from Prettier changes. |
| .github/workflows/publish-package.yml | Uses git pull --rebase --autostash in the publish workflow. |
| .eslintrc | Switches parser to @babel/eslint-parser and sets requireConfigFile: false. |
| .babelrc | Updates Babel plugin names from proposal-* to transform-*. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "prop-types": "^15.8.1", | ||
| "react-dnd": "^16.0.1", | ||
| "react-dnd-html5-backend": "^16.0.1", | ||
| "react-to-print": "^3.3.0", | ||
| "react-to-print": "^2.15.1", | ||
| "tss-react": "^4.9.20" | ||
| }, |
There was a problem hiding this comment.
react-to-print@^2.15.1 declares peerDependencies only up to React/ReactDOM 18, but this package’s peerDependencies allow React/ReactDOM 19. This creates an install-time peer mismatch for React 19 consumers. Consider either keeping react-to-print on a React 19-compatible major, or tightening this package’s React peer range (or moving react-to-print to a peer/optionalPeer with a compatible range).
| "docs:deploy": "npm run docs:build && npm run docs:export && firebase deploy", | ||
| "docs:start": "next start docs", | ||
| "coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha --require ./test/babel-register.js --extensions js,jsx test/*.js && nyc report --reporter=html | cat coverage/lcov.info | coveralls", | ||
| "coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha --require ./test/babel-register.js --extensions js,jsx test/*.js && nyc report --reporter=html", |
There was a problem hiding this comment.
The coverage script no longer uploads lcov output to Coveralls, but the repo still contains Coveralls configuration (e.g., .coveralls.yml) and a Coveralls badge in the README. If Coveralls reporting is still intended, the upload step should remain; otherwise, please also remove/update the leftover Coveralls config/docs to avoid a broken badge and confusing tooling.
| "coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha --require ./test/babel-register.js --extensions js,jsx test/*.js && nyc report --reporter=html", | |
| "coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha --require ./test/babel-register.js --extensions js,jsx test/*.js && nyc report --reporter=html && cat ./coverage/lcov.info | coveralls", |