Skip to content

Eslint does not work if the jsx key is missed inconditions #3117

Closed
@malikiz

Description

@malikiz

Eslint does not work if the jsx key is missed in conditions

Screenshot:
image

Code:

const Test = (): React.ReactNode => {
  const list = [1, 2, 3, 4, 5];

  return (
    <div>
      {list.map(item => {
        if (item < 2) {
          /* The eslint error didn't work: */
          return <div>{item}</div>;
        }

        return <div />;
      })}
    </div>
  );
};

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