Skip to content

false positive in a simple function react/destructuring-assignment #3024

@danosaure

Description

@danosaure

I have the following code:

import fn from '../some-file';
export default (fileName) => {
  const match = fileName.match(/some expression/);
  if (match) {
    return fn;
  }
  return null;
};

it thinks that const match = fileName.match() is causing a destructuring issue.

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