prettier-vscode
prettier-vscode copied to clipboard
Wrong .prettierignore file used when using multiple sub folders
Summary
I have a monorepo project with multiple packages. Each of the them contains a .prettierignore and .prettierrc. Plus one at the root of the project for files located in the root. When I'm saving a file, a .prettierrc config file which is located closest to the saved file is being used. This is correct behaviour. However this does not work correctly for the .prettierignore file. Only the .prettierirnogr in project root is always used, no matter which file is being saved. Instead the .prettierignore closest to the saved file should be used.
This is basically a follow-up of the issue (https://github.com/prettier/prettier-vscode/issues/3003) already closed by the bot.
Github Repository to Reproduce Issue
I am using this repo https://github.com/KirianCaumes/Prettier-VsCode-Bug which was already used in the duplicate issue https://github.com/prettier/prettier-vscode/issues/3003 which was closed by the bot.
Steps To Reproduce:
- Open the ./should-be-ignored.yml file, and save it. It should be skipped because of the ./.prettierignore.
- Open the ./front/should-not-be-ignored.yml file, and save it. It is wrongly skipped because the ./.prettierignore is being used. Instead, the ./front/.prettierignore should be used the file should not be skipped.
Expected result
When saving a file in a subfolder with it's own .prettierignore, this one should be used, not the one at the root of the project. The behaviour should be the same as for the .prettierrc config.
Actual result
The root .prettierignore is used instead of the closest one.
Additional information
VS Code Version:
Version: 1.89.1 Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:14:32.757Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Darwin arm64 23.5.0
Prettier Extension Version:
v10.4.0
OS and version:
MacOS 14.5
I have the same issue
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
@ntotten I am sorry to bother you but this issue has been raised twice (https://github.com/prettier/prettier-vscode/issues/3003) and always closed by bot. Would you please comment whether this is something you plan to fix or not at all? Monorepos are suffering by this. Thanks a lot!
I have the same problem
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.