-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add an option to prefer void tags over self closing tags. #5246
Copy link
Copy link
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.
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.
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:
Output:
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:
# Options: --prefer-void-tags=true