Skip to content

Styled components false positives (Support curried HOCs) #98

@jaskp

Description

@jaskp

Hi, the template-literal form of styled components seems to have been fixed #32, but the object form still causes false positives:

export const Flex = styled('div')({display: 'flex'}) // Warning ❌

We can get halfway there with "customHOCs": ["styled"]

export const Flex = styled('div') // No warning ✅
export const Flex = styled('div')({display: 'flex'}) // Warning ❌

For the purposes of this plugin, I think it would be safe to assume that if you call the result of a "HOC", it should count as a react component.

I believe the correct term for a function like this case of styled is a curried HOC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions