-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: the .prettierignore file did not take effect during precommit #2744
fix: the .prettierignore file did not take effect during precommit #2744
Conversation
Is it feasible to |
Packaging for test is done in 5386706617 for commit 7f872e1 . |
It can be a bit complex, because the current process is:
To achieve the goal, you need to extract prettier from lint-staged and move it to .husky/pre-commit. |
I can understand all except
What does |
What I mean is that it will no longer be a part of lint-staged that is based on each package's independent configuration, but rather something configured relative to the root level. I hope that this kind of individual devops for each package should be maintained as much as possible within the package itself. |
Reasonable and let's keep prettier independent in packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When Lerna executes package scripts, it uses the package directory as the execution directory.
However, Prettier only reads the
.prettierignore
file in the execution directory, so the root-level.prettierignore
file is not effective when runningnpx lerna run --no-bail --stream precommit
.Since VSCode only reads the
.prettierignore
file in the opened folder, the file must exist in the root directory. Therefore, the current solution is adapted from prettier/prettier#4081 (comment).