Run prettier on HTML files#5839
Conversation
|
Fantastic, thanks! |
| <noscript> | ||
| You need to enable JavaScript to run this app. | ||
| </noscript> | ||
| <noscript> You need to enable JavaScript to run this app. </noscript> |
There was a problem hiding this comment.
I could have sworn I commented on this earlier. This all looks fine but the spacing inside this tag is weird. It's not a big deal, just kind of weird choice on behalf of prettier.
There was a problem hiding this comment.
Oh wow, that is weird. I wonder if it's a bug.
There was a problem hiding this comment.
I think it's technically correct because the whitespace that was there when things were on multiple lines does get turned into a single space as that's just how whitespace in HTML works. But preserving it in this case seems like an odd choice.
There was a problem hiding this comment.
Yeah, we can probably safely remove it.
There was a problem hiding this comment.
Definitely. I think Prettier is preserving it because in some cases you might be relying on that space. Think about how whitespace works in JSX in a multiline block. So I think Prettier is just playing it safe and leaving it there for you. But we definitely don't need it in this case.
There was a problem hiding this comment.
I've removed the extra spaces.
There was a problem hiding this comment.
There is an open issue in prettier for handling whitespace efficiently prettier/prettier#5439
* upstream/master: (210 commits) Support setupTests.ts (react#5698) Remove unnecessary whitespace in template HTML Run prettier on HTML files (react#5839) Some Grammar fixes (react#5858) Fix link to page about running tests (react#5883) fix: make typescriptformatter support 0.5 of fork checker (react#5879) Always test with the latest stable Node version on Travis (react#5546) Fix propertyDecorator test Upgrade babel deps Fix annotated var test Fix TypeScript decorator support (react#5783) fix: add `sideEffects: false` to react-error-overlay (react#5451) Add allowESModules option to babel-preset-react-app (react#5487) Make named-asset-import plugin work with export-as syntax (react#5573) React native repository updated in README.md (react#5849) extra polyfills must be included manually (react#5814) Rename 'getting started' link to 'docs' (react#5806) docs: Simplify installing Storybook with npx (react#5788) Don't polyfill fetch for Node -- additional files (react#5789) docs: Change Storybook install documentation (react#5779) ...
* master: (39 commits) Added extension to .eslintrc (react#5988) Update links to docs in all package README files (react#5912) Use https for linked images in docs to fix mixed content warnings (react#5985) Improve error messaging in verifyPackageTree.js (react#5974) Add removeItem to localStorage mock in docs (react#5919) Add SASS_PATH instructions to Sass docs (react#5917) Suggest a different default for speed reasons (react#5959) Add pre-eject message about new features in v2 (react#5954) Add netlify.toml to prepare for deploy to netlify react#5807 (react#5930) Correct some comments (react#5927) Add note to docs about using Sass and Flow together (react#5823) Update PWA link in README (react#5907) Add placeholders to template README for bit.ly links. (react#5808) Disable copy to clipboard in cra --info (react#5905) Support setupTests.ts (react#5698) Remove unnecessary whitespace in template HTML Run prettier on HTML files (react#5839) Some Grammar fixes (react#5858) Fix link to page about running tests (react#5883) fix: make typescriptformatter support 0.5 of fork checker (react#5879) ...
Prettier now supports HTML, Added html to
lint-statged.updated prettier to v1.15.2