pretty-quick icon indicating copy to clipboard operation
pretty-quick copied to clipboard

Ignore errors with husky precommit hook

Open msacchetti opened this issue 3 years ago • 2 comments

I have the husky pretty quick setup and I'm formatting html files.

Some of my HTML files include a templating language that's not supported (it's a custom templating language)

When running the hook, it throws errors because it doesn't recognize this templating language

I know I can go add a prettier-ignore tag at the top of those html files. But there's so many id have to spend an hour doing it for those certain html files.

Is there a way to just ignore the errors thrown so that the hook doesn't fail when it hits those custom html files?

msacchetti avatar Dec 09 '21 21:12 msacchetti

Adding those files to your .prettierignore does not work for you? 🤔

https://prettier.io/docs/en/ignore.html#ignoring-files-prettierignore

nelson6e65 avatar Apr 03 '22 03:04 nelson6e65

There are like 750 HTML files and half of them need to be ignored. That's why in my original post I mentioned "But there's so many id have to spend an hour doing it for those certain html files."

I was just looking for a way to ignore the errors and still successfully run the commit. Because those files are the only ones with errors, I would have been comfortable bypassing the errors. We ended up just ignoring all HTML files. All good.

msacchetti avatar Apr 03 '22 03:04 msacchetti

add the files to the ignore list

andrewmclagan avatar Sep 08 '22 06:09 andrewmclagan

closing this because I know there is an ignore list.

nobody read what I actually asked and my response.

msacchetti avatar Sep 08 '22 15:09 msacchetti