Closed violetadev closed 5 years ago
Hi, @hagenburger . Is it possible to use prettier
for html or css?
I've been searching for it but no luck.
And I tried with prettier cli
to see if it's working, but it's not working on html.
[error] No parser could be inferred for file: demo/index.html
Found this issue though, https://github.com/prettier/prettier/issues/4759
I'm getting errors when using prettier for the html/css. I found this also https://github.com/prettier/prettier/issues/1189
I tried running
npx prettier --write "**/*.*"
OK, good to know. @artnerdnet I tested it and it works.
In order to use prettier for html/css. We can't use prettier with eslint which we tried so far.
prettier
is also an executable module(it has a command) like eslint.
So, we can use npx prettier demo/css/*.*
as Nico said.
npx
, the tool lets you use execute prettier easily.
https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b
Without npx, we have 3 options to execute module like prettier. (NOTE: It's not only about prettier, it's common way to use executable devDependency modules)
npm run prettier
$ node_module/.bin/prettier demo/css/*.*
. (similar way with npx
)But with npx
, it makes things easier.
NOTE: You need parser
option to use prettier for html. Please follow below link.
https://github.com/prettier/prettier/pull/4753
https://prettier.io/docs/en/options.html#parser
@hagenburger Nico, which parser are you using for html?
for example prettier XXX --parser parse5
@benevbright no, I checked and I used the formatter out of VS Code. As Prettier’s HTML formatting is not complete yet, I would say let’s do it manually. The way I write HTML works very well with the guidelines in here: http://codeguide.co/#html-syntax
Hi, @artnerdnet
Your new commit is not based on origin/master
but greenkeeper branch
.
@benevbright is this ok now ? >.>
Hey @artnerdnet No, You somehow merged greenkeeper's branch with master and now your commit is based on it. greenkeeper branch should not be related with this commit.
@artnerdnet please check if your last commit contains all the changes. I only see the CNAME
file was deleted. But the missing newlines don’t appear.
I don't know what happened, I did git add . and then commited but it only added the CNAME removal, it looks like it's complete now
@artnerdnet please also add demo/js_dist/script.js
to the .gitignore
and do not commit the file. It’s quite big ;)
@hagenburger I added the folder js_dist/ to the gitignore, please confirm if this is correct. Thanks :)
V, I'm sorry that I couldn't make review at once.
@benevbright @hagenburger could you tell me if this is ok?
I have no idea why I found this now.
This closes #14