Skip to content

feature request: Add option to no-multi-comp to only count exported components. #365

@jimbolla

Description

@jimbolla

I'd like to enforce only one exported component per file, regardless of function vs class.

Activity

betaorbust

betaorbust commented on Aug 3, 2016

@betaorbust

This would be extremely useful. In general, we're trying to guard against what a file exports, not the contents of how it builds that export.

lencioni

lencioni commented on Aug 3, 2016

@lencioni
Collaborator

How should such a rule relate to higher-order components?

ljharb

ljharb commented on Aug 3, 2016

@ljharb
Member

I'd think that only the HOC itself would be exported, and so this option would work well with HOCs?

ThiefMaster

ThiefMaster commented on Mar 26, 2018

@ThiefMaster
Contributor

I'd like to have this as well. I don't want to put "local" components into separate files, so restricting this to exported ones would be very convenient.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yannickcr@ljharb@ThiefMaster@lencioni@betaorbust

        Issue actions

          feature request: Add option to no-multi-comp to only count exported components. · Issue #365 · jsx-eslint/eslint-plugin-react