Skip to content

Conversation

@FMP1783
Copy link
Contributor

@FMP1783 FMP1783 commented Dec 12, 2025

Summary

  • Implement react/no-deprecated rule that warns about deprecated React APIs
  • Detects deprecated methods on React, ReactDOM, ReactDOMServer objects
  • Detects deprecated lifecycle methods in class components
  • Detects deprecated imports from react, react-dom, react-addons-perf
  • Covers 48/55 (87%) of ESLint test cases

Test cases not covered

  • Version-based tests (requires settings support for react.version)
  • Pragma-based tests (requires settings support for react.pragma)

Part of #1022

Test plan

  • All existing tests pass
  • Snapshot tests added and verified
  • just ready passes

Detects usage of deprecated React APIs and suggests alternatives.

Detected patterns:
- React.* deprecated methods (renderComponent, render, createClass, etc.)
- ReactDOM.* deprecated methods (render, hydrate, unmountComponentAtNode)
- ReactDOMServer.* deprecated methods (renderToNodeStream)
- React.PropTypes, React.DOM
- React.addons.* (TestUtils, classSet)
- Deprecated lifecycle methods in React components
- Deprecated imports from 'react' and 'react-addons-perf'
- this.transferPropsTo()

Part of oxc-project#1022
@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Dec 12, 2025
Signed-off-by: FMP1783 <79391918+FMP1783@users.noreply.github.com>
@FMP1783 FMP1783 marked this pull request as ready for review December 12, 2025 18:14
@FMP1783 FMP1783 requested a review from camc314 as a code owner December 12, 2025 18:14
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 12, 2025

CodSpeed Performance Report

Merging #16782 will not alter performance

Comparing FMP1783:feat/react-no-deprecated (f975c20) with main (fbcb49a)1

Summary

✅ 4 untouched
⏩ 41 skipped2

Footnotes

  1. No successful run was found on main (2124d03) during the generation of this report, so fbcb49a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 41 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions github-actions bot added the A-cli Area - CLI label Dec 12, 2025
@camc314 camc314 self-assigned this Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants