-
Notifications
You must be signed in to change notification settings - Fork 4.1k
I2I: prettier for HTML #27198
Copy link
Copy link
Open
Labels
INTENT TO IMPLEMENTProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeStaleInactive for one year or moreInactive for one year or moreWG: infraWG: outreach
Metadata
Metadata
Assignees
Labels
INTENT TO IMPLEMENTProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeProposes implementation of a significant new feature. https://bit.ly/amp-contribute-codeStaleInactive for one year or moreInactive for one year or moreWG: infraWG: outreach
Motivation
prettieris used for automatically formatting most code in this repo, except for HTML files.When applying
prettierdirectly, the AMP boilerplate will explode into many lines, even though it's usually written as one. This creates noise.This issue describes a strategy for auto-formatting HTML files in this repository, while keeping the boilerplate written as one line.
State of
<!-- prettier-ignore --><!-- prettier-ignore -->will only ignore the first node on the next line. This is problematic for AMP documents that hold a second<noscript>node in their boilerplate, which will not be ignored. This applies for every AMP format except ads.A feature request for
prettierintroduces ignore range blocks for HTML. This would allow us to include any type of AMP boilerplate in one ignore section:Opportunities
Including the boilerplate in a
prettier-ignoreblock would allow the Playground to useprettier(/cc @ampproject/wg-outreach)/cc @ampproject/wg-infra