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
Prettier --write command changed not only staged files. #599
Comments
I am running into the same issue with the following in package.json:
I am not using lerna though. |
@DonikaV your issue is with the config you're using. You pass glob as an argument and that's why prettier runs on all matching files. Instead, remove the glob from arguments since that's exactly what lint-staged is doing for you under the hood. |
@okonet can you help me and say what exactly i should change? Thanks in advance. |
@DonikaV I thought I did:
You should change it to this: linters:
"src/main/js/**/*.{js,jsx,mjs}":
- - "prettier --write 'src/main/js/**/*.{js,jsx,mjs}'"
+ - "prettier --write"
- "git add" |
@okonet Thanks! Will try tomorrow. |
@okonet works good! Thanks again! |
Not sure what you mean but I remember there is a package that allows not running recommit hooks based on user's settings. I can't find it though :-( |
@okonet I mean, backend guys are to lazy and they don’t want run npm install. :D |
I have monorepo with lerna. The setup is like here https://github.com/sudo-suhas/lint-staged-multi-pkg/blob/master/package.json
Steps to reproduce
In each folder i have this .linkstagedrc.yml with
The problem is - i modified only one js file. I do commit, and then in git i see much more files than one. But i want modify only staged file.
Can someone help me with that? Thanks.
Environment
lint-staged
: latestThe text was updated successfully, but these errors were encountered: