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
lint-staged failing with lerna/yarn workspaces since v12.3.3 #1105
Comments
Instead of running |
I see. I'm probably missing something, but when I run
I don't have this problem if I replace the yarn script with just
|
What's the Anyway, the problem with running lint-staged in parallel is that git has locking operations, and then fails on those. |
This will probably help: #1106 |
Yes! I checked out your branch and can confirm lint-staged now runs yarn scripts from the right path. |
Version 12.3.5 is now released and hopefully fixed this issue. Can you confirm? |
This is incorrect and causes Git lock problems. See https://github.com/okonet/lint-staged#how-to-use-lint-staged-in-a-multi-package-monorepo and lint-staged/lint-staged#1105
`lint-staged` should be run once from the root directory, and therefore that's where it should be installed. See https://github.com/okonet/lint-staged#how-to-use-lint-staged-in-a-multi-package-monorepo for more details. Additionally, running it in parallel causes Git lock conflicts: lint-staged/lint-staged#1105 (comment).
Lint-staged started erroring out since we upgraded to
v12.3.3
. Lerna runs lint-staged in each package within our monorepo. At times it throws a git error for large merges/diffs, but since this version lint-staged fails on every run. I'd like to avoid adding a concurrency rule to keep the pre-commit hook snappy.I was able to fix the issue by adding a
cwd .
arg to each individualpackage.json
files, but this feels hacky. I'm not sure I fully understand the original fix introducing the issue for us (#1091), but I'm under the impression that for monorepos it always makes sense to run in the current working directory?Steps to reproduce
Debug Logs
expand to view
Environment
lint-staged
: v12.3.3The text was updated successfully, but these errors were encountered: