-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENHANCEMENT] Vanilla Prettier setup in blueprints [RFC 1055] #10596
[ENHANCEMENT] Vanilla Prettier setup in blueprints [RFC 1055] #10596
Conversation
e6889c5
to
82981fb
Compare
4a37796
to
08865f4
Compare
77d8f44
to
fa6480f
Compare
fa6480f
to
30aef65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested alternative: can we put **/*.html
in the prettierignore?
Because the formatting prettier is producing here is not great. You were forced to add the special prettier-ignore comment line. And prettier is making several tags self-closing that are not actually supposed to be self-closing in the HTML spec.
The current blueprint doesn't do prettier formatting for html, so this is not a loss of existing functionality.
Separate question: is this introducing prettier formatting to markdown, and if so does it also rewrite people's READMEs? If so, that would possibly be another extension to ignore.
I'm now slightly worried that my RFC wasn't clear enough. Functionally, the ignore comments are not needed and I can remove them. |
hbs / gjs / etc are not explicitly HTML tho -- and this goes for jsx, vue, svelte, ng / angular, it's all shorthand to (eventually) generate HTML. the HTML file is the only real HTML we have. |
apparently there is a plugin that fixes the issue? prettier/prettier#15336 (comment) |
I'm only saying that formatting-wise the same issue occurs in hbs, gjs, ... |
Indeed, but I didn't really want to include yet another dependency in the blueprint. I would prefer to just follow Prettier. To me, that's kind of the point of using Prettier. Let it decide what's best readability/formatting wise. |
I agree with the point of prettier (I may not like it but I agree with what it's trying to do)... but in this case it's just wrong 🤔 Void elements are not and should not be "self closing" |
https://html.spec.whatwg.org/multipage/syntax.html#start-tags
|
if another vote matters, I agree with @mansona that Prettier is surely wrong and ignorant for that issue (the reason is most likely because of React and JSX, like this reddit thread suggest https://www.reddit.com/r/reactjs/comments/jc8964/self_closing_tags_in_react/) Hence, my vote goes to doing right thing and either ignore .html files (but do format .hbs, .gts, .gjs, etc.) or use Prettier plugin (only if it works perfectly). |
fwiw, I'm not arguing that Prettier is doing the right thing. I agree that it's not according to the spec. I just feel that's a discussion for the Prettier project. |
maybe we should do RFC amendment to clarify this in RFC rather than in this thread? just a thought |
Yeah, maybe it's safer to ignore html files for now then. Most projects only have 2 anyways. |
Looking at the RFC I think your intent is clear, but speaking for myself the thing I was paying attention to in the RFC is stopping running prettier inside eslint. That is, IMO, the most important motivation. Having the option of running prettier on more file types is only one of the benefits of that decision, and not nearly the most important one. (Having prettier inside eslint is miserable. I've seen way too many developers reacting to red squiggles from the prettier eslint plugin, which is defeats the point of having prettier, which should free you to stop paying attention to formatting). |
30aef65
to
cf19dec
Compare
HTML changes are reverted, and |
No description provided.