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

[Bug]: false positive on commonjs imports for no-deprecated #3606

Closed
2 tasks done
jlowcs opened this issue Jul 21, 2023 · 1 comment · Fixed by #3614
Closed
2 tasks done

[Bug]: false positive on commonjs imports for no-deprecated #3606

jlowcs opened this issue Jul 21, 2023 · 1 comment · Fixed by #3614

Comments

@jlowcs
Copy link

jlowcs commented Jul 21, 2023

Is there an existing issue for this?

  • I have searched the existing issues and my issue is unique
  • My issue appears in the command-line and not only in the text editor

Description Overview

I'm getting a no-deprecated eslint error for the following:

const { renderToString } = require('react-dom/server');

None for ESM imports though:

import { renderToString } from 'react-dom/server';

Expected Behavior

This should not trigger a no-deprecated linting error:

const { renderToString } = require('react-dom/server');

eslint-plugin-react version

v7.33.0

eslint version

v8.45.0

node version

v18.12.1

@jlowcs jlowcs added the bug label Jul 21, 2023
@ljharb
Copy link
Member

ljharb commented Jul 21, 2023

Indeed, React.renderToString is what's deprecated, not ReactDOMServer.renderToString.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants