prettier / prettier-vscode

Visual Studio Code extension for Prettier
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
MIT License
5.03k stars 447 forks source link

Inconsistent doctype case formatting #3358

Open MrDanielHarka opened 1 month ago

MrDanielHarka commented 1 month ago

No, I don't have a preference if the doctype is lowercase or uppercase, like the below mentions:

I really don't care. But please make it at least consistent. Now I get changes in git just because Prettier formats it inconsistently.

Prettier v10.4.0

Case 1: Prettier auto-formatting in VSCode with extension.

Input:

<!doctype html>

Output:

<!DOCTYPE html>

Case 2: Prettier CLI formatting using bunx prettier index.html

Input:

<!DOCTYPE html>

Output:

<!doctype html>

Expected behavior: The two tools should have the same case formatting for the doctype tag, whichever it is.

studioswong commented 2 weeks ago

Seconding this issue as I had just experienced the same while formatting my code via the CLI, and was confused about the discrepancy - what is the prettier's team's recommendation on this? ( I noticed multiple discussions on the debate between uppercase and lowercase, including this one - while my understanding is that the prettier team recommends lowercase and enforces it by default back in 2019, I wonder is this still the case now?)