Search code examples
javascriptwildcardeslintprettier

Prettier.js confic how to convert any js file in any subfolder


I'm trying to run prettier for any js file inside the following folder:

prettier --config .prettierrc --write ./resources/assets/js/**

But it only converts the js files located into js folder. I would like to convert any js file in any subfolder inside /assets/js/...

Can someone help me?


Solution

  • I ended up using the following:

    prettier --write "./resources/assets/js/**{.js,}"

    And then I created an ignore file, that specifies any folders or file types that need to be ignored.

    .prettierignore

    resources/assets/js/vendor/
    *.min.js
    *.DS_Store