-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
lang:htmlIssues affecting HTML (and SVG but not JSX)Issues affecting HTML (and SVG but not JSX)status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be takentype:option requestIssues requesting a new option. We generally don’t accept these unless there is technical necessity.Issues requesting a new option. We generally don’t accept these unless there is technical necessity.
Description
Update:
I have change my opinion on this, and I don't think I require this any more. If this is ever implemented I would probably use it, but I really don't mind this behavior at all. If you want to read more, I wrote a post in dev.to
Original post:
Prettier 1.14.3
Playground link
# Options (if any):Input:
<input type="button">Output:
<input type="button" />Expected behavior:
I would like an option to prefer void element tags over the current implementation of self-closing element tags. I understand why is this the default behavior, as this is xml compatible, but several style guides suggest the usage of void tags as they are valid HTML5 tags. As I understand in the option philosophy, if there is enough usage from developers there is a justification to add the option.
Style Guides:
- https://google.github.io/styleguide/htmlcssguide.html#Document_Type
- https://codeguide.co/#html-syntax
- https://www.codestyle.co/Guidelines/html
- https://github.com/gocardless/html-style-guide
# Options:
--prefer-void-tags=true<input type="button">Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:htmlIssues affecting HTML (and SVG but not JSX)Issues affecting HTML (and SVG but not JSX)status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be takentype:option requestIssues requesting a new option. We generally don’t accept these unless there is technical necessity.Issues requesting a new option. We generally don’t accept these unless there is technical necessity.