Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Linting JSX const without brackets / parenthesis causes eslint to hang #227

Closed
@mattdell

Description

@mattdell

What version of TypeScript are you using?
2.2.1

What version of typescript-eslint-parser are you using?
2.1.0

What code were you trying to parse?

const menuItems = <div className={theme['header__menu-items']}>
        <Icon handleClick={handleIconClick} type={IconTypes.Chat} />
        <Icon handleClick={handleIconClick} type={IconTypes.Menu} />
    </div>;

What did you expect to happen?
eslint to run successfully

What happened?
eslint hangs and becomes unresponsive. I've left it to run over lunch and it was still stuck.

Changing the syntax to be contained within brackets / parenthesis fixes the issue.

const menuItems = (
    <div className={theme['header__menu-items']}>
        <Icon handleClick={handleIconClick} type={IconTypes.Chat} />
        <Icon handleClick={handleIconClick} type={IconTypes.Menu} />
    </div>
);

I've now been able to reproduce this several times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions