Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code, how to exclude directory from editor.formatOnSave

i am using a php formatter in VSCode, my problem is that on some view files where there is also html the code get messy, so i am trying to exclude the folder from the formatOnSave

This is my current configuration.

"editor.formatOnSave": true,
"[php]": {
    "editor.formatOnSave": false
}

How can i have the php format on save on all folders except the view one?

like image 299
B. Timsa Avatar asked Oct 29 '25 05:10

B. Timsa


1 Answers

If you're using Prettier, then you can create a .prettierignore file and include the directory that you want to exclude from formatting. You may need to go to the extension settings for Prettier and set the file path for .prettierignore for it to take effect.

like image 197
user838494 Avatar answered Oct 31 '25 01:10

user838494



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!