Format empty JSX tags to self-closing tags
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 52.3k
- Forks
- 5k
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 117
Description
Prettier should format empty JSX tags to self-closing tags. That's the reason self-closing tags were created. Prettier is an opinionated formatter and this opinion is easy to motivate.
I am aware of https://github.com/prettier/prettier/issues/6452 and https://github.com/prettier/prettier/pull/8730, but the discussion was about adding this as an option. This issue is for making this the norm.
Also, this is a stylistic issue and not a linting issue, so this should not be done via ESLint.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the discussion in issues #6452 and pull request #8730, then locate Prettier's JSX formatting entry point and existing tests. Done means empty JSX tags are consistently formatted as self-closing tags by default, without an ESLint option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100