question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule proposal: forbid superfluous enclosing spaces in same-line jsx components

See original GitHub issue

This would produce a warning:

<span> { tab.title } </span>

as it produces 3 <span> DOM nodes (typically not wanted)

This wouldn’t:

<span>{ tab.title }</span>

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ljharbcommented, Jan 13, 2021

Yes, i still think this would be a good rule (especially if it autofixed)for consistency’s sake.

0reactions
whymarrhcommented, Jan 13, 2021

It looks like newer versions of React take care of this, throwing away the extra whitespace.

That said, this would be a useful rule to have if only to enforce consistency—is a PR for this something y’all would consider?

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-react/jsx-space-before-closing.md at master
Rule Details. This rule checks if there is one or more spaces before the closing bracket of self-closing JSX elements. Rule Options.
Read more >
JSX In Depth - React
User-Defined Components Must Be Capitalized. When an element type starts with a lowercase letter, it refers to a built-in component like <div> or...
Read more >
Google JavaScript Style Guide
Trailing whitespace is forbidden. Beyond where required by the language or other style rules, and apart from literals, comments, and JSDoc, a single...
Read more >
Department of Labor - Regulations.gov
enclosed spaces, working near energized parts, grounding for ... proposed rule will prevent 116 injuries ... OSHA believes that it is unnecessary to....
Read more >
Electric Power Generation, Transmission, and Distribution
The Amoco Corp. made similar comments about the proposed regulations on hazardous energy control and on enclosed spaces (Ex. 3-73).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found