I have the following folder structure in my Meteor project.
> .meteor
>public
> client (dir)
>> foo.html &
>> foo.js
>> bar (dir: client/bar)
>>> bar.html &
>>> bar.js
> server
>> baz.js
I want to format all JS files inside of client directory
npx prettier --write 'client/**/*.js'
only formats files like bar.js. In reality I have up to 5 levels deep folders, and they need to be formatted too.
npx prettier --write 'client/**'
Works, but affects html (handlebar) files, I want to avoid that.
Any ideas? I can't find anything in the documentation, a part from manually adding an ignore to all .html files but that's an overkill.
I have the following folder structure in my Meteor project.
> .meteor
>public
> client (dir)
>> foo.html &
>> foo.js
>> bar (dir: client/bar)
>>> bar.html &
>>> bar.js
> server
>> baz.js
I want to format all JS files inside of client directory
npx prettier --write 'client/**/*.js'
only formats files like bar.js. In reality I have up to 5 levels deep folders, and they need to be formatted too.
npx prettier --write 'client/**'
Works, but affects html (handlebar) files, I want to avoid that.
Any ideas? I can't find anything in the documentation, a part from manually adding an ignore to all .html files but that's an overkill.
Share Improve this question asked Aug 24, 2021 at 11:01 AlexAlex 1,4204 gold badges22 silver badges40 bronze badges2 Answers
Reset to default 5Add a .prettierignore
file to your project root to ignore handlebars files, e. g.:
*.handlebars
You can add the following config to avoid handlebars (.hbs) formatting
"[handlebars]": {
"editor.formatOnSave": false,
"editor.formatOnPaste": false
}