Skip to content

'jsx-newline' add ignore options #2926

Closed

Description

I have the jsx-newline rule turned on, but it causes problems with any {/* eslint-disable-next-line <rulename> */} comments in my code.

If I have the following:

{/* eslint-disable-next-line react/forbid-component-props */}
<Button popoverOpen='#settings-popover' style={{ width: 'fit-content' }}>
  <Icon f7='gear' />
</Button>

jsx-newline marks the <Button ...> line as needing a newline before, causing the ignore-next-line comment to stop working.

Would it be possible to add options to the jsx-newline rule, to allow ignoring?
e.g.

"react/jsx-newline": {
    2,
    { "ignore": [ '{/* */}'] }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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