Skip to content

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

Closed
@jlowcs

Description

@jlowcs

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions