Skip to content

Proposal: Linting for missing spaces between tags #1515

Closed
@pfhayes

Description

@pfhayes

If your React markup looks like this:

<p>
  Here is a
  <a href="https://google.com>link</a>
  to Google
</p>

The whitespace will be collapsed and it will look like

Here is alinkto Google

Note that the whitespace is collapsed. The recommended solution from React is to write your code as

<p>
  Here is a
  {' '}
  <a href="https://google.com>link</a>
  {' '}
  to Google
</p>

which will render correctly.

It would be great if there was a lint rule that caught this.

  • Does this already exist?
  • Is this something desirable? I am happy to look into a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions