Prettier --write command changed not only staged files.
See original GitHub issueI 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
linters:
"src/main/js/**/*.{js,jsx,mjs}":
- "prettier --write 'src/main/js/**/*.{js,jsx,mjs}'"
- "git add"
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
- OS: Macos
- Node.js: current LTS (10*)
lint-staged
: latest
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Pre-commit Hook - Prettier
You can use Prettier with a pre-commit tool. This can re-format your files that are marked as “staged” via `git add` before you...
Read more >How Do I Run Prettier Only on Files That I Want to Commit?
This project contains a script that will run arbitrary npm and shell tasks with a list of staged files as an argument, filtered...
Read more >Linting Staged Git Files with lint-staged -- newline - Fullstack.io
Anytime a JavaScript file is staged for a commit, lint-staged runs the ESLint linter with the --cache and --fix options. --cache tells ESLint ......
Read more >Automate and Keep Your Code Consistent Using ESLint ...
In this article, we will automate the process using ESLint, Prettier, Husky, and Lint-Staged to make sure that the code is formatted and ......
Read more >Enabling Prettier - Rush.js
Note that the Git hook will implicitly filter any files that are not committed to Git, ... This command invokes Prettier to reformat...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DonikaV I thought I did:
You should change it to this:
@okonet I mean, backend guys are to lazy and they don’t want run npm install. 😄 Ok, I will try to find something in google 😃