Skip to content

'jsx-newline' add ignore options #2926

Closed
@RaddishIoW

Description

@RaddishIoW

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": [ '{/* */}'] }
}

Metadata

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