.prettierignore file seems to be ignored

#37 · closed · 2 comments

View on GitHub ↗

garystephens

### Installed product versions - Visual Studio: 2019 Professional - This extension: 2.1.47 ### Description .prettierignore file seems to be ignored ### Steps to recreate 1. Create a .prettierignore file in the root folder of project, containing "*.js" 2. Turn on 'Format on Save' 3. Edit and save a .js file ### Current behavior File is formatted ### Expected behavior File should not be formatted The 'Format on Save' option seems to be ignoring the .prettierignore file (which is in the root folder of my project) - when I save a file, even though it's listed in the .prettierignore file, it still gets prettified. I've tried npm installing Prettier (V1 and V2), or using the Prettier built into the extension, with no success. But if I run Prettier from the command line, the .prettierignore file is not ignored. Is this a bug/missing features, or could I be doing something wrong? (I'm using VS2019, and Node.js 12.18.4)

Comments

HolgerJeromin

Perhaps related: https://github.com/prettier/prettier/issues/4081

garystephens

Thanks, the issue was indeed related to where I placed my .prettierIgnore file. I have my .sln file in one folder, and my .csproj / package.json / node_modules in a subfolder of that. I moved my .prettierIgnore from the subfolder to the folder where my .sln file is, and now it's working.