Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After applying Prettier & Eslint code formats, it says there are changes in working tree, even there are no changes

Tags:

git

npm

After I made some changes on my project, I did npx prettier --write . && npx eslint . --fix.

It says most of files were modified in git directory, but actually, there are no changes in working tree, no space or row changes at all.

So what should I do for that?

Well, there are no changes, so I hope to there are no changes in git status, and just hope to commit only updated files I made..

like image 282
Gardener1688 Avatar asked Oct 24 '25 15:10

Gardener1688


1 Answers

I had the same problem, it looks like prettier marks all the formatted files as modified even when there is no change.

Once you stage the changes though, git will detect the actual changes, and the files that were not modified are not added to the commit.

To stage the changes you can use the git add command:

git add .
like image 50
Xavier Stévenne Avatar answered Oct 26 '25 04:10

Xavier Stévenne



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!