Skip to content

no-unexpected-multiline rule clashes with Prettier #7005

Closed
@denisw

Description

@denisw

I am using TypeScript, Prettier (1.17.0) and styled-components in a CRA app. When I define the prop types of my styled components inline, I end up with constructs like these:

const Component = styled.div<{
  prop1?: Type;
  prop2?: Type;
}>`
  /* Some styles here... */
`;

The above is the formatting chosen by Prettier. However, CRA's ESLint config doesn't seem to agree:

Line 1:  Unexpected newline between template tag and template literal  no-unexpected-multiline [no-unexpected-multiline]

This means that when I use the pattern above, it is impossible for me to use ESLint and create-react-app together without getting linter errors. It would be cool if the no-unexpected-multiline rule could be either disabled or configured to not trigger in the cases that Prettier creates.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions